From acf4326f3cc3451aaf874b0b0777d69be5834e57 Mon Sep 17 00:00:00 2001 From: simonb Date: Mon, 24 Apr 2006 14:29:21 +0000 Subject: Use -Wall when --enable-debug and some warning fixes + thanks Jonas Koelker --- ChangeLog | 5 +++++ configure.in | 2 +- src/ClockTool.cc | 2 +- src/Ewmh.cc | 8 ++++---- src/FbTk/FbWindow.hh | 1 + src/FbTk/SignalHandler.hh | 1 + src/LayerMenu.hh | 1 + src/PlacementStrategy.hh | 1 + src/Window.cc | 3 +-- src/main.cc | 7 ++++--- 10 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97023c6..3bad7b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ (Format: Year/Month/Day) Changes for 0.9.16: *06/04/24: + * Use -Wall when --enable-debug and some warning fixes + (Simon + thanks Jonas Koelker) + configure.in ClockTool.cc main.cc Ewmh.cc Window.cc + PlacementStrategy.hh LayerMenu.hh FbTk/SignalHandler.hh + FbTk/FbWindow.hh * Fix memory leaks & other errors in Menu code (Simon) Screen.cc Slit.cc Toolbar.cc fluxbox.cc MenuCreator.cc FbTk/Menu.cc * Use external tabs by default (Simon) diff --git a/configure.in b/configure.in index 5f6d4f0..5659ef6 100644 --- a/configure.in +++ b/configure.in @@ -320,7 +320,7 @@ AC_ARG_ENABLE(debug, [ --enable-debug include verbose debugging code [default=no]], if test x$enableval = "xyes"; then AC_MSG_RESULT([yes]) - DEBUG="-DDEBUG" + DEBUG="-DDEBUG -Wall" else AC_MSG_RESULT([no]) fi, diff --git a/src/ClockTool.cc b/src/ClockTool.cc index e4b6c0c..2c0ad46 100644 --- a/src/ClockTool.cc +++ b/src/ClockTool.cc @@ -257,7 +257,7 @@ void ClockTool::updateTime() { return; m_button.setText(time_string); - int new_width = m_theme.font().textWidth(time_string, time_string_len) + 2; + unsigned int new_width = m_theme.font().textWidth(time_string, time_string_len) + 2; if (new_width > m_button.width()) { resize(new_width, m_button.height()); resizeSig().notify(); diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 96722d1..6bcd3e6 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -267,8 +267,8 @@ void Ewmh::setupFrame(FluxboxWindow &win) { if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL, &ret_type, &fmt, &nitems, &bytes_after, (unsigned char **) &data) && data) { - unsigned int desktop = static_cast(*data); - if (desktop == 0xFFFFFFFF && !win.isStuck()) + unsigned int desktop = static_cast(*data); + if (desktop == -1 && !win.isStuck()) win.stick(); else win.setWorkspace(desktop); @@ -634,7 +634,7 @@ void Ewmh::updateWorkspace(FluxboxWindow &win) { long workspace = win.isInitialized() ? win.workspaceNumber() : win.screen().currentWorkspaceID(); if (win.isStuck()) - workspace = 0xFFFFFFFF; // appear on all desktops/workspaces + workspace = -1; // appear on all desktops/workspaces FluxboxWindow::ClientList::iterator it = win.clientList().begin(); FluxboxWindow::ClientList::iterator it_end = win.clientList().end(); @@ -661,7 +661,7 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, // if it's stick, make sure it is stuck. // otherwise, make sure it isn't stuck - if (ce.data.l[0] == 0xFFFFFFFF) { + if (ce.data.l[0] == -1) { if (!fbwin->isStuck()) fbwin->stick(); return true; diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index 3a5d18d..8f7376c 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh @@ -266,6 +266,7 @@ private: class FbWindowRenderer { public: virtual void renderForeground(FbWindow &win, FbDrawable &drawable) = 0; + virtual ~FbWindowRenderer() { } }; diff --git a/src/FbTk/SignalHandler.hh b/src/FbTk/SignalHandler.hh index 23bac97..7b013cf 100644 --- a/src/FbTk/SignalHandler.hh +++ b/src/FbTk/SignalHandler.hh @@ -33,6 +33,7 @@ namespace FbTk { class SignalEventHandler { public: virtual void handleSignal(int signum) = 0; + virtual ~SignalEventHandler() { } }; /// Handles system signals, singleton. diff --git a/src/LayerMenu.hh b/src/LayerMenu.hh index e22ba30..724e7bc 100644 --- a/src/LayerMenu.hh +++ b/src/LayerMenu.hh @@ -34,6 +34,7 @@ class LayerObject { public: virtual void moveToLayer(int layer_number) = 0; virtual int layerNumber() const = 0; + virtual ~LayerObject() { } }; diff --git a/src/PlacementStrategy.hh b/src/PlacementStrategy.hh index 19376ca..001218d 100644 --- a/src/PlacementStrategy.hh +++ b/src/PlacementStrategy.hh @@ -40,6 +40,7 @@ struct PlacementStrategy { virtual bool placeWindow(const std::vector &windowlist, const FluxboxWindow &win, int &place_x, int &place_y) = 0; + virtual ~PlacementStrategy() { } }; #endif // PLACEMENTSTRATEGY_HH diff --git a/src/Window.cc b/src/Window.cc index 7ffc1d5..31f4374 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3378,7 +3378,7 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) { // test against tabs too bool i_have_tabs = frame().externalTabMode(); - int xoff,yoff,woff,hoff; + int xoff = 0, yoff = 0, woff = 0, hoff = 0; if (i_have_tabs) { xoff = xOffset(); yoff = yOffset(); @@ -3386,7 +3386,6 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) { hoff = heightOffset(); } - ///////////////////////////////////// // begin by checking the screen (or Xinerama head) edges diff --git a/src/main.cc b/src/main.cc index fedc3a9..b458fbf 100644 --- a/src/main.cc +++ b/src/main.cc @@ -304,9 +304,10 @@ int main(int argc, char **argv) { cerr.rdbuf(errbuf); if (restarting) { - if (restart_argument.c_str()) { - execlp(restart_argument.c_str(), restart_argument.c_str(), 0); - perror(restart_argument.c_str()); + const char *arg = restart_argument.c_str(); + if (arg) { + execlp(arg, arg, (char *) NULL); + perror(arg); } // fall back in case the above execlp doesn't work -- cgit v0.11.2