summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-28 22:26:50 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-28 22:26:50 +0000
commit8274b8e4b121c3dc3bfd5d0fa4f85bc23f5c09a0 (patch)
treecb61869ef8db7fba494853286faba6a7901198ac
parent7f6f90cfce51806340f25b80a87b147d8a743b27 (diff)
downloadxorg-lib-libXau-8274b8e4b121c3dc3bfd5d0fa4f85bc23f5c09a0.tar.gz
Remove prototype for XauGetAuthByName to clear lint warning: name declared
but never used or defined Fix sparse warnings: -warning: Using plain integer as NULL pointer -warning: non-ANSI definition of function
-rw-r--r--AuDispose.c3
-rw-r--r--AuFileName.c8
-rw-r--r--AuGetAddr.c6
-rw-r--r--AuGetBest.c8
-rw-r--r--AuRead.c17
-rw-r--r--AuWrite.c4
-rw-r--r--include/X11/Xauth.h4
7 files changed, 21 insertions, 29 deletions
diff --git a/AuDispose.c b/AuDispose.c
index 58ffd61..cb6f85c 100644
--- a/AuDispose.c
+++ b/AuDispose.c
@@ -34,8 +34,7 @@ in this Software without prior written authorization from The Open Group.
#include <stdlib.h>
void
-XauDisposeAuth (auth)
-Xauth *auth;
+XauDisposeAuth (Xauth *auth)
{
if (auth) {
if (auth->address) (void) free (auth->address);
diff --git a/AuFileName.c b/AuFileName.c
index a51fc3b..b21b048 100644
--- a/AuFileName.c
+++ b/AuFileName.c
@@ -35,9 +35,9 @@ in this Software without prior written authorization from The Open Group.
#include <stdlib.h>
char *
-XauFileName ()
+XauFileName (void)
{
- char *slashDotXauthority = "/.Xauthority";
+ const char *slashDotXauthority = "/.Xauthority";
char *name;
static char *buf;
static int bsize;
@@ -58,7 +58,7 @@ XauFileName ()
}
if (!name)
#endif
- return 0;
+ return NULL;
}
size = strlen (name) + strlen(&slashDotXauthority[1]) + 2;
if (size > bsize) {
@@ -66,7 +66,7 @@ XauFileName ()
free (buf);
buf = malloc ((unsigned) size);
if (!buf)
- return 0;
+ return NULL;
bsize = size;
}
strcpy (buf, name);
diff --git a/AuGetAddr.c b/AuGetAddr.c
index ab13cb6..6275531 100644
--- a/AuGetAddr.c
+++ b/AuGetAddr.c
@@ -71,12 +71,12 @@ _Xconst char* name)
auth_name = XauFileName ();
if (!auth_name)
- return 0;
+ return NULL;
if (access (auth_name, R_OK) != 0) /* checks REAL id */
- return 0;
+ return NULL;
auth_file = fopen (auth_name, "rb");
if (!auth_file)
- return 0;
+ return NULL;
for (;;) {
entry = XauReadAuth (auth_file);
if (!entry)
diff --git a/AuGetBest.c b/AuGetBest.c
index 5ff1c7c..ae2b748 100644
--- a/AuGetBest.c
+++ b/AuGetBest.c
@@ -83,12 +83,12 @@ XauGetBestAuthByAddr (
auth_name = XauFileName ();
if (!auth_name)
- return 0;
+ return NULL;
if (access (auth_name, R_OK) != 0) /* checks REAL id */
- return 0;
+ return NULL;
auth_file = fopen (auth_name, "rb");
if (!auth_file)
- return 0;
+ return NULL;
#ifdef hpux
if (family == FamilyLocal) {
@@ -110,7 +110,7 @@ XauGetBestAuthByAddr (
}
#endif /* hpux */
- best = 0;
+ best = NULL;
best_type = types_length;
for (;;) {
entry = XauReadAuth (auth_file);
diff --git a/AuRead.c b/AuRead.c
index f7cdf8f..9979c1d 100644
--- a/AuRead.c
+++ b/AuRead.c
@@ -53,7 +53,7 @@ read_counted_string (unsigned short *countp, char **stringp, FILE *file)
if (read_short (&len, file) == 0)
return 0;
if (len == 0) {
- data = 0;
+ data = NULL;
} else {
data = malloc ((unsigned) len);
if (!data)
@@ -70,30 +70,29 @@ read_counted_string (unsigned short *countp, char **stringp, FILE *file)
}
Xauth *
-XauReadAuth (auth_file)
-FILE *auth_file;
+XauReadAuth (FILE *auth_file)
{
Xauth local;
Xauth *ret;
if (read_short (&local.family, auth_file) == 0)
- return 0;
+ return NULL;
if (read_counted_string (&local.address_length, &local.address, auth_file) == 0)
- return 0;
+ return NULL;
if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) {
if (local.address) free (local.address);
- return 0;
+ return NULL;
}
if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) {
if (local.address) free (local.address);
if (local.number) free (local.number);
- return 0;
+ return NULL;
}
if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) {
if (local.address) free (local.address);
if (local.number) free (local.number);
if (local.name) free (local.name);
- return 0;
+ return NULL;
}
ret = (Xauth *) malloc (sizeof (Xauth));
if (!ret) {
@@ -104,7 +103,7 @@ FILE *auth_file;
bzero (local.data, local.data_length);
free (local.data);
}
- return 0;
+ return NULL;
}
*ret = local;
return ret;
diff --git a/AuWrite.c b/AuWrite.c
index f25abc9..5852759 100644
--- a/AuWrite.c
+++ b/AuWrite.c
@@ -55,9 +55,7 @@ write_counted_string (unsigned short count, char *string, FILE *file)
}
int
-XauWriteAuth (auth_file, auth)
-FILE *auth_file;
-Xauth *auth;
+XauWriteAuth (FILE *auth_file, Xauth *auth)
{
if (write_short (auth->family, auth_file) == 0)
return 0;
diff --git a/include/X11/Xauth.h b/include/X11/Xauth.h
index fa9c96b..181618a 100644
--- a/include/X11/Xauth.h
+++ b/include/X11/Xauth.h
@@ -81,10 +81,6 @@ FILE* /* auth_file */,
Xauth* /* auth */
);
-Xauth *XauGetAuthByName(
-_Xconst char* /* display_name */
-);
-
Xauth *XauGetAuthByAddr(
#if NeedWidePrototypes
unsigned int /* family */,