From: Christophe CURIS <[email protected]>

- remove extern declaration in source file, use header instead

- add inclusion of header defining the functions of the file to
get the compiler to cross-check them

- marked static the functions that should not be visible ouside
their file
---
 src/actions.c      |    1 -
 src/colormap.c     |    5 ++++-
 src/event.c        |    1 -
 src/funcs.h        |    1 +
 src/geomview.c     |    3 +++
 src/main.c         |    1 +
 src/monitor.c      |    2 +-
 src/moveres.c      |    1 +
 src/osdep_bsd.c    |    1 +
 src/osdep_darwin.c |    1 +
 src/osdep_linux.c  |    2 ++
 src/osdep_stub.c   |    1 +
 src/placement.c    |    5 +----
 src/placement.h    |    2 ++
 src/properties.c   |    1 +
 src/rootmenu.c     |    1 +
 src/workspace.c    |    1 -
 17 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/actions.c b/src/actions.c
index 3fb3fe6..17046cf 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -56,7 +56,6 @@ extern Time LastTimestamp;
 extern Time LastFocusChange;
 extern WPreferences wPreferences;
 extern Atom _XA_WM_TAKE_FOCUS;
-extern void ProcessPendingEvents();
 
 static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, 
int *new_y,
                                  unsigned int *new_width, unsigned int 
*new_height);
diff --git a/src/colormap.c b/src/colormap.c
index 3a8906a..121d33b 100644
--- a/src/colormap.c
+++ b/src/colormap.c
@@ -27,9 +27,12 @@
 
 #include "WindowMaker.h"
 #include <X11/Xatom.h>
-#include "window.h"
 
+#include "window.h"
 #include "framewin.h"
