From: Christophe CURIS <[email protected]>

Multiple declaration of global variables in local source files is
a dangerous idea.
---
 src/cycling.c   | 2 --
 src/defaults.c  | 2 --
 src/event.c     | 2 --
 src/keybind.h   | 6 ++++++
 src/startup.c   | 3 ---
 src/window.c    | 2 --
 src/winmenu.c   | 3 ---
 src/workspace.c | 1 -
 8 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/cycling.c b/src/cycling.c
index a1816dd..7a9afc9 100644
--- a/src/cycling.c
+++ b/src/cycling.c
@@ -38,8 +38,6 @@
 #include "xinerama.h"
 #include "switchpanel.h"
 
-/* Globals */
-extern WShortKey wKeyBindings[WKBD_LAST];
 
 static void raiseWindow(WSwitchPanel * swpanel, WWindow * wwin)
 {
diff --git a/src/defaults.c b/src/defaults.c
index 1eaa3cf..0fb2bbc 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -71,8 +71,6 @@
 #define GLOBAL_DEFAULTS_SUBDIR "WindowMaker"
 #endif
 
-/***** Global *****/
-extern WShortKey wKeyBindings[WKBD_LAST];
 
 typedef struct _WDefaultEntry  WDefaultEntry;
 typedef int (WDECallbackConvert) (WScreen *scr, WDefaultEntry *entry, 
WMPropList *plvalue, void *addr, void **tdata);
diff --git a/src/event.c b/src/event.c
index 31a82a3..6a34892 100644
--- a/src/event.c
+++ b/src/event.c
@@ -76,8 +76,6 @@
 #include "winmenu.h"
 #include "switchmenu.h"
 
-/******** Global Variables **********/
-extern WShortKey wKeyBindings[WKBD_LAST];
 
 #define MOD_MASK wPreferences.modifier_mask
 
diff --git a/src/keybind.h b/src/keybind.h
index bf02965..6576a16 100644
--- a/src/keybind.h
+++ b/src/keybind.h
@@ -128,6 +128,12 @@ typedef struct WShortKey {
     KeyCode keycode;
 } WShortKey;
 
+/* ---[ Global Variables ]------------------------------------------------ */
+
+extern WShortKey wKeyBindings[WKBD_LAST];
+
+/* ---[ Functions ]------------------------------------------------------- */
+
 void wKeyboardInitialize(void);
 
 #endif /* WMKEYBIND_H */
diff --git a/src/startup.c b/src/startup.c
index 915e065..90154d8 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -84,9 +84,6 @@
 # define SA_NODEFER 0
 #endif
 
-/****** Global Variables ******/
-extern WShortKey wKeyBindings[WKBD_LAST];
-
 /***** Local *****/
 static WScreen **wScreen = NULL;
 static unsigned int _NumLockMask = 0;
diff --git a/src/window.c b/src/window.c
index 7b3cda2..df7e6ca 100644
--- a/src/window.c
+++ b/src/window.c
@@ -72,8 +72,6 @@
 
 #define MOD_MASK wPreferences.modifier_mask
 
-/****** Global Variables ******/
-extern WShortKey wKeyBindings[WKBD_LAST];
 
 /***** Local Stuff *****/
 static WWindowState *windowState = NULL;
diff --git a/src/winmenu.c b/src/winmenu.c
index b4773a6..8201747 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -68,9 +68,6 @@
 #define WO_OMNIPRESENT         2
 #define WO_ENTRIES             3
 
-/**** Global data ***/
-extern WShortKey wKeyBindings[WKBD_LAST];
-
 
 static void updateOptionsMenu(WMenu * menu, WWindow * wwin);
 
diff --git a/src/workspace.c b/src/workspace.c
index 9455691..d02e9f7 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -59,7 +59,6 @@
 #define MAX_SHORTCUT_LENGTH 32
 #define WORKSPACE_NAME_DISPLAY_PADDING 32
 
-extern WShortKey wKeyBindings[WKBD_LAST];
 
 static WMPropList *dWorkspaces = NULL;
 static WMPropList *dClip, *dName;
-- 
1.8.4.rc3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to