>From 87bc02e7c99e5323798cef434f164b6ede07465e Mon Sep 17 00:00:00 2001
From: Rodolfo García Peñas (kix) <k...@kix.es>
Date: Wed, 25 Jan 2012 07:27:51 +0100
Subject: [PATCH 18/24] WindowMaker: inotify variables, Locale and wScreenCount 
moved to WindowMaker.c

These variables are moved to WindowMaker.c and now don't need extern.
---
 src/WindowMaker.h |   10 ++++++++++
 src/defaults.c    |    1 -
 src/event.c       |    3 ---
 src/main.c        |   16 ++++------------
 src/rootmenu.c    |    2 --
 src/screen.c      |    3 ---
 src/shutdown.c    |    5 -----
 src/startup.c     |    1 -
 8 files changed, 14 insertions(+), 27 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 4003aba..42143fa 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -500,4 +500,14 @@ WDDomain *WDWindowMaker;
 WDDomain *WDWindowAttributes;
 WDDomain *WDRootMenu;
 
+#ifdef HAVE_INOTIFY
+int inotifyFD;
+int inotifyWD;
+#endif
+
+/* locale to use. NULL==POSIX or C */
+char *Locale;
+
+int wScreenCount;
+
 #endif
diff --git a/src/defaults.c b/src/defaults.c
index 3e421b4..8b2ffd4 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -69,7 +69,6 @@
 #endif
 
 /***** Global *****/
-extern int wScreenCount;
 extern WShortKey wKeyBindings[WKBD_LAST];
 
 typedef struct {
diff --git a/src/event.c b/src/event.c
index f034764..196dbea 100644
--- a/src/event.c
+++ b/src/event.c
@@ -70,7 +70,6 @@
 
 /******** Global Variables **********/
 extern WShortKey wKeyBindings[WKBD_LAST];
-extern int wScreenCount;
 
 #define MOD_MASK wPreferences.modifier_mask
 
@@ -351,8 +350,6 @@ void EventLoop(void)
 {
        XEvent event;
 #ifdef HAVE_INOTIFY
-       extern int inotifyFD;
-       extern int inotifyWD;
        struct timeval time;
        fd_set rfds;
        int retVal = 0;
diff --git a/src/main.c b/src/main.c
index d9ce2a3..ee91ee3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,21 +59,9 @@
 #define GLOBAL_DEFAULTS_SUBDIR "WindowMaker"
 #endif
 
-/****** Global Variables ******/
-
 /* general info */
-
 char *ProgName;
 
-#ifdef HAVE_INOTIFY
-int inotifyFD;
-int inotifyWD;
-#endif
-/* locale to use. NULL==POSIX or C */
-char *Locale = NULL;
-
-int wScreenCount = 0;
-
 WMPropList *wDomainName;
 WMPropList *wAttributeDomainName;
 
@@ -487,6 +475,10 @@ int main(int argc, char **argv)
        WDWindowAttributes = NULL;
        WDRootMenu = NULL;
 
+       /* locale to use. NULL==POSIX or C */
+       Locale = NULL;
+       wScreenCount = 0;
+
        /* setup common stuff for the monitor and wmaker itself */
        WMInitializeApplication("WindowMaker", &argc, argv);
 
diff --git a/src/rootmenu.c b/src/rootmenu.c
index c592cbd..2d2ba58 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -55,8 +55,6 @@
 
 #define MAX_SHORTCUT_LENGTH 32
 
-extern char *Locale;
-
 static WMenu *readMenuPipe(WScreen * scr, char **file_name);
 static WMenu *readMenuFile(WScreen * scr, char *file_name);
 static WMenu *readMenuDirectory(WScreen * scr, char *title, char **file_name, 
char *command);
diff --git a/src/screen.c b/src/screen.c
index 16e600e..7a1f42b 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -68,9 +68,6 @@
     |SubstructureRedirectMask|ButtonPressMask|ButtonReleaseMask\
     |KeyPressMask|KeyReleaseMask)
 
-/**** Global variables ****/
-extern int wScreenCount;
-
 /**** Local ****/
 #define STIPPLE_WIDTH 2
 #define STIPPLE_HEIGHT 2
diff --git a/src/shutdown.c b/src/shutdown.c
index ab937ba..165d125 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -37,8 +37,6 @@
 #include "wmspec.h"
 #include "main.h"
 
-extern int wScreenCount;
-
 static void wipeDesktop(WScreen * scr);
 
 /*
@@ -54,9 +52,6 @@ static void wipeDesktop(WScreen * scr);
 void Shutdown(WShutdownMode mode)
 {
        int i;
-#ifdef HAVE_INOTIFY
-       extern int inotifyFD;
-#endif
 
        switch (mode) {
        case WSLogoutMode:
diff --git a/src/startup.c b/src/startup.c
index 032ab53..e7bda9b 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -84,7 +84,6 @@
 
 /****** Global Variables ******/
 extern WShortKey wKeyBindings[WKBD_LAST];
-extern int wScreenCount;
 
 #ifndef HAVE_INOTIFY
 /* special flags */
-- 
1.7.2.3

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/


--
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to