+#include "colormap.h"
+
+
 void wColormapInstallForWindow(WScreen * scr, WWindow * wwin)
 {
        int i;
diff --git a/src/event.c b/src/event.c
index a05d648..692fd8a 100644
--- a/src/event.c
+++ b/src/event.c
@@ -327,7 +327,6 @@ void DispatchEvent(XEvent * event)
 #define BUFF_SIZE ((sizeof(struct inotify_event) + 64)*5)
 static void handle_inotify_events(int fd, int wd)
 {
-       extern void wDefaultsCheckDomains(void *);
        ssize_t eventQLength, i = 0;
        char buff[BUFF_SIZE] = { 0 };
        /* Check config only once per read of the event queue */
diff --git a/src/funcs.h b/src/funcs.h
index 848fc40..b996856 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -41,6 +41,7 @@ void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool 
next, Bool class_only)
 
 void EventLoop(void);
 void DispatchEvent(XEvent *event);
+void ProcessPendingEvents(void);
 WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
 Bool IsDoubleClick(WScreen *scr, XEvent *event);
 
diff --git a/src/geomview.c b/src/geomview.c
index f067ce4..859cb4c 100644
--- a/src/geomview.c
+++ b/src/geomview.c
@@ -1,6 +1,9 @@
 
 #include <WINGs/WINGsP.h>
 
+#include "geomview.h"
+
+
 typedef struct W_GeometryView {
        W_Class widgetClass;
        WMView *view;
diff --git a/src/main.c b/src/main.c
index f1a63b3..b1958e8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,6 +52,7 @@
 #include "session.h"
 #include "shutdown.h"
 #include "dialog.h"
+#include "main.h"
 
 #include <WINGs/WUtil.h>
 
diff --git a/src/monitor.c b/src/monitor.c
index 9267709..22eaaa9 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -43,7 +43,7 @@
 /****** Global Variables ******/
 extern WPreferences wPreferences;
 
-int showCrashDialog(int sig)
+static int showCrashDialog(int sig)
 {
        int crashAction;
 
diff --git a/src/moveres.c b/src/moveres.c
index 2d3574e..23045eb 100644
--- a/src/moveres.c
+++ b/src/moveres.c
@@ -37,6 +37,7 @@
 #include "funcs.h"
 #include "actions.h"
 #include "workspace.h"
+#include "placement.h"
 
 #include "geomview.h"
 #include "screen.h"
diff --git a/src/osdep_bsd.c b/src/osdep_bsd.c
index dbcdf9e..e92a7c8 100644
--- a/src/osdep_bsd.c
+++ b/src/osdep_bsd.c
@@ -32,6 +32,7 @@
 #include <WINGs/WUtil.h>
 
 #include "wconfig.h"
+#include "funcs.h"
 
 /*
  * copy argc and argv for an existing process identified by `pid'
diff --git a/src/osdep_darwin.c b/src/osdep_darwin.c
index ca38df2..04ece9f 100644
--- a/src/osdep_darwin.c
+++ b/src/osdep_darwin.c
@@ -9,6 +9,7 @@
 #include <WINGs/WUtil.h>
 
 #include "wconfig.h"
+#include "funcs.h"
 
 /*
  * copy argc and argv for an existing process identified by `pid'
diff --git a/src/osdep_linux.c b/src/osdep_linux.c
index fd97f59..1336d2f 100644
--- a/src/osdep_linux.c
+++ b/src/osdep_linux.c
@@ -12,6 +12,8 @@
 #include <WINGs/WUtil.h>
 
 #include "wconfig.h"
+#include "funcs.h"
+
 
 #define        RETRY( x )      do {                            \
                                x;                      \
diff --git a/src/osdep_stub.c b/src/osdep_stub.c
index 79fe9c1..d0349cd 100644
--- a/src/osdep_stub.c
+++ b/src/osdep_stub.c
@@ -4,6 +4,7 @@
 #include <WINGs/WUtil.h>
 
 #include "wconfig.h"
+#include "funcs.h"
 
 Bool GetCommandForPid(int pid, char ***argv, int *argc)
 {
diff --git a/src/placement.c b/src/placement.c
index 5e4a8e7..1e70709 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -38,6 +38,7 @@
 #include "application.h"
 #include "dock.h"
 #include "xinerama.h"
+#include "placement.h"
 
 extern WPreferences wPreferences;
 
@@ -47,10 +48,6 @@ extern WPreferences wPreferences;
 #define Y_ORIGIN WMAX(usableArea.y1,\
     wPreferences.window_place_origin.y)
 
-/* interactive window placement is in moveres.c */
-extern void InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
-                                  unsigned width, unsigned height);
-
 /* Returns True if it is an icon and is in this workspace */
 static Bool
 iconPosition(WCoreWindow *wcore, int sx1, int sy1, int sx2, int sy2,
diff --git a/src/placement.h b/src/placement.h
index e9bfed8..d3455ee 100644
--- a/src/placement.h
+++ b/src/placement.h
@@ -33,6 +33,8 @@ int calcIntersectionArea(int x1, int y1, int w1, int h1, int 
x2, int y2, int w2,
 
 void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, unsigned width, 
unsigned height);
 
+void InteractivePlaceWindow(WWindow * wwin, int *x_ret, int *y_ret, unsigned 
width, unsigned height);
+
 /* Set the points x and y inside the screen */
 void get_right_position_on_screen(WScreen *scr, int *x, int *y, int size_x, 
int size_y);
 
diff --git a/src/properties.c b/src/properties.c
index 0442077..5bde912 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -29,6 +29,7 @@
 #include "WindowMaker.h"
 #include "window.h"
 #include "GNUstep.h"
+#include "properties.h"
 
 /* atoms */
 extern Atom _XA_WM_STATE;
diff --git a/src/rootmenu.c b/src/rootmenu.c
index 28bed80..f93e5bf 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -52,6 +52,7 @@
 #include "session.h"
 #include "shutdown.h"
 #include "xmodifier.h"
+#include "rootmenu.h"
 
 #include <WINGs/WUtil.h>
 
diff --git a/src/workspace.c b/src/workspace.c
index b4cccd0..ab79e68 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -61,7 +61,6 @@
 extern int ignore_wks_change;
 extern WPreferences wPreferences;
 extern XContext wVEdgeContext;
-extern void ProcessPendingEvents();
 extern WShortKey wKeyBindings[WKBD_LAST];
 
 static WMPropList *dWorkspaces = NULL;
-- 
1.7.10.4


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

Reply via email to