]> Dogcows Code - chaz/openbox/commitdiff
Various fixes for sparse warnings.
authorMikael Magnusson <mikachu@comhem.se>
Wed, 16 Jan 2008 14:25:08 +0000 (15:25 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Wed, 16 Jan 2008 14:35:25 +0000 (15:35 +0100)
Define void functions with (void), not ().
Add missing includes.
Some functions were declared static but defined non-static.
Some variables that should be file static were file global but not used in any other file.
prop.h defined a new prop_atoms in each file that included it instead of declaring it extern.

15 files changed:
openbox/actions.c
openbox/client.c
openbox/client_list_combined_menu.c
openbox/event.c
openbox/focus_cycle_indicator.c
openbox/keyboard.c
openbox/mainloop.c
openbox/ping.c
openbox/prop.h
openbox/resist.c
openbox/screen.c
openbox/stacking.c
openbox/translate.c
openbox/xerror.c
render/instance.c

index 75d4af059174a3a19d49f799be32384a5f308681..0c84489a679f75b1d16c965b3f7b39d1db60b298 100644 (file)
@@ -124,7 +124,7 @@ static void actions_definition_unref(ObActionsDefinition *def)
     }
 }
 
-ObActionsAct* actions_build_act_from_string(const gchar *name)
+static ObActionsAct* actions_build_act_from_string(const gchar *name)
 {
     GSList *it;
     ObActionsDefinition *def = NULL;
index c90c39bf7cceefa6cc658e38c828a0dd0d203189..6a6ec2bded867f0516fbbae97bbbde527f31ad2a 100644 (file)
@@ -24,6 +24,7 @@
 #include "xerror.h"
 #include "screen.h"
 #include "moveresize.h"
+#include "ping.h"
 #include "place.h"
 #include "prop.h"
 #include "extensions.h"
@@ -79,6 +80,10 @@ static void client_get_state(ObClient *self);
 static void client_get_shaped(ObClient *self);
 static void client_get_mwm_hints(ObClient *self);
 static void client_get_colormap(ObClient *self);
+static void client_set_desktop_recursive(ObClient *self,
+                                         guint target,
+                                         gboolean donthide,
+                                         gboolean dontraise);
 static void client_change_allowed_actions(ObClient *self);
 static void client_change_state(ObClient *self);
 static void client_change_wm_state(ObClient *self);
@@ -1551,7 +1556,7 @@ void client_update_sync_request_counter(ObClient *self)
 }
 #endif
 
-void client_get_colormap(ObClient *self)
+static void client_get_colormap(ObClient *self)
 {
     XWindowAttributes wa;
 
@@ -3276,10 +3281,10 @@ void client_hilite(ObClient *self, gboolean hilite)
     }
 }
 
-void client_set_desktop_recursive(ObClient *self,
-                                  guint target,
-                                  gboolean donthide,
-                                  gboolean dontraise)
+static void client_set_desktop_recursive(ObClient *self,
+                                         guint target,
+                                         gboolean donthide,
+                                         gboolean dontraise)
 {
     guint old;
     GSList *it;
index 194c927e14680791fb8efc723cda181c77b0badb..f7fc36b875105184cdea7284d84044a0b78a23c4 100644 (file)
@@ -30,7 +30,7 @@
 
 #define MENU_NAME "client-list-combined-menu"
 
-ObMenu *combined_menu;
+static ObMenu *combined_menu;
 
 #define SEPARATOR -1
 #define ADD_DESKTOP -2
index 5d85eaeb3dfdecbf771533c9dbb3a4f199c4f323..f4ebfa475907b888bf528fe7294ac79d6e741231 100644 (file)
@@ -43,6 +43,7 @@
 #include "stacking.h"
 #include "extensions.h"
 #include "translate.h"
+#include "ping.h"
 
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
@@ -102,8 +103,8 @@ static void focus_delay_client_dest(ObClient *client, gpointer data);
 Time event_curtime = CurrentTime;
 Time event_last_user_time = CurrentTime;
 /*! The serial of the current X event */
-gulong event_curserial;
 
+static gulong event_curserial;
 static gboolean focus_left_screen = FALSE;
 /*! A list of ObSerialRanges which are to be ignored for mouse enter events */
 static GSList *ignore_serials = NULL;
@@ -1917,7 +1918,7 @@ static void focus_delay_client_dest(ObClient *client, gpointer data)
                                      client, FALSE);
 }
 
-void event_halt_focus_delay()
+void event_halt_focus_delay(void)
 {
     /* ignore all enter events up till the event which caused this to occur */
     if (event_curserial) event_ignore_enter_range(1, event_curserial);
index 340abec657e89b954dbe127e48a84700a773e23e..0aa65a75696019ecbab816a922597c1dfc49b8f3 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "focus_cycle.h"
+#include "focus_cycle_indicator.h"
 #include "client.h"
 #include "openbox.h"
 #include "frame.h"
@@ -29,7 +30,7 @@
 
 #define FOCUS_INDICATOR_WIDTH 6
 
-struct
+static struct
 {
     InternalWindow top;
     InternalWindow left;
index eddda577c6f113e878263d320ee43aad8e4f9fc6..4c570dfbe4a0b20aa89fae6519c008385adb16d7 100644 (file)
@@ -265,7 +265,7 @@ void keyboard_event(ObClient *client, const XEvent *e)
     }
 }
 
