[AD] Fix compilation warnings on Solaris

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


When compiling tools/dat2c.c:

tools/dat2c.c: In function `invalid_macro_name':
tools/dat2c.c:138: warning: subscript has type `char'
tools/dat2c.c:140: warning: subscript has type `char'
tools/dat2c.c: In function `get_c_identifier':
tools/dat2c.c:851: warning: subscript has type `char'
tools/dat2c.c:853: warning: subscript has type `char'

Fixed thusly. Applied to trunk.

Allegro can't compile with --enable-strictwarn because of a broken Xlib.h on 
Solaris 8.

-- 
Eric Botcazou
Index: tools/dat2c.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tools/dat2c.c,v
retrieving revision 1.13
diff -u -p -r1.13 dat2c.c
--- tools/dat2c.c	18 May 2003 09:24:55 -0000	1.13
+++ tools/dat2c.c	28 Jun 2003 22:42:50 -0000
@@ -135,9 +135,9 @@ struct dat2c_converter {
 static int invalid_macro_name(const char* n)
 {
     const char* m = 0;
-    if(*n != '_' && !isalpha(*n)) return 1;
+    if(*n != '_' && !isalpha((int)*n)) return 1;
     for(m = n + 1; *m; m++)
-        if(*m != '_' && !isalnum(*m)) return 1;
+        if(*m != '_' && !isalnum((int)*m)) return 1;
     return 0;
 }
 
@@ -848,9 +848,9 @@ static const char* get_c_identifier(cons
     if(prop_name && strlen(prop_name)) {
         int i;
         for(i = 1; prop_name[i]; i++) {
-            if(!isalnum(prop_name[i]) && prop_name[i] != '_') break;
+            if(!isalnum((int)prop_name[i]) && prop_name[i] != '_') break;
         }
-        if((*prop_name == '_' || isalpha(*prop_name)) && 
+        if((*prop_name == '_' || isalpha((int)*prop_name)) && 
             !prop_name[i])
         {
             return new_cident(prefix, prop_name, obj);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/