diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-26 17:53:41 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-26 17:53:41 -0200 |
commit | 1a750c272683fab37cc7cd4327ccefdfa39faf85 (patch) | |
tree | 23c973ca975ec853807032e3bb1eca58422f31ce /helper/helper.c | |
parent | 549335c473370f8a243be79387577306e525f144 (diff) |
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.
Diffstat (limited to 'helper/helper.c')
-rw-r--r-- | helper/helper.c | 33 |
1 files changed, 13 insertions, 20 deletions
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 <file>\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); } |