From 06b5a50aad20aa87c684df59405889dd845d6c31 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 1 May 2011 20:33:50 +0200 Subject: [PATCH] Fix warnings XBoard file browser All the prototypes have been moved to selfile.h, to force uniformity. The order of the #include files xstat.h and selfile.h had to be swapped, to make sure 'struct stat' is a nown type atthe time of prototype declaration. The event handler SFmotionList is considered wrong type because of its third argument (XMotionEvent in stead of XEvent), and had to be casted to (XtEventHandler) when passed to XtAddEventHandler. --- filebrowser/dir.c | 4 ++-- filebrowser/draw.c | 7 +------ filebrowser/path.c | 10 +--------- filebrowser/selfile.c | 13 ++----------- filebrowser/selfile.h | 17 +++++++++++++++++ 5 files changed, 23 insertions(+), 28 deletions(-) diff --git a/filebrowser/dir.c b/filebrowser/dir.c index 820422e..918d555 100644 --- a/filebrowser/dir.c +++ b/filebrowser/dir.c @@ -32,8 +32,6 @@ #include #endif /* def SEL_FILE_IGNORE_CASE */ -#include "selfile.h" - #ifdef HAVE_DIRENT_H #include #else @@ -43,6 +41,8 @@ #include +#include "selfile.h" + #ifdef SEL_FILE_IGNORE_CASE int SFcompareEntries(p, q) diff --git a/filebrowser/draw.c b/filebrowser/draw.c index abab957..048fa85 100644 --- a/filebrowser/draw.c +++ b/filebrowser/draw.c @@ -25,8 +25,8 @@ */ #include -#include "selfile.h" #include "xstat.h" +#include "selfile.h" #include #include #include @@ -38,11 +38,6 @@ #endif #define ABS(x) (((x) < 0) ? (-(x)) : (x)) -/* added missing prototypes */ -extern char SFstatChar(struct stat*); -extern int SFchdir(char *); -void SFvSliderMovedCallback(Widget, int, int); - typedef struct { char *fontname; } TextData, *textPtr; diff --git a/filebrowser/path.c b/filebrowser/path.c index a44a166..a68b7c1 100644 --- a/filebrowser/path.c +++ b/filebrowser/path.c @@ -34,8 +34,8 @@ #include #include -#include "selfile.h" #include "xstat.h" +#include "selfile.h" #include #ifndef MAXPATHLEN @@ -46,14 +46,6 @@ extern uid_t getuid(); #endif /* def HAS_DIRENT_H */ -/* added missing prototypes */ -extern void SFtextChanged(); -extern int SFgetDir(SFDir *); -extern void SFdrawLists(int); -extern void SFdrawList(int, int); -extern void SFclearList(int, int); -extern void SFmotionList(Widget, int, XMotionEvent*); - typedef struct { char *name; char *dir; diff --git a/filebrowser/selfile.c b/filebrowser/selfile.c index f59e159..5a4ceb4 100644 --- a/filebrowser/selfile.c +++ b/filebrowser/selfile.c @@ -60,17 +60,8 @@ extern int errno; #include #include -#include "selfile.h" #include "xstat.h" - -/* added missing prototypes */ -extern void SFdrawList(int,int); -extern void SFinitFont(); -extern void SFcreateGC(); -extern int SFchdir(char *); -extern void SFupdatePath(); -extern void SFsetText(char *); -extern char SFstatChar(struct stat*); +#include "selfile.h" #ifndef MAXPATHLEN #define MAXPATHLEN 1024 @@ -598,7 +589,7 @@ SFcreateWidgets(toplevel, prompt, ok, cancel) XtAddEventHandler(selFileLists[n], LeaveWindowMask, False, SFleaveList, (XtPointer)(intptr_t) n); XtAddEventHandler(selFileLists[n], PointerMotionMask, False, - SFmotionList, (XtPointer)(intptr_t) n); + (XtEventHandler) SFmotionList, (XtPointer)(intptr_t) n); XtAddEventHandler(selFileLists[n], ButtonPressMask, False, SFbuttonPressList, (XtPointer)(intptr_t) n); XtAddEventHandler(selFileLists[n], ButtonReleaseMask, False, diff --git a/filebrowser/selfile.h b/filebrowser/selfile.h index a9a3af4..525b1c2 100644 --- a/filebrowser/selfile.h +++ b/filebrowser/selfile.h @@ -153,3 +153,20 @@ extern int (*SFfunc)(); extern Boolean SFpathFlag; // [HGM] +/* added missing prototypes */ +char SFstatChar(struct stat *); +int SFchdir(char *); +void SFvSliderMovedCallback(Widget, int, int); +void SFdrawList(int,int); +void SFdrawLists(int); +void SFinitFont(); +void SFcreateGC(); +void SFupdatePath(); +void SFsetText(char *); +void SFtextChanged(); +int SFgetDir(SFDir *); +void SFclearList(int, int); +void SFmotionList(Widget, int, XMotionEvent*); + + + -- 1.7.0.4