(submit/fix-char-signedness) xfree86: parser: scan: fix char signess mismatch
On NetBSD gives warning:
In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/parser/scan.c:58:
../hw/xfree86/parser/scan.c: In function ‘xf86getToken’:
../hw/xfree86/parser/scan.c:343:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  343 |         else if ((c == ',') && !isalpha(configBuf[configPos])) {
      |                                                  ^
../hw/xfree86/parser/scan.c:346:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  346 |         else if ((c == '-') && !isalpha(configBuf[configPos])) {
      |                                                  ^
../hw/xfree86/parser/scan.c: In function ‘xf86nameCompare’:
../hw/xfree86/parser/scan.c:1031:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1031 |     c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                   ^
../hw/xfree86/parser/scan.c:1031:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1031 |     c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                                  ^
../hw/xfree86/parser/scan.c:1032:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1032 |     c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                   ^
../hw/xfree86/parser/scan.c:1032:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1032 |     c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                                  ^
../hw/xfree86/parser/scan.c:1042:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1042 |         c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                       ^
../hw/xfree86/parser/scan.c:1042:38: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1042 |         c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                                      ^
../hw/xfree86/parser/scan.c:1043:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1043 |         c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                       ^
../hw/xfree86/parser/scan.c:1043:38: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1043 |         c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                                      ^
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
			
			
This commit is contained in:
		
							parent
							
								
									d59736f701
								
							
						
					
					
						commit
						049c945be7
					
				|  | @ -341,10 +341,10 @@ xf86getToken(const xf86ConfigSymTabRec * tab) | |||
|         } | ||||
| 
 | ||||
|         /* GJA -- handle '-' and ','  * Be careful: "-hsync" is a keyword. */ | ||||
|         else if ((c == ',') && !isalpha(configBuf[configPos])) { | ||||
|         else if ((c == ',') && !isalpha((unsigned char)configBuf[configPos])) { | ||||
|             return COMMA; | ||||
|         } | ||||
|         else if ((c == '-') && !isalpha(configBuf[configPos])) { | ||||
|         else if ((c == '-') && !isalpha((unsigned char)configBuf[configPos])) { | ||||
|             return DASH; | ||||
|         } | ||||
| 
 | ||||
|  | @ -1029,8 +1029,8 @@ xf86nameCompare(const char *s1, const char *s2) | |||
|         s1++; | ||||
|     while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') | ||||
|         s2++; | ||||
|     c1 = (isupper(*s1) ? tolower(*s1) : *s1); | ||||
|     c2 = (isupper(*s2) ? tolower(*s2) : *s2); | ||||
|     c1 = (isupper((unsigned char)*s1) ? tolower((unsigned char)*s1) : *s1); | ||||
|     c2 = (isupper((unsigned char)*s2) ? tolower((unsigned char)*s2) : *s2); | ||||
|     while (c1 == c2) { | ||||
|         if (c1 == '\0') | ||||
|             return 0; | ||||
|  | @ -1040,8 +1040,8 @@ xf86nameCompare(const char *s1, const char *s2) | |||
|             s1++; | ||||
|         while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') | ||||
|             s2++; | ||||
|         c1 = (isupper(*s1) ? tolower(*s1) : *s1); | ||||
|         c2 = (isupper(*s2) ? tolower(*s2) : *s2); | ||||
|         c1 = (isupper((unsigned char)*s1) ? tolower((unsigned char)*s1) : *s1); | ||||
|         c2 = (isupper((unsigned char)*s2) ? tolower((unsigned char)*s2) : *s2); | ||||
|     } | ||||
|     return c1 - c2; | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue