From 1a750c272683fab37cc7cd4327ccefdfa39faf85 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Mon, 26 Jan 2009 17:53:41 -0200 Subject: Correct make distcheck and most sparse warnings. Only remaining sparse warning is about no previous definition for the function vectors declared in Xtrans/Xtranssock.c. Also, use only one .gitignore file, instead of one per directory. --- .gitignore | 10 ++++++++++ Makefile.am | 2 +- cgi-bin/.gitignore | 2 -- configure.ac | 6 ++++++ helper/.gitignore | 8 -------- helper/GetUrl.c | 2 ++ helper/helper.c | 33 +++++++++++++-------------------- htdocs/.gitignore | 2 -- libxplugin/.gitignore | 2 -- plugin/.gitignore | 7 ------- plugin/Main.c | 7 ++++--- plugin/PProcess.c | 4 +++- plugin/common/.gitignore | 2 -- plugin/common/npunix.c | 22 +++++++++++----------- plugin/include/.gitignore | 2 -- plugin/include/jri_md.h | 4 ++-- plugin/include/npupp.h | 1 + rx/.gitignore | 2 -- rx/PParse.c | 2 +- rx/PRead.c | 4 ++-- rx/XAuth.c | 3 ++- rx/XDpyName.c | 28 +++++++++++----------------- testplugin/.gitignore | 2 -- xnest-plugin/.gitignore | 6 ------ xnest-plugin/RxPlugin.h | 4 ++-- xnest-plugin/XnestDis.c | 4 ++-- 26 files changed, 73 insertions(+), 98 deletions(-) delete mode 100644 cgi-bin/.gitignore delete mode 100644 helper/.gitignore delete mode 100644 htdocs/.gitignore delete mode 100644 libxplugin/.gitignore delete mode 100644 plugin/.gitignore delete mode 100644 plugin/common/.gitignore delete mode 100644 plugin/include/.gitignore delete mode 100644 rx/.gitignore delete mode 100644 testplugin/.gitignore delete mode 100644 xnest-plugin/.gitignore diff --git a/.gitignore b/.gitignore index 3254032..5ceca38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +*.lo +*.la +.libs .deps Makefile Makefile.in @@ -17,4 +20,11 @@ libtool ltmain.sh missing stamp-h1 +xrx +xrx.1 +libxrx.1 *~ +*.o +xrx-*.tar.* +ChangeLog +tags diff --git a/Makefile.am b/Makefile.am index 0ebd405..9ce6f25 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,6 +27,6 @@ MAINTAINERCLEANFILES = ChangeLog .PHONY: ChangeLog ChangeLog: - (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + $(CHANGELOG_CMD) dist-hook: ChangeLog diff --git a/cgi-bin/.gitignore b/cgi-bin/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/cgi-bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/configure.ac b/configure.ac index 9961977..9b5bdfc 100644 --- a/configure.ac +++ b/configure.ac @@ -26,11 +26,15 @@ AC_INIT(xrx,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],x AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE +# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.2) AM_CONFIG_HEADER(config.h) AC_PROG_CC AC_PROG_INSTALL AM_PROG_LIBTOOL +XORG_CWARNFLAGS dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro dnl was not expanded, since libX11 with no transport types is rather useless. @@ -46,6 +50,7 @@ XTRANS_CONNECTION_FLAGS # Checks for pkg-config packages PKG_CHECK_MODULES(XRX, x11 xt xext xtrans xproxymngproto xau) +XRX_CFLAGS="$CWARNFLAGS $XRX_CFLAGS" AC_SUBST(XRX_CFLAGS) AC_SUBST(XRX_LIBS) @@ -72,6 +77,7 @@ AC_SUBST(XRX_PLUGIN_LIBS) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([ Makefile diff --git a/helper/.gitignore b/helper/.gitignore deleted file mode 100644 index 29c15a6..0000000 --- a/helper/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.la -*.lo -xrx -xrx.1 diff --git a/helper/GetUrl.c b/helper/GetUrl.c index 9b8913f..defe792 100644 --- a/helper/GetUrl.c +++ b/helper/GetUrl.c @@ -37,6 +37,8 @@ The Open Group. * directly. */ +#include "GetUrl.h" + #define Free(b) if (b) free(b) #ifdef XUSE_WWW diff --git a/helper/helper.c b/helper/helper.c index 034019d..12c7836 100644 --- a/helper/helper.c +++ b/helper/helper.c @@ -55,10 +55,10 @@ The Open Group. #define NO_TIMEOUT 0 /* a few global */ -Display *pdpy; -int security_event_type_base; -XSecurityAuthorization ui_auth_id; -XSecurityAuthorization print_auth_id; +static Display *pdpy; +static int security_event_type_base; +static XSecurityAuthorization ui_auth_id; +static XSecurityAuthorization print_auth_id; #define RevokedEventType \ (security_event_type_base + XSecurityAuthorizationRevoked) @@ -72,14 +72,14 @@ ReadFile(char *filename) char *stream; if ((fd = open(filename, O_RDONLY)) < 0) - return(0); + return(NULL); fstat(fd, &st); stream = (char *)malloc(st.st_size+1); - if (stream == 0) - return(0); + if (stream == NULL) + return(NULL); if ((st.st_size = read(fd, stream, st.st_size)) < 0) { free(stream); - return(0); + return(NULL); } close(fd); stream[st.st_size] = '\0'; @@ -108,13 +108,6 @@ OpenXPrintDisplay(Display *dpy, char **printer_return) return pdpy; } -static void -CloseXPrintDisplay(Display *dpy, Display *pdpy) -{ - if (pdpy != NULL && pdpy != dpy) - XCloseDisplay(pdpy); -} - /* process the given RxParams and make the RxReturnParams */ static int ProcessUIParams(Display *dpy, @@ -340,7 +333,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 +396,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 */ @@ -439,20 +432,20 @@ main(int argc, char *argv[]) rx_argc = 0; - toplevel = XtAppInitialize(&app_context, "Xrx", 0, 0, + toplevel = XtAppInitialize(&app_context, "Xrx", NULL, 0, #if XtSpecificationRelease > 4 &argc, #else (Cardinal *)&argc, #endif - argv, 0, 0, 0); + argv, NULL, NULL, 0); if (argc < 2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } - if ((stream = ReadFile(argv[1])) == 0) { + if ((stream = ReadFile(argv[1])) == NULL) { fprintf(stderr, "%s: cannot open file %s\n", argv[0], argv[1]); exit(1); } diff --git a/htdocs/.gitignore b/htdocs/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/htdocs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/libxplugin/.gitignore b/libxplugin/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/libxplugin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/plugin/.gitignore b/plugin/.gitignore deleted file mode 100644 index 2059c63..0000000 --- a/plugin/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.la -*.lo -libxrx.1 diff --git a/plugin/Main.c b/plugin/Main.c index 1810b43..bd9255b 100644 --- a/plugin/Main.c +++ b/plugin/Main.c @@ -161,7 +161,7 @@ NPP_GetValue( } jref -NPP_GetJavaClass() +NPP_GetJavaClass(void) { return NULL; } @@ -289,6 +289,7 @@ NPP_NewStream(NPP instance, * still called but can safely be ignored using this strategy. */ +static int32 STREAMBUFSIZE = 0X0FFFFFFF; /* If we are reading from a file in NPAsFile * mode so we can take any size stream in our * write call (since we ignore it) */ @@ -368,7 +369,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 @@ -384,7 +385,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 fb9b532..642e94f 100644 --- a/plugin/PProcess.c +++ b/plugin/PProcess.c @@ -83,6 +83,8 @@ GetWindowGeometry( *border_width = wattr.border_width; *cmap = wattr.colormap; } + else + *cmap = NotUseful; if (sizehints) { XGetWMNormalHints (dpy, win, sizehints, &mask); @@ -337,7 +339,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/.gitignore b/plugin/common/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/plugin/common/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in 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/.gitignore b/plugin/include/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/plugin/include/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/plugin/include/jri_md.h b/plugin/include/jri_md.h index e708b6d..4e682e0 100644 --- a/plugin/include/jri_md.h +++ b/plugin/include/jri_md.h @@ -69,11 +69,11 @@ extern "C" { #elif defined(macintosh) || defined(Macintosh) || defined(THINK_C) # if defined(__MWERKS__) /* Metrowerks */ # if !__option(enumsalwaysint) -# error You need to define 'Enums Always Int' for your project. +# error You need to define "Enums Always Int" for your project. # endif # if defined(GENERATING68K) && !GENERATINGCFM # if !__option(fourbyteints) -# error You need to define 'Struct Alignment: 68k' for your project. +# error You need to define "Struct Alignment: 68k" for your project. # endif # endif /* !GENERATINGCFM */ # elif defined(__SC__) /* Symantec */ diff --git a/plugin/include/npupp.h b/plugin/include/npupp.h index dfd4974..f183840 100644 --- a/plugin/include/npupp.h +++ b/plugin/include/npupp.h @@ -984,6 +984,7 @@ extern "C" { /* plugin meta member functions */ char* NP_GetMIMEDescription(void); +NPError NP_GetValue(void *future, NPPVariable variable, void *value); NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); NPError NP_Shutdown(void); diff --git a/rx/.gitignore b/rx/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/rx/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in 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/PRead.c b/rx/PRead.c index ce09217..2f84641 100644 --- a/rx/PRead.c +++ b/rx/PRead.c @@ -136,7 +136,7 @@ NextParam(char *stream, NString *param) &word); else { /* no more elements stop here */ - param->ptr = 0; + param->ptr = NULL; param->length = 0; return stream; @@ -163,7 +163,7 @@ GetLiteralValue(NString *literal) value = vptr = (char *)Malloc(literal->length + 1); if (!value) - return 0; + return NULL; ptr = literal->ptr; limit = ptr + literal->length; diff --git a/rx/XAuth.c b/rx/XAuth.c index 89e904b..bf10915 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) @@ -136,7 +137,7 @@ SECURITY extension not supported\n"); } auth_return = XSecurityGenerateAuthorization(dpy, auth_in, xsamask, &xsa, auth_id_ret); - if (auth_return == 0) { + if (auth_return == NULL) { fprintf(stderr, "Error: Failed to setup authorization, cannot create key\n"); goto error; diff --git a/rx/XDpyName.c b/rx/XDpyName.c index 93f717d..6e03f4f 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,10 @@ 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 +188,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 +299,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/testplugin/.gitignore b/testplugin/.gitignore deleted file mode 100644 index 282522d..0000000 --- a/testplugin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/xnest-plugin/.gitignore b/xnest-plugin/.gitignore deleted file mode 100644 index 9730646..0000000 --- a/xnest-plugin/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.la -*.lo 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 0b868db..d02d5aa 100644 --- a/xnest-plugin/XnestDis.c +++ b/xnest-plugin/XnestDis.c @@ -47,7 +47,7 @@ The Open Group. static char xnest_display_numbers[MAX_PLUGINS]; void -RxpInitXnestDisplayNumbers() +RxpInitXnestDisplayNumbers(void) { memset(xnest_display_numbers, 0, sizeof(char) * MAX_PLUGINS); } @@ -81,7 +81,7 @@ Bool IsDisplayNumFree(int id) /* function returning first display number available */ int -RxpXnestDisplayNumber() +RxpXnestDisplayNumber(void) { int i; for (i = 0; i < MAX_PLUGINS; i++) -- cgit v1.2.3