-void keyboard_rebind()
+void keyboard_rebind(void)
 {
     tree_rebind(keyboard_firstnode);
     grab_keys(TRUE);
index 825d3f4febc7f0a0c321bdccc177074388c88c5f..f78f5b128ed39a31d21a266ea407bbba59cc1043 100644 (file)
@@ -39,13 +39,13 @@ typedef struct _ObMainLoopFdHandlerType     ObMainLoopFdHandlerType;
 static GSList *all_loops;
 
 /* signals are global to all loops */
-struct {
+static struct {
     guint installed; /* a ref count */
     struct sigaction oldact;
 } all_signals[NUM_SIGNALS];
 
 /* a set of all possible signals */
-sigset_t all_signals_set;
+static sigset_t all_signals_set;
 
 /* signals which cause a core dump, these can't be used for callbacks */
 static gint core_signals[] =
index d4217fdde4c0d3dfb9a427e5889134907647c4cd..eed094796045562fc7ef328f6e2d816408420e45 100644 (file)
@@ -21,6 +21,7 @@
 #include "client.h"
 #include "prop.h"
 #include "event.h"
+#include "debug.h"
 #include "mainloop.h"
 #include "openbox.h"
 
index 92884144451da9d1c32892bf5aeed4c95ebf9b27..5ca70470991e941ca22d76b6a02c7ebda48c7fbc 100644 (file)
@@ -196,7 +196,7 @@ typedef struct Atoms {
     Atom ob_theme;
     Atom ob_control;
 } Atoms;
-Atoms prop_atoms;
+extern Atoms prop_atoms;
 
 void prop_startup();
 
index 62c2b293f0b9fe1879df403e0c5db067c24c15ca..f21eb8e682e3c8eb63c7453f4ec41c472e9f4d36 100644 (file)
@@ -23,6 +23,7 @@
 #include "screen.h"
 #include "dock.h"
 #include "config.h"
+#include "resist.h"
 #include "parser/parse.h"
 
 #include <glib.h>
index b88562fe3ae24e2a83aa2d9c760ffec2b83c93d0..e008ffe5dfa644e3ce42017b2a615d338de8d9a9 100644 (file)
@@ -60,15 +60,15 @@ guint    screen_num_desktops;
 guint    screen_num_monitors;
 guint    screen_desktop;
 guint    screen_last_desktop = 1;
-guint    screen_old_desktop;
-gboolean screen_desktop_timeout = TRUE;
-Size     screen_physical_size;
 gboolean screen_showing_desktop;
 ObDesktopLayout screen_desktop_layout;
 gchar  **screen_desktop_names;
 Window   screen_support_win;
 Time     screen_desktop_user_time = CurrentTime;
 
+static Size     screen_physical_size;
+static guint    screen_old_desktop;
+static gboolean screen_desktop_timeout = TRUE;
 /*! An array of desktops, holding array of areas per monitor */
 static Rect  *monitor_area = NULL;
 /*! An array of desktops, holding an array of struts */
index 34ab05888956bfc0333e8c1a50c04b82e6a3ec80..b18c02af8e61bd8bde77addaf0f5e52091a240aa 100644 (file)
@@ -31,7 +31,7 @@ GList  *stacking_list = NULL;
 /*! When true, stacking changes will not be reflected on the screen.  This is
   to freeze the on-screen stacking order while a window is being temporarily
   raised during focus cycling */
-gboolean pause_changes = FALSE;
+static gboolean pause_changes = FALSE;
 
 void stacking_set_list(void)
 {
@@ -134,7 +134,7 @@ void stacking_temp_raise(ObWindow *window)
     pause_changes = TRUE;
 }
 
-void stacking_restore()
+void stacking_restore(void)
 {
     Window *win;
     GList *it;
index b2ae7d677eca6a619df161bba1eca8b7d2a10ea5..c697679d1291fd03da7f0837f384ac1475f8e11f 100644 (file)
@@ -20,6 +20,7 @@
 #include "openbox.h"
 #include "mouse.h"
 #include "modkeys.h"
+#include "translate.h"
 #include "gettext.h"
 #include <glib.h>
 #include <string.h>
index 6e8846076fd8f0ed38448223bf64dda5edb15531..2657b8ea9c7f9d49a0f1a9a78e67a8d03e99cf63 100644 (file)
@@ -20,6 +20,7 @@
 #include "openbox.h"
 #include "gettext.h"
 #include "debug.h"
+#include "xerror.h"
 #include <glib.h>
 #include <X11/Xlib.h>
 
index 91f9db77934ff309d8f8ef05ea67041b21b68d21..b867815c31c5096b44b9b7a6b2470fef8a6402f6 100644 (file)
@@ -91,7 +91,7 @@ RrInstance* RrInstanceNew (Display *display, gint screen)
     return definst;
 }
 
-void RrTrueColorSetup (RrInstance *inst)
+static void RrTrueColorSetup (RrInstance *inst)
 {
   gulong red_mask, green_mask, blue_mask;
   XImage *timage = NULL;
@@ -121,7 +121,7 @@ void RrTrueColorSetup (RrInstance *inst)
 
 #define RrPseudoNcolors(inst) (1 << (inst->pseudo_bpc * 3))
 
-void RrPseudoColorSetup (RrInstance *inst)
+static void RrPseudoColorSetup (RrInstance *inst)
 {
     XColor icolors[256];
     gint tr, tg, tb, n, r, g, b, i, incolors, ii;
This page took 0.043234 seconds and 4 git commands to generate.