Attached patch fixes a series of this warning

when compiling on NetBSD:

warning: array subscript has type 'char'

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5727 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2008-11-16 13:53:32 +00:00
parent 77b9435f13
commit cd390083ad
8 changed files with 43 additions and 27 deletions

View file

@ -1933,7 +1933,7 @@ static void next(void)
{
if (pch != '\0') {
pch++;
while (isspace(*pch))
while (qemu_isspace(*pch))
pch++;
}
}
@ -1992,7 +1992,7 @@ static int64_t expr_unary(void)
*q++ = *pch;
pch++;
}
while (isspace(*pch))
while (qemu_isspace(*pch))
pch++;
*q = 0;
ret = get_monitor_def(&reg, buf);
@ -2017,7 +2017,7 @@ static int64_t expr_unary(void)
expr_error("invalid char in expression");
}
pch = p;
while (isspace(*pch))
while (qemu_isspace(*pch))
pch++;
break;
}
@ -2111,7 +2111,7 @@ static int get_expr(int64_t *pval, const char **pp)
*pp = pch;
return -1;
}
while (isspace(*pch))
while (qemu_isspace(*pch))
pch++;
*pval = expr_sum();
*pp = pch;
@ -2126,7 +2126,7 @@ static int get_str(char *buf, int buf_size, const char **pp)
q = buf;
p = *pp;
while (isspace(*p))
while (qemu_isspace(*p))
p++;
if (*p == '\0') {
fail:
@ -2171,7 +2171,7 @@ static int get_str(char *buf, int buf_size, const char **pp)
}
p++;
} else {
while (*p != '\0' && !isspace(*p)) {
while (*p != '\0' && !qemu_isspace(*p)) {
if ((q - buf) < buf_size - 1) {
*q++ = *p;
}
@ -2217,12 +2217,12 @@ static void monitor_handle_command(const char *cmdline)
/* extract the command name */
p = cmdline;
q = cmdname;
while (isspace(*p))
while (qemu_isspace(*p))
p++;
if (*p == '\0')
return;
pstart = p;
while (*p != '\0' && *p != '/' && !isspace(*p))
while (*p != '\0' && *p != '/' && !qemu_isspace(*p))
p++;
len = p - pstart;
if (len > sizeof(cmdname) - 1)
@ -2258,7 +2258,7 @@ static void monitor_handle_command(const char *cmdline)
int ret;
char *str;
while (isspace(*p))
while (qemu_isspace(*p))
p++;
if (*typestr == '?') {
typestr++;
@ -2299,15 +2299,15 @@ static void monitor_handle_command(const char *cmdline)
{
int count, format, size;
while (isspace(*p))
while (qemu_isspace(*p))
p++;
if (*p == '/') {
/* format found */
p++;
count = 1;
if (isdigit(*p)) {
if (qemu_isdigit(*p)) {
count = 0;
while (isdigit(*p)) {
while (qemu_isdigit(*p)) {
count = count * 10 + (*p - '0');
p++;
}
@ -2346,7 +2346,7 @@ static void monitor_handle_command(const char *cmdline)
}
}
next:
if (*p != '\0' && !isspace(*p)) {
if (*p != '\0' && !qemu_isspace(*p)) {
term_printf("invalid char in format: '%c'\n", *p);
goto fail;
}
@ -2380,7 +2380,7 @@ static void monitor_handle_command(const char *cmdline)
{
int64_t val;
while (isspace(*p))
while (qemu_isspace(*p))
p++;
if (*typestr == '?' || *typestr == '.') {
if (*typestr == '?') {
@ -2391,7 +2391,7 @@ static void monitor_handle_command(const char *cmdline)
} else {
if (*p == '.') {
p++;
while (isspace(*p))
while (qemu_isspace(*p))
p++;
has_arg = 1;
} else {
@ -2436,7 +2436,7 @@ static void monitor_handle_command(const char *cmdline)
c = *typestr++;
if (c == '\0')
goto bad_type;
while (isspace(*p))
while (qemu_isspace(*p))
p++;
has_option = 0;
if (*p == '-') {
@ -2461,7 +2461,7 @@ static void monitor_handle_command(const char *cmdline)
}
}
/* check that all arguments were parsed */
while (isspace(*p))
while (qemu_isspace(*p))
p++;
if (*p != '\0') {
term_printf("%s: extraneous characters at the end of line\n",
@ -2609,7 +2609,7 @@ static void parse_cmdline(const char *cmdline,
p = cmdline;
nb_args = 0;
for(;;) {
while (isspace(*p))
while (qemu_isspace(*p))
p++;
if (*p == '\0')
break;
@ -2643,7 +2643,7 @@ void readline_find_completion(const char *cmdline)
/* if the line ends with a space, it means we want to complete the
next arg */
len = strlen(cmdline);
if (len > 0 && isspace(cmdline[len - 1])) {
if (len > 0 && qemu_isspace(cmdline[len - 1])) {
if (nb_args >= MAX_ARGS)
return;
args[nb_args++] = qemu_strdup("");