From e4ac7024d0473e71da84a400fada88dfa9590324 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 19 Dec 1998 21:19:11 +0000 Subject: [PATCH] extra braces, char -> unsigned char --- usr.bin/rpcgen/rpc_cout.c | 8 ++++---- usr.bin/rpcgen/rpc_main.c | 6 +++--- usr.bin/rpcgen/rpc_scan.c | 28 +++++++++++++++------------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/usr.bin/rpcgen/rpc_cout.c b/usr.bin/rpcgen/rpc_cout.c index ca4eb7ba5315..78b61e29ca29 100644 --- a/usr.bin/rpcgen/rpc_cout.c +++ b/usr.bin/rpcgen/rpc_cout.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_cout.c,v 1.14 1998/08/25 20:59:40 ross Exp $ */ +/* $NetBSD: rpc_cout.c,v 1.15 1998/12/19 21:19:11 christos Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; #else -__RCSID("$NetBSD: rpc_cout.c,v 1.14 1998/08/25 20:59:40 ross Exp $"); +__RCSID("$NetBSD: rpc_cout.c,v 1.15 1998/12/19 21:19:11 christos Exp $"); #endif #endif @@ -704,13 +704,13 @@ emit_single_in_line(decl, flag, rel) freed = 1; upp_case = "U_LONG"; } - if (flag == PUT) + if (flag == PUT) { if (rel == REL_ALIAS) f_print(fout, "%s(buf, objp->%s);\n", upp_case, decl->name); else f_print(fout, "%s(buf, *genp++);\n", upp_case); - else + } else f_print(fout, "%s(buf);\n", upp_case); if (!freed) free(upp_case); diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index d8eafe3dad57..039b46f36a86 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_main.c,v 1.14 1997/10/18 10:53:53 lukem Exp $ */ +/* $NetBSD: rpc_main.c,v 1.15 1998/12/19 21:19:12 christos Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -35,7 +35,7 @@ #if 0 static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; #else -__RCSID("$NetBSD: rpc_main.c,v 1.14 1997/10/18 10:53:53 lukem Exp $"); +__RCSID("$NetBSD: rpc_main.c,v 1.15 1998/12/19 21:19:12 christos Exp $"); #endif #endif @@ -526,7 +526,7 @@ generate_guard(pathname) /* convert to upper case */ tmp = guard; while (*tmp) { - if (islower(*tmp)) + if (islower((unsigned char)*tmp)) *tmp = toupper(*tmp); tmp++; } diff --git a/usr.bin/rpcgen/rpc_scan.c b/usr.bin/rpcgen/rpc_scan.c index b764f8109966..ab8cff6fb9f0 100644 --- a/usr.bin/rpcgen/rpc_scan.c +++ b/usr.bin/rpcgen/rpc_scan.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_scan.c,v 1.6 1997/10/18 10:54:05 lukem Exp $ */ +/* $NetBSD: rpc_scan.c,v 1.7 1998/12/19 21:19:12 christos Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)rpc_scan.c 1.11 89/02/22 (C) 1987 SMI"; #else -__RCSID("$NetBSD: rpc_scan.c,v 1.6 1997/10/18 10:54:05 lukem Exp $"); +__RCSID("$NetBSD: rpc_scan.c,v 1.7 1998/12/19 21:19:12 christos Exp $"); #endif #endif @@ -188,8 +188,8 @@ get_token(tokp) } where = curline; } else - if (isspace(*where)) { - while (isspace(*where)) { + if (isspace((unsigned char)*where)) { + while (isspace((unsigned char)*where)) { where++; /* eat */ } } else @@ -292,13 +292,13 @@ get_token(tokp) break; default: - if (!(isalpha(*where) || *where == '_')) { + if (!(isalpha((unsigned char)*where) || *where == '_')) { char buf[100]; char *p; s_print(buf, "illegal character in file: "); p = buf + strlen(buf); - if (isprint(*where)) { + if (isprint((unsigned char)*where)) { s_print(p, "%c", *where); } else { s_print(p, "%d", *where); @@ -380,11 +380,11 @@ findconst(str, val) p++; do { p++; - } while (isxdigit(*p)); + } while (isxdigit((unsigned char)*p)); } else { do { p++; - } while (isdigit(*p)); + } while (isdigit((unsigned char)*p)); } size = p - *str; *val = alloc(size + 1); @@ -431,7 +431,8 @@ findkind(mark, tokp) for (s = symbols; s->kind != TOK_EOF; s++) { len = strlen(s->str); if (strncmp(str, s->str, len) == 0) { - if (!isalnum(str[len]) && str[len] != '_') { + if (!isalnum((unsigned char)str[len]) && + str[len] != '_') { tokp->kind = s->kind; tokp->str = s->str; *mark = str + len; @@ -440,7 +441,8 @@ findkind(mark, tokp) } } tokp->kind = TOK_IDENT; - for (len = 0; isalnum(str[len]) || str[len] == '_'; len++); + for (len = 0; isalnum((unsigned char)str[len]) || + str[len] == '_'; len++); tokp->str = alloc(len + 1); (void) strncpy(tokp->str, str, len); tokp->str[len] = 0; @@ -479,14 +481,14 @@ docppline(line, lineno, fname) char *p; line++; - while (isspace(*line)) { + while (isspace((unsigned char)*line)) { line++; } num = atoi(line); - while (isdigit(*line)) { + while (isdigit((unsigned char)*line)) { line++; } - while (isspace(*line)) { + while (isspace((unsigned char)*line)) { line++; } if (*line != '"') {