Commit 47398b9c3681ebcd4eb942e732628cdfb172664e

Authored by blueswir1
1 parent 11bb09f1

Use qemu_isfoobar and qemu_towombat versions, based on patch by Christoph Egger

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5774 c046a42c-6fe2-441c-8c8c-71466251a162
block-vvfat.c
@@ -1485,7 +1485,7 @@ static int parse_short_name(BDRVVVFATState* s, @@ -1485,7 +1485,7 @@ static int parse_short_name(BDRVVVFATState* s,
1485 if (direntry->name[i] <= ' ' || direntry->name[i] > 0x7f) 1485 if (direntry->name[i] <= ' ' || direntry->name[i] > 0x7f)
1486 return -1; 1486 return -1;
1487 else if (s->downcase_short_names) 1487 else if (s->downcase_short_names)
1488 - lfn->name[i] = tolower(direntry->name[i]); 1488 + lfn->name[i] = qemu_tolower(direntry->name[i]);
1489 else 1489 else
1490 lfn->name[i] = direntry->name[i]; 1490 lfn->name[i] = direntry->name[i];
1491 } 1491 }
@@ -1498,7 +1498,7 @@ static int parse_short_name(BDRVVVFATState* s, @@ -1498,7 +1498,7 @@ static int parse_short_name(BDRVVVFATState* s,
1498 if (direntry->extension[j] <= ' ' || direntry->extension[j] > 0x7f) 1498 if (direntry->extension[j] <= ' ' || direntry->extension[j] > 0x7f)
1499 return -2; 1499 return -2;
1500 else if (s->downcase_short_names) 1500 else if (s->downcase_short_names)
1501 - lfn->name[i + j] = tolower(direntry->extension[j]); 1501 + lfn->name[i + j] = qemu_tolower(direntry->extension[j]);
1502 else 1502 else
1503 lfn->name[i + j] = direntry->extension[j]; 1503 lfn->name[i + j] = direntry->extension[j];
1504 } 1504 }
@@ -314,14 +314,14 @@ int nbd_receive_negotiate(int csock, off_t *size, size_t *blocksize) @@ -314,14 +314,14 @@ int nbd_receive_negotiate(int csock, off_t *size, size_t *blocksize)
314 *blocksize = 1024; 314 *blocksize = 1024;
315 315
316 TRACE("Magic is %c%c%c%c%c%c%c%c", 316 TRACE("Magic is %c%c%c%c%c%c%c%c",
317 - isprint(buf[0]) ? buf[0] : '.',  
318 - isprint(buf[1]) ? buf[1] : '.',  
319 - isprint(buf[2]) ? buf[2] : '.',  
320 - isprint(buf[3]) ? buf[3] : '.',  
321 - isprint(buf[4]) ? buf[4] : '.',  
322 - isprint(buf[5]) ? buf[5] : '.',  
323 - isprint(buf[6]) ? buf[6] : '.',  
324 - isprint(buf[7]) ? buf[7] : '.'); 317 + qemu_isprint(buf[0]) ? buf[0] : '.',
  318 + qemu_isprint(buf[1]) ? buf[1] : '.',
  319 + qemu_isprint(buf[2]) ? buf[2] : '.',
  320 + qemu_isprint(buf[3]) ? buf[3] : '.',
  321 + qemu_isprint(buf[4]) ? buf[4] : '.',
  322 + qemu_isprint(buf[5]) ? buf[5] : '.',
  323 + qemu_isprint(buf[6]) ? buf[6] : '.',
  324 + qemu_isprint(buf[7]) ? buf[7] : '.');
325 TRACE("Magic is 0x%" PRIx64, magic); 325 TRACE("Magic is 0x%" PRIx64, magic);
326 TRACE("Size is %" PRIu64, *size); 326 TRACE("Size is %" PRIu64, *size);
327 327
@@ -668,7 +668,7 @@ int tap_alloc(char *dev, size_t dev_size) @@ -668,7 +668,7 @@ int tap_alloc(char *dev, size_t dev_size)
668 668
669 if( *dev ){ 669 if( *dev ){
670 ptr = dev; 670 ptr = dev;
671 - while( *ptr && !isdigit((int)*ptr) ) ptr++; 671 + while( *ptr && !qemu_isdigit((int)*ptr) ) ptr++;
672 ppa = atoi(ptr); 672 ppa = atoi(ptr);
673 } 673 }
674 674
qemu-sockets.c
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 #include <unistd.h> 20 #include <unistd.h>
21 21
22 #include "qemu_socket.h" 22 #include "qemu_socket.h"
  23 +#include "qemu-common.h" /* for qemu_isdigit */
23 24
24 #ifndef AI_ADDRCONFIG 25 #ifndef AI_ADDRCONFIG
25 # define AI_ADDRCONFIG 0 26 # define AI_ADDRCONFIG 0
@@ -120,7 +121,7 @@ int inet_listen(const char *str, char *ostr, int olen, @@ -120,7 +121,7 @@ int inet_listen(const char *str, char *ostr, int olen,
120 return -1; 121 return -1;
121 } 122 }
122 ai.ai_family = PF_INET6; 123 ai.ai_family = PF_INET6;
123 - } else if (isdigit(str[0])) { 124 + } else if (qemu_isdigit(str[0])) {
124 /* IPv4 addr */ 125 /* IPv4 addr */
125 if (2 != sscanf(str,"%64[0-9.]:%32[^,]%n",addr,port,&pos)) { 126 if (2 != sscanf(str,"%64[0-9.]:%32[^,]%n",addr,port,&pos)) {
126 fprintf(stderr, "%s: ipv4 parse error (%s)\n", 127 fprintf(stderr, "%s: ipv4 parse error (%s)\n",
@@ -244,7 +245,7 @@ int inet_connect(const char *str, int socktype) @@ -244,7 +245,7 @@ int inet_connect(const char *str, int socktype)
244 return -1; 245 return -1;
245 } 246 }
246 ai.ai_family = PF_INET6; 247 ai.ai_family = PF_INET6;
247 - } else if (isdigit(str[0])) { 248 + } else if (qemu_isdigit(str[0])) {
248 /* IPv4 addr */ 249 /* IPv4 addr */
249 if (2 != sscanf(str,"%64[0-9.]:%32[^,]",addr,port)) { 250 if (2 != sscanf(str,"%64[0-9.]:%32[^,]",addr,port)) {
250 fprintf(stderr, "%s: ipv4 parse error (%s)\n", 251 fprintf(stderr, "%s: ipv4 parse error (%s)\n",
usb-linux.c
@@ -1048,7 +1048,7 @@ static int get_tag_value(char *buf, int buf_size, @@ -1048,7 +1048,7 @@ static int get_tag_value(char *buf, int buf_size,
1048 if (!p) 1048 if (!p)
1049 return -1; 1049 return -1;
1050 p += strlen(tag); 1050 p += strlen(tag);
1051 - while (isspace(*p)) 1051 + while (qemu_isspace(*p))
1052 p++; 1052 p++;
1053 q = buf; 1053 q = buf;
1054 while (*p != '\0' && !strchr(stopchars, *p)) { 1054 while (*p != '\0' && !strchr(stopchars, *p)) {