From 256f240254722bf9c44b0b84c9255494dfaab342 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sun, 16 Mar 2008 17:08:49 -0300 Subject: [PATCH] Compile warning fixes. Ansification of some K&R definition functions. Include headers to ensure prototypes match definitions. Declare some functions, used only on the same file, or assigned as structure members as static. Only remaining warnings are: GetUrl.c:130: warning: implicit declaration of function '_HttpTransOpenCOTSClient' GetUrl.c:130: warning: nested extern declaration of '_HttpTransOpenCOTSClient' GetUrl.c:130: warning: assignment makes pointer from integer without a cast GetUrl.c:133: warning: implicit declaration of function '_HttpTransConnect' GetUrl.c:133: warning: nested extern declaration of '_HttpTransConnect' That should be browser functions. --- helper/GetUrl.c | 3 ++- helper/helper.c | 6 ++++-- plugin/Main.c | 6 +++--- plugin/PProcess.c | 2 +- plugin/common/npunix.c | 22 +++++++++++----------- plugin/include/npupp.h | 1 + rx/PParse.c | 2 +- rx/XAuth.c | 1 + rx/XDpyName.c | 33 ++++++++++++++++----------------- xnest-plugin/NewNDest.c | 1 + xnest-plugin/RxPlugin.h | 4 ++-- xnest-plugin/XnestDis.c | 4 ++-- 12 files changed, 45 insertions(+), 40 deletions(-) diff --git a/helper/GetUrl.c b/helper/GetUrl.c index 249b864..c381d63 100644 --- a/helper/GetUrl.c +++ b/helper/GetUrl.c @@ -38,6 +38,7 @@ The Open Group. */ #define Free(b) if (b) free(b) +#include "GetUrl.h" #ifdef XUSE_WWW @@ -115,7 +116,7 @@ OpenConnection(char *hostname, int port) /* make the address of the form: protocol/host:port */ sprintf(address,"%s/%s:%d", - protocol ? protocol : "", + protocol, hostname ? hostname : "", port); diff --git a/helper/helper.c b/helper/helper.c index 034019d..1f9124f 100644 --- a/helper/helper.c +++ b/helper/helper.c @@ -108,12 +108,14 @@ OpenXPrintDisplay(Display *dpy, char **printer_return) return pdpy; } +#if 0 static void CloseXPrintDisplay(Display *dpy, Display *pdpy) { if (pdpy != NULL && pdpy != dpy) XCloseDisplay(pdpy); } +#endif /* process the given RxParams and make the RxReturnParams */ static int @@ -340,7 +342,7 @@ ProcessParams(Display *dpy, Preferences *prefs, RxParams *in, /* parse CGI reply looking for error status line, * and return following message */ -int +static int ParseReply(char *reply, int reply_len, char **reply_ret, int *reply_len_ret) { char *ptr, *end; @@ -403,7 +405,7 @@ exit: * using it is gone). * We can then exit since we do not have anything else to do. */ -Boolean +static Boolean RevokeD(XEvent *xev) { if (xev->type == RevokedEventType) { /* should always be true */ diff --git a/plugin/Main.c b/plugin/Main.c index 834300e..efe8a05 100644 --- a/plugin/Main.c +++ b/plugin/Main.c @@ -155,7 +155,7 @@ NPP_GetValue(void *future, NPPVariable variable, void *value) } jref -NPP_GetJavaClass() +NPP_GetJavaClass(void) { return NULL; } @@ -362,7 +362,7 @@ NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buf) return len; /* The number of bytes accepted */ } -void +static void StartApplication(PluginInstance* This) { #ifndef NO_STARTING_STATE @@ -378,7 +378,7 @@ StartApplication(PluginInstance* This) This->parse_reply = 1; /* we want to print out the answer */ } -void +static void StartCB(Widget widget, XtPointer client_data, XtPointer call_data) { PluginInstance* This = (PluginInstance*) client_data; diff --git a/plugin/PProcess.c b/plugin/PProcess.c index 8d067a8..d87848b 100644 --- a/plugin/PProcess.c +++ b/plugin/PProcess.c @@ -336,7 +336,7 @@ ResetWMColormap(PluginInstance* This, Window win) /*********************************************************************** * Event Handler to reparent client window under plugin window ***********************************************************************/ -/* static */ void +static void SubstructureRedirectHandler ( Widget widget, XtPointer client_data, diff --git a/plugin/common/npunix.c b/plugin/common/npunix.c index bedd861..d2b5338 100644 --- a/plugin/common/npunix.c +++ b/plugin/common/npunix.c @@ -147,7 +147,7 @@ void NPN_ReloadPlugins(NPBool reloadPages) CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages); } -JRIEnv* NPN_GetJavaEnv() +JRIEnv* NPN_GetJavaEnv(void) { return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv); } @@ -170,7 +170,7 @@ jref NPN_GetJavaPeer(NPP instance) * ***********************************************************************/ -NPError +static NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved) { @@ -180,14 +180,14 @@ Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, return ret; } -NPError +static NPError Private_Destroy(NPP instance, NPSavedData** save) { PLUGINDEBUGSTR("Destroy"); return NPP_Destroy(instance, save); } -NPError +static NPError Private_SetWindow(NPP instance, NPWindow* window) { NPError err; @@ -196,7 +196,7 @@ Private_SetWindow(NPP instance, NPWindow* window) return err; } -NPError +static NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype) { @@ -206,7 +206,7 @@ Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, return err; } -int32 +static int32 Private_WriteReady(NPP instance, NPStream* stream) { unsigned int result; @@ -215,7 +215,7 @@ Private_WriteReady(NPP instance, NPStream* stream) return result; } -int32 +static int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer) { @@ -225,7 +225,7 @@ Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, return result; } -void +static void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname) { PLUGINDEBUGSTR("StreamAsFile"); @@ -233,7 +233,7 @@ Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname) } -NPError +static NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason) { NPError err; @@ -243,14 +243,14 @@ Private_DestroyStream(NPP instance, NPStream* stream, NPError reason) } -void +static void Private_Print(NPP instance, NPPrint* platformPrint) { PLUGINDEBUGSTR("Print"); NPP_Print(instance, platformPrint); } -JRIGlobalRef +static JRIGlobalRef Private_GetJavaClass(void) { jref clazz = NPP_GetJavaClass(); diff --git a/plugin/include/npupp.h b/plugin/include/npupp.h index dfd4974..32bcd37 100644 --- a/plugin/include/npupp.h +++ b/plugin/include/npupp.h @@ -983,6 +983,7 @@ extern "C" { /* plugin meta member functions */ +NPError NP_GetValue(void *future, NPPVariable variable, void *value); char* NP_GetMIMEDescription(void); NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); NPError NP_Shutdown(void); diff --git a/rx/PParse.c b/rx/PParse.c index 07e360b..a0020bf 100644 --- a/rx/PParse.c +++ b/rx/PParse.c @@ -422,7 +422,7 @@ RxInitializeParams(RxParams *params) params->x_print_lbx = RxUndef; } -void +static void FreeAuthListData(char **list) { while (*list != NULL) diff --git a/rx/XAuth.c b/rx/XAuth.c index 89e904b..daa07bb 100644 --- a/rx/XAuth.c +++ b/rx/XAuth.c @@ -36,6 +36,7 @@ The Open Group. #ifndef XFUNCPROTO_NOT_AVAILABLE #include #endif +#include "XAuth.h" static void printhexdigit(char *ptr, unsigned int d) diff --git a/rx/XDpyName.c b/rx/XDpyName.c index 93f717d..5ce9aeb 100644 --- a/rx/XDpyName.c +++ b/rx/XDpyName.c @@ -47,6 +47,8 @@ The Open Group. #include #include +#include "XDpyName.h" + #define DEFAULT_PROXY_MANAGER ":6500" /* @@ -160,7 +162,15 @@ The Open Group. return; \ } -static void PMprocessMessages (); +static void PMprocessMessages( + IceConn /* iceConn */, + IcePointer /* clientData */, + int /* opcode */, + unsigned long /* length */, + Bool /* swap */, + IceReplyWaitInfo * /* replyWait */, + Bool * /* replyReadyRet */ +); #ifdef XP_UNIX #define PMOPCODE RxGlobal.pm_opcode @@ -183,11 +193,8 @@ typedef struct { #if 0 #else -static int findproxy (proxyname, manager, server, name) - char* proxyname; - char* manager; - char* server; - char* name; +static int +findproxy(char *proxyname, char *manager, char *server, char *name) { #ifndef XP_UNIX IceConn ice_conn; @@ -297,17 +304,9 @@ static int findproxy (proxyname, manager, server, name) static void -PMprocessMessages (iceConn, clientData, opcode, - length, swap, replyWait, replyReadyRet) - -IceConn iceConn; -IcePointer clientData; -int opcode; -unsigned long length; -Bool swap; -IceReplyWaitInfo *replyWait; -Bool *replyReadyRet; - +PMprocessMessages(IceConn iceConn, IcePointer clientData, + int opcode, unsigned long length, Bool swap, + IceReplyWaitInfo *replyWait, Bool *replyReadyRet) { if (replyWait) *replyReadyRet = False; diff --git a/xnest-plugin/NewNDest.c b/xnest-plugin/NewNDest.c index 00c1b1c..1b5ec63 100644 --- a/xnest-plugin/NewNDest.c +++ b/xnest-plugin/NewNDest.c @@ -29,6 +29,7 @@ The Open Group. #include "RxPlugin.h" #include +#include #include diff --git a/xnest-plugin/RxPlugin.h b/xnest-plugin/RxPlugin.h index ce7c420..5e05e12 100644 --- a/xnest-plugin/RxPlugin.h +++ b/xnest-plugin/RxPlugin.h @@ -111,8 +111,8 @@ RxpProcessParams(PluginInstance* This, RxParams *in, RxReturnParams *out); extern void RxpSetStatusWidget(PluginInstance*, PluginState); -extern void RxpInitXnestDisplayNumbers(); -extern int RxpXnestDisplayNumber(); +extern void RxpInitXnestDisplayNumbers(void); +extern int RxpXnestDisplayNumber(void); extern void RxpFreeXnestDisplayNumber(int i); extern char * RxpXnestDisplay(int display_number); diff --git a/xnest-plugin/XnestDis.c b/xnest-plugin/XnestDis.c index a30c79e..c5d095e 100644 --- a/xnest-plugin/XnestDis.c +++ b/xnest-plugin/XnestDis.c @@ -46,7 +46,7 @@ The Open Group. static char xnest_display_numbers[MAX_PLUGINS]; void -RxpInitXnestDisplayNumbers() +RxpInitXnestDisplayNumbers(void) { memset(xnest_display_numbers, 0, sizeof(char) * MAX_PLUGINS); } @@ -80,7 +80,7 @@ Bool IsDisplayNumFree(int id) /* function returning first display number available */ int -RxpXnestDisplayNumber() +RxpXnestDisplayNumber(void) { int i; for (i = 0; i < MAX_PLUGINS; i++) -- 1.5.3.2