(submit/fix-char-signedness) xkb: xkbtext: fix char signess mismatch
On NetBSD gives warning:
In file included from /usr/include/ctype.h:100,
                 from ../xkb/xkbtext.c:32:
../xkb/xkbtext.c: In function ‘XkbAtomText’:
../xkb/xkbtext.c:94:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   94 |             if ((tmp == rtrn) && (!isalpha(*tmp)))
      |                                            ^
../xkb/xkbtext.c:96:31: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   96 |             else if (!isalnum(*tmp))
      |                               ^
../xkb/xkbtext.c: In function ‘XkbIMWhichStateMaskText’:
../xkb/xkbtext.c:470:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  470 |                 buf[len + 9] = toupper(buf[len + 9]);
      |                                           ^
../xkb/xkbtext.c: In function ‘XkbControlsMaskText’:
../xkb/xkbtext.c:532:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  532 |                 buf[len + 3] = toupper(buf[len + 3]);
      |                                           ^
../xkb/xkbtext.c: In function ‘XkbStringText’:
../xkb/xkbtext.c:563:22: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  563 |         if (!isprint(*in)) {
      |                      ^
../xkb/xkbtext.c:584:21: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  584 |         if (isprint(*in))
      |                     ^
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
			
			
This commit is contained in:
		
							parent
							
								
									477820977f
								
							
						
					
					
						commit
						8eced6ccc7
					
				| 
						 | 
					@ -90,9 +90,9 @@ XkbAtomText(Atom atm, unsigned format)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (format == XkbCFile) {
 | 
					    if (format == XkbCFile) {
 | 
				
			||||||
        for (tmp = rtrn; *tmp != '\0'; tmp++) {
 | 
					        for (tmp = rtrn; *tmp != '\0'; tmp++) {
 | 
				
			||||||
            if ((tmp == rtrn) && (!isalpha(*tmp)))
 | 
					            if ((tmp == rtrn) && (!isalpha((unsigned char)*tmp)))
 | 
				
			||||||
                *tmp = '_';
 | 
					                *tmp = '_';
 | 
				
			||||||
            else if (!isalnum(*tmp))
 | 
					            else if (!isalnum((unsigned char)*tmp))
 | 
				
			||||||
                *tmp = '_';
 | 
					                *tmp = '_';
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -466,7 +466,7 @@ XkbIMWhichStateMaskText(unsigned use_which, unsigned format)
 | 
				
			||||||
                if (len != 0)
 | 
					                if (len != 0)
 | 
				
			||||||
                    buf[len++] = '|';
 | 
					                    buf[len++] = '|';
 | 
				
			||||||
                sprintf(&buf[len], "XkbIM_Use%s", imWhichNames[i]);
 | 
					                sprintf(&buf[len], "XkbIM_Use%s", imWhichNames[i]);
 | 
				
			||||||
                buf[len + 9] = toupper(buf[len + 9]);
 | 
					                buf[len + 9] = toupper((unsigned char)buf[len + 9]);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					            else {
 | 
				
			||||||
                if (len != 0)
 | 
					                if (len != 0)
 | 
				
			||||||
| 
						 | 
					@ -528,7 +528,7 @@ XkbControlsMaskText(unsigned ctrls, unsigned format)
 | 
				
			||||||
                if (len != 0)
 | 
					                if (len != 0)
 | 
				
			||||||
                    buf[len++] = '|';
 | 
					                    buf[len++] = '|';
 | 
				
			||||||
                sprintf(&buf[len], "Xkb%sMask", ctrlNames[i]);
 | 
					                sprintf(&buf[len], "Xkb%sMask", ctrlNames[i]);
 | 
				
			||||||
                buf[len + 3] = toupper(buf[len + 3]);
 | 
					                buf[len + 3] = toupper((unsigned char)buf[len + 3]);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					            else {
 | 
				
			||||||
                if (len != 0)
 | 
					                if (len != 0)
 | 
				
			||||||
| 
						 | 
					@ -559,7 +559,7 @@ XkbStringText(char *str, unsigned format)
 | 
				
			||||||
    else if (format == XkbXKMFile)
 | 
					    else if (format == XkbXKMFile)
 | 
				
			||||||
        return str;
 | 
					        return str;
 | 
				
			||||||
    for (ok = TRUE, len = 0, in = str; *in != '\0'; in++, len++) {
 | 
					    for (ok = TRUE, len = 0, in = str; *in != '\0'; in++, len++) {
 | 
				
			||||||
        if (!isprint(*in)) {
 | 
					        if (!isprint((unsigned char)*in)) {
 | 
				
			||||||
            ok = FALSE;
 | 
					            ok = FALSE;
 | 
				
			||||||
            switch (*in) {
 | 
					            switch (*in) {
 | 
				
			||||||
            case '\n':
 | 
					            case '\n':
 | 
				
			||||||
| 
						 | 
					@ -580,7 +580,7 @@ XkbStringText(char *str, unsigned format)
 | 
				
			||||||
        return str;
 | 
					        return str;
 | 
				
			||||||
    buf = tbGetBuffer(len + 1);
 | 
					    buf = tbGetBuffer(len + 1);
 | 
				
			||||||
    for (in = str, out = buf; *in != '\0'; in++) {
 | 
					    for (in = str, out = buf; *in != '\0'; in++) {
 | 
				
			||||||
        if (isprint(*in))
 | 
					        if (isprint((unsigned char)*in))
 | 
				
			||||||
            *out++ = *in;
 | 
					            *out++ = *in;
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            *out++ = '\\';
 | 
					            *out++ = '\\';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue