>From c86b5e99c8ae1e7db74b7c722d5e236d05d38b4d Mon Sep 17 00:00:00 2001
From: Rodolfo García Peñas (kix) <[email protected]>
Date: Wed, 25 Jan 2012 08:02:25 +0100
Subject: [PATCH 22/24] WindowMaker: Multiple externs removed.

Multiple externs has been removed from the files, creating new files monitor.h, 
startup.h and dockedapp.h to put the shared definitions inside.
---
 src/Makefile.am |    3 +++
 src/dock.c      |    7 +------
 src/dockedapp.c |    1 +
 src/dockedapp.h |    3 +++
 src/event.c     |    3 ---
 src/event.h     |    2 ++
 src/main.c      |    5 +----
 src/monitor.c   |    1 +
 src/monitor.h   |    1 +
 src/startup.c   |    4 ++--
 src/startup.h   |    1 +
 11 files changed, 16 insertions(+), 15 deletions(-)
 create mode 100644 src/dockedapp.h
 create mode 100644 src/monitor.h
 create mode 100644 src/startup.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 818987b..14c1eb9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,6 +30,7 @@ wmaker_SOURCES =      \
        dialog.h \
        dock.c \
        dockedapp.c \
+       dockedapp.h \
        dock.h \
        event.c \
        event.h \
@@ -49,6 +50,7 @@ wmaker_SOURCES =      \
        misc.c \
        osdep_@[email protected] \
        monitor.c \
+       monitor.h \
        motif.c \
        motif.h \
        moveres.c \
@@ -71,6 +73,7 @@ wmaker_SOURCES =      \
        stacking.c \
        stacking.h \
        startup.c \
+       startup.h \
        superfluous.c \
        superfluous.h \
        switchmenu.c \
diff --git a/src/dock.c b/src/dock.c
index df2892b..85bdf47 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -53,6 +53,7 @@
 #include "framewin.h"
 #include "superfluous.h"
 #include "xinerama.h"
+#include "dockedapp.h"
 
 /**** Local variables ****/
 #define CLIP_REWIND       1
@@ -60,12 +61,6 @@
 #define CLIP_FORWARD      2
 
 /**** Global variables ****/
-
-/* in dockedapp.c */
-extern void DestroyDockAppSettingsPanel();
-extern void ShowDockAppSettingsPanel(WAppIcon * aicon);
-extern void appIconMouseDown(WObjDescriptor *desc, XEvent *event);
-
 #define MOD_MASK wPreferences.modifier_mask
 #define ICON_SIZE wPreferences.icon_size
 
diff --git a/src/dockedapp.c b/src/dockedapp.c
index d0693f2..132f14b 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -36,6 +36,7 @@
 #include "defaults.h"
 #include "framewin.h"
 #include "xinerama.h"
+#include "dockedapp.h"
 
 typedef struct _AppSettingsPanel {
        WMWindow *win;
diff --git a/src/dockedapp.h b/src/dockedapp.h
new file mode 100644
index 0000000..4c461fb
--- /dev/null
+++ b/src/dockedapp.h
@@ -0,0 +1,3 @@
+void DestroyDockAppSettingsPanel();
+void ShowDockAppSettingsPanel(WAppIcon * aicon);
+void appIconMouseDown(WObjDescriptor *desc, XEvent *event);
diff --git a/src/event.c b/src/event.c
index 639167f..f996300 100644
--- a/src/event.c
+++ b/src/event.c
@@ -99,9 +99,6 @@ static void handleShapeNotify(XEvent *event);
 static void handleXkbIndicatorStateNotify(XEvent *event);
 #endif
 
-/* called from the signal handler */
-void NotifyDeadProcess(pid_t pid, unsigned char status);
-
 /* real dead process handler */
 static void handleDeadProcess(void *foo);
 
diff --git a/src/event.h b/src/event.h
index 8b82223..e910245 100644
--- a/src/event.h
+++ b/src/event.h
@@ -1 +1,3 @@
 void ProcessPendingEvents(void);
+void EventLoop(void);
+void NotifyDeadProcess(pid_t pid, unsigned char status);
diff --git a/src/main.c b/src/main.c
index d0d662a..77887cc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,6 +52,7 @@
 #include "xmodifier.h"
 #include "session.h"
 #include "dialog.h"
+#include "startup.h"
 
 #include <WINGs/WUtil.h>
 
@@ -72,10 +73,6 @@ static char **Arguments;
 
 static int ArgCount;
 
-extern void EventLoop(void);
-extern void StartUp(Bool defaultScreenOnly);
-extern int MonitorLoop(int argc, char **argv);
-
 static Bool multiHead = True;
 
 static int *wVisualID = NULL;
diff --git a/src/monitor.c b/src/monitor.c
index d6c9505..7c8348d 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -38,6 +38,7 @@
 #include "window.h"
 #include "dialog.h"
 #include "funcs.h"
+#include "monitor.h"
 
 int showCrashDialog(int sig)
 {
diff --git a/src/monitor.h b/src/monitor.h
new file mode 100644
index 0000000..766121b
--- /dev/null
+++ b/src/monitor.h
@@ -0,0 +1 @@
+int MonitorLoop(int argc, char **argv);
diff --git a/src/startup.c b/src/startup.c
index 0727b8e..83ba9a5 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -71,6 +71,8 @@
 
 #include "xutil.h"
 #include "main.h"
+#include "monitor.h"
+#include "event.h"
 
 /* for SunOS */
 #ifndef SA_RESTART
@@ -87,8 +89,6 @@
 extern char WDelayedActionSet;
 #endif
 
-extern void NotifyDeadProcess(pid_t pid, unsigned char status);
-
 /***** Local *****/
 static WScreen **wScreen = NULL;
 static unsigned int _NumLockMask = 0;
diff --git a/src/startup.h b/src/startup.h
new file mode 100644
index 0000000..3b67d0e
--- /dev/null
+++ b/src/startup.h
@@ -0,0 +1 @@
+void StartUp(Bool defaultScreenOnly);
-- 
1.7.2.3

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From c86b5e99c8ae1e7db74b7c722d5e236d05d38b4d Mon Sep 17 00:00:00 2001
From: Rodolfo García Peñas (kix) <[email protected]>
Date: Wed, 25 Jan 2012 08:02:25 +0100
Subject: [PATCH 22/24] WindowMaker: Multiple externs removed.

Multiple externs has been removed from the files, creating new files monitor.h, startup.h and dockedapp.h to put the shared definitions inside.
---
 src/Makefile.am |    3 +++
 src/dock.c      |    7 +------
 src/dockedapp.c |    1 +
 src/dockedapp.h |    3 +++
 src/event.c     |    3 ---
 src/event.h     |    2 ++
 src/main.c      |    5 +----
 src/monitor.c   |    1 +
 src/monitor.h   |    1 +
 src/startup.c   |    4 ++--
 src/startup.h   |    1 +
 11 files changed, 16 insertions(+), 15 deletions(-)
 create mode 100644 src/dockedapp.h
 create mode 100644 src/monitor.h
 create mode 100644 src/startup.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 818987b..14c1eb9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,6 +30,7 @@ wmaker_SOURCES = 	\
 	dialog.h \
 	dock.c \
 	dockedapp.c \
+	dockedapp.h \
 	dock.h \
 	event.c \
 	event.h \
@@ -49,6 +50,7 @@ wmaker_SOURCES = 	\
 	misc.c \
 	osdep_@[email protected] \
 	monitor.c \
+	monitor.h \
 	motif.c \
 	motif.h \
 	moveres.c \
@@ -71,6 +73,7 @@ wmaker_SOURCES = 	\
 	stacking.c \
 	stacking.h \
 	startup.c \
+	startup.h \
 	superfluous.c \
 	superfluous.h \
 	switchmenu.c \
diff --git a/src/dock.c b/src/dock.c
index df2892b..85bdf47 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -53,6 +53,7 @@
 #include "framewin.h"
 #include "superfluous.h"
 #include "xinerama.h"
+#include "dockedapp.h"
 
 /**** Local variables ****/
 #define CLIP_REWIND       1
@@ -60,12 +61,6 @@
 #define CLIP_FORWARD      2
 
 /**** Global variables ****/
-
-/* in dockedapp.c */
-extern void DestroyDockAppSettingsPanel();
-extern void ShowDockAppSettingsPanel(WAppIcon * aicon);
-extern void appIconMouseDown(WObjDescriptor *desc, XEvent *event);
-
 #define MOD_MASK wPreferences.modifier_mask
 #define ICON_SIZE wPreferences.icon_size
 
diff --git a/src/dockedapp.c b/src/dockedapp.c
index d0693f2..132f14b 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -36,6 +36,7 @@
 #include "defaults.h"
 #include "framewin.h"
 #include "xinerama.h"
+#include "dockedapp.h"
 
 typedef struct _AppSettingsPanel {
 	WMWindow *win;
diff --git a/src/dockedapp.h b/src/dockedapp.h
new file mode 100644
index 0000000..4c461fb
--- /dev/null
+++ b/src/dockedapp.h
@@ -0,0 +1,3 @@
+void DestroyDockAppSettingsPanel();
+void ShowDockAppSettingsPanel(WAppIcon * aicon);
+void appIconMouseDown(WObjDescriptor *desc, XEvent *event);
diff --git a/src/event.c b/src/event.c
index 639167f..f996300 100644
--- a/src/event.c
+++ b/src/event.c
@@ -99,9 +99,6 @@ static void handleShapeNotify(XEvent *event);
 static void handleXkbIndicatorStateNotify(XEvent *event);
 #endif
 
-/* called from the signal handler */
-void NotifyDeadProcess(pid_t pid, unsigned char status);
-
 /* real dead process handler */
 static void handleDeadProcess(void *foo);
 
diff --git a/src/event.h b/src/event.h
index 8b82223..e910245 100644
--- a/src/event.h
+++ b/src/event.h
@@ -1 +1,3 @@
 void ProcessPendingEvents(void);
+void EventLoop(void);
+void NotifyDeadProcess(pid_t pid, unsigned char status);
diff --git a/src/main.c b/src/main.c
index d0d662a..77887cc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,6 +52,7 @@
 #include "xmodifier.h"
 #include "session.h"
 #include "dialog.h"
+#include "startup.h"
 
 #include <WINGs/WUtil.h>
 
@@ -72,10 +73,6 @@ static char **Arguments;
 
 static int ArgCount;
 
-extern void EventLoop(void);
-extern void StartUp(Bool defaultScreenOnly);
-extern int MonitorLoop(int argc, char **argv);
-
 static Bool multiHead = True;
 
 static int *wVisualID = NULL;
diff --git a/src/monitor.c b/src/monitor.c
index d6c9505..7c8348d 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -38,6 +38,7 @@
 #include "window.h"
 #include "dialog.h"
 #include "funcs.h"
+#include "monitor.h"
 
 int showCrashDialog(int sig)
 {
diff --git a/src/monitor.h b/src/monitor.h
new file mode 100644
index 0000000..766121b
--- /dev/null
+++ b/src/monitor.h
@@ -0,0 +1 @@
+int MonitorLoop(int argc, char **argv);
diff --git a/src/startup.c b/src/startup.c
index 0727b8e..83ba9a5 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -71,6 +71,8 @@
 
 #include "xutil.h"
 #include "main.h"
+#include "monitor.h"
+#include "event.h"
 
 /* for SunOS */
 #ifndef SA_RESTART
@@ -87,8 +89,6 @@
 extern char WDelayedActionSet;
 #endif
 
-extern void NotifyDeadProcess(pid_t pid, unsigned char status);
-
 /***** Local *****/
 static WScreen **wScreen = NULL;
 static unsigned int _NumLockMask = 0;
diff --git a/src/startup.h b/src/startup.h
new file mode 100644
index 0000000..3b67d0e
--- /dev/null
+++ b/src/startup.h
@@ -0,0 +1 @@
+void StartUp(Bool defaultScreenOnly);
-- 
1.7.2.3

Reply via email to