From bd519dd95200aa432fb3b431a4244ffb25c5de93 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 3 Jan 2015 18:43:44 +0100 Subject: Remove various unused variables Clang and Gcc-4.9 complaint about some unused variables here and there. And who are we to not make a compiler happy :) --- src/FbRootWindow.cc | 2 +- src/FbTk/FbWindow.cc | 1 - src/Keys.cc | 1 - src/Remember.cc | 15 ++++++--------- src/RowSmartPlacement.cc | 8 +++++--- src/SystemTray.cc | 11 ++++------- src/Window.cc | 11 +++++------ util/fluxbox-remote.cc | 2 -- 8 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/FbRootWindow.cc b/src/FbRootWindow.cc index e329719..0cd730e 100644 --- a/src/FbRootWindow.cc +++ b/src/FbRootWindow.cc @@ -55,7 +55,7 @@ FbRootWindow::FbRootWindow(int screen_num): for (int i = 0; i < vinfo_nitems; i++) { if ((DefaultDepth(disp, screen_num) < vinfo_return[i].depth) - && (depth() < vinfo_return[i].depth)){ + && (static_cast(depth()) < vinfo_return[i].depth)){ m_visual = vinfo_return[i].visual; setDepth(vinfo_return[i].depth); } diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 4582574..fb1c7af 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc @@ -495,7 +495,6 @@ long FbWindow::cardinalProperty(Atom prop,bool*exists) const { Atom type; int format; unsigned long nitems, bytes_after; - int result; long* num; long ret=0; if (exists) *exists=false; diff --git a/src/Keys.cc b/src/Keys.cc index 6222ac2..19689f7 100644 --- a/src/Keys.cc +++ b/src/Keys.cc @@ -490,7 +490,6 @@ bool Keys::addBinding(const string &linebuffer) { } mod = 0; key = 0; - type = 0; context = 0; isdouble = false; } diff --git a/src/Remember.cc b/src/Remember.cc index 3ca8fcf..3557439 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -453,12 +453,9 @@ int parseApp(ifstream &file, Application &app, string *first_line = 0) { } if (err > 0 ) { parse_pos += err; - err = FbTk::StringUtil::getStringBetween(str_label, + FbTk::StringUtil::getStringBetween(str_label, line.c_str() + parse_pos, '{', '}'); - if (err>0) { - parse_pos += err; - } } else continue; //read next line @@ -1131,7 +1128,7 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) { app = add(winclient); if (!app) return; } - int head, head_x, head_y, win_w, win_h, percx, percy; + int head, percx, percy; switch (attrib) { case REM_WORKSPACE: app->rememberWorkspace(win->workspaceNumber()); @@ -1141,15 +1138,15 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) { break; case REM_DIMENSIONS: { head = win->screen().getHead(win->fbWindow()); - int percx = win->screen().calRelativeDimensionWidth(head, win->normalWidth()); - int percy = win->screen().calRelativeDimensionHeight(head, win->normalHeight()); + percx = win->screen().calRelativeDimensionWidth(head, win->normalWidth()); + percy = win->screen().calRelativeDimensionHeight(head, win->normalHeight()); app->rememberDimensions(percx, percy, true); break; } case REM_POSITION: { head = win->screen().getHead(win->fbWindow()); - int percx = win->screen().calRelativePositionWidth(head, win->normalX()); - int percy = win->screen().calRelativePositionHeight(head, win->normalY()); + percx = win->screen().calRelativePositionWidth(head, win->normalX()); + percy = win->screen().calRelativePositionHeight(head, win->normalY()); app->rememberPosition(percx, percy, true); break; } diff --git a/src/RowSmartPlacement.cc b/src/RowSmartPlacement.cc index 79b42bb..eca867f 100644 --- a/src/RowSmartPlacement.cc +++ b/src/RowSmartPlacement.cc @@ -59,10 +59,12 @@ bool RowSmartPlacement::placeWindow(const FluxboxWindow &win, int head, bool left_right = screen_placement.rowDirection() == ScreenPlacement::LEFTRIGHT; - int change_x = 1, change_y = 1; + int change_x = 1; - if (screen_placement.colDirection() == ScreenPlacement::BOTTOMTOP) - change_y = -1; +// unused code: +// int change_y = 1; +// if (screen_placement.colDirection() == ScreenPlacement::BOTTOMTOP) +// change_y = -1; if (screen_placement.rowDirection() == ScreenPlacement::RIGHTLEFT) change_x = -1; diff --git a/src/SystemTray.cc b/src/SystemTray.cc index 846181f..9811508 100644 --- a/src/SystemTray.cc +++ b/src/SystemTray.cc @@ -75,18 +75,15 @@ public: int actual_format; unsigned long nitems, bytes_after; unsigned long *prop; - bool mapped = false; Atom embed_info = SystemTray::getXEmbedInfoAtom(); if (property(embed_info, 0l, 2l, false, embed_info, &actual_type, &actual_format, &nitems, &bytes_after, (unsigned char **) &prop) && prop != 0) { - mapped = (bool)(static_cast(prop[1]) & XEMBED_MAPPED); - XFree(static_cast(prop)); - - - fbdbg<<"(SystemTray::TrayWindow::getMappedDefault(): XEMBED_MAPPED = "<(prop)); + fbdbg << "(SystemTray::TrayWindow::getMappedDefault(): XEMBED_MAPPED = " + << (bool)(static_cast(prop[1]) & XEMBED_MAPPED) + << endl; } return true; } diff --git a/src/Window.cc b/src/Window.cc index 2b997a7..cb0689e 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -332,12 +332,11 @@ FluxboxWindow::~FluxboxWindow() { unregisterWindow(frame().window().window()); } - - const char* title = m_client ? m_client->title().logical().c_str() : "" ; - fbdbg<<"starting ~FluxboxWindow("<title().logical().c_str() : "") << ")" << endl + << "num clients = " << numClients() << endl + << "curr client = "<< m_client << endl + << "m_labelbuttons.size = " << m_labelbuttons.size() << endl; if (moving) stopMoving(true); diff --git a/util/fluxbox-remote.cc b/util/fluxbox-remote.cc index 0fcd118..59852e6 100644 --- a/util/fluxbox-remote.cc +++ b/util/fluxbox-remote.cc @@ -43,7 +43,6 @@ int main(int argc, char **argv) { int rc; Display* disp; Window root; - Atom atom_utf8; Atom atom_fbcmd; Atom atom_result; xerror_cb_t error_cb; @@ -62,7 +61,6 @@ int main(int argc, char **argv) { } cmd = argv[1]; - atom_utf8 = XInternAtom(disp, "UTF8_STRING", False); atom_fbcmd = XInternAtom(disp, "_FLUXBOX_ACTION", False); atom_result = XInternAtom(disp, "_FLUXBOX_ACTION_RESULT", False); root = DefaultRootWindow(disp); -- cgit v0.11.2