[PATCH libXau] Constify XauGetBestAuthByAddr type_names argument

Ran Benita ran234 at gmail.com
Mon Feb 24 15:27:18 PST 2014


The type names are merely accessed, not changed. So make it const to
avoid warnings in other projects (like libxcb) which pass in a static
table of string literals.

Signed-off-by: Ran Benita <ran234 at gmail.com>
---
 AuGetBest.c         | 2 +-
 include/X11/Xauth.h | 2 +-
 man/Xau.man         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/AuGetBest.c b/AuGetBest.c
index 5556559..0d59f85 100644
--- a/AuGetBest.c
+++ b/AuGetBest.c
@@ -57,7 +57,7 @@ XauGetBestAuthByAddr (
 #endif
     _Xconst char*	number,
     int			types_length,
-    char**		types,
+    _Xconst char**	types,
     _Xconst int*	type_lengths)
 {
     FILE    *auth_file;
diff --git a/include/X11/Xauth.h b/include/X11/Xauth.h
index a707bed..e0c4f28 100644
--- a/include/X11/Xauth.h
+++ b/include/X11/Xauth.h
@@ -128,7 +128,7 @@ unsigned short	/* number_length */,
 #endif
 _Xconst char*	/* number */,
 int		/* types_length */,
-char**		/* type_names */,
+_Xconst char**	/* type_names */,
 _Xconst int*	/* type_lengths */
 );
 
diff --git a/man/Xau.man b/man/Xau.man
index d1b6603..aa69b0d 100644
--- a/man/Xau.man
+++ b/man/Xau.man
@@ -59,7 +59,7 @@ Xauth *XauGetAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short
 Xauth *XauGetBestAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short
 \fIaddress_length\fP\^, const char *\fIaddress\fP\^, unsigned short
 \fInumber_length\fP\^, const char *\fInumber\fP\^, int \fItypes_length\fP\^,
-char **\fItypes\fR\^, const int *\fItype_lengths\fR\^);
+const char **\fItypes\fR\^, const int *\fItype_lengths\fR\^);
 .HP
 int XauLockAuth (const char *\fIfile_name\fP\^, int \fIretries\fP\^, int
 \fItimeout\fP\^, long \fIdead\fP\^);
-- 
1.9.0



More information about the xorg-devel mailing list