CompareISOLatin1Lowered: constify arguments

Allows callers to avoid deconstifying arguments when calling, fixing
gcc warning:

filter.c: In function 'PictureGetFilterId':
filter.c:59:2: warning: cast discards qualifiers from pointer target type

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Alan Coopersmith 2011-12-12 16:49:34 -08:00
parent 83ac9502ea
commit d5a5eece67
3 changed files with 6 additions and 5 deletions

View File

@ -167,8 +167,8 @@ ISOLatin1ToLower (unsigned char source)
int int
CompareISOLatin1Lowered(unsigned char *s1, int s1len, CompareISOLatin1Lowered(const unsigned char *s1, int s1len,
unsigned char *s2, int s2len) const unsigned char *s2, int s2len)
{ {
unsigned char c1, c2; unsigned char c1, c2;

View File

@ -175,9 +175,9 @@ extern _X_HIDDEN Bool CreateConnectionBlock(void);
/* dixutils.c */ /* dixutils.c */
extern _X_EXPORT int CompareISOLatin1Lowered( extern _X_EXPORT int CompareISOLatin1Lowered(
unsigned char * /*a*/, const unsigned char * /*a*/,
int alen, int alen,
unsigned char * /*b*/, const unsigned char * /*b*/,
int blen); int blen);
extern _X_EXPORT int dixLookupWindow( extern _X_EXPORT int dixLookupWindow(

View File

@ -56,7 +56,8 @@ PictureGetFilterId (const char *filter, int len, Bool makeit)
if (len < 0) if (len < 0)
len = strlen (filter); len = strlen (filter);
for (i = 0; i < nfilterNames; i++) for (i = 0; i < nfilterNames; i++)
if (!CompareISOLatin1Lowered ((unsigned char *) filterNames[i], -1, (unsigned char *) filter, len)) if (!CompareISOLatin1Lowered ((const unsigned char *) filterNames[i], -1,
(const unsigned char *) filter, len))
return i; return i;
if (!makeit) if (!makeit)
return -1; return -1;