=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rpcgen/rpc_scan.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/rpcgen/rpc_scan.c 2001/11/24 19:17:47 1.5 +++ src/usr.bin/rpcgen/rpc_scan.c 2001/11/24 19:19:59 1.6 @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_scan.c,v 1.5 2001/11/24 19:17:47 deraadt Exp $ */ +/* $OpenBSD: rpc_scan.c,v 1.6 2001/11/24 19:19:59 deraadt Exp $ */ /* $NetBSD: rpc_scan.c,v 1.4 1995/06/11 21:50:02 pk Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -35,8 +35,8 @@ #endif /* - * rpc_scan.c, Scanner for the RPC protocol compiler - * Copyright (C) 1987, Sun Microsystems, Inc. + * rpc_scan.c, Scanner for the RPC protocol compiler + * Copyright (C) 1987, Sun Microsystems, Inc. */ #include #include @@ -64,7 +64,7 @@ static token lasttok; /* last token, if pushed */ /* - * scan expecting 1 given token + * scan expecting 1 given token */ void scan(expect, tokp) @@ -72,12 +72,13 @@ token *tokp; { get_token(tokp); - if (tokp->kind != expect) + if (tokp->kind != expect) { expected1(expect); + } } /* - * scan expecting any of the 2 given tokens + * scan expecting any of the 2 given tokens */ void scan2(expect1, expect2, tokp) @@ -86,12 +87,13 @@ token *tokp; { get_token(tokp); - if (tokp->kind != expect1 && tokp->kind != expect2) + if (tokp->kind != expect1 && tokp->kind != expect2) { expected2(expect1, expect2); + } } /* - * scan expecting any of the 3 given token + * scan expecting any of the 3 given token */ void scan3(expect1, expect2, expect3, tokp) @@ -101,13 +103,14 @@ token *tokp; { get_token(tokp); - if (tokp->kind != expect1 && tokp->kind != expect2 && - tokp->kind != expect3) + if (tokp->kind != expect1 && tokp->kind != expect2 + && tokp->kind != expect3) { expected3(expect1, expect2, expect3); + } } /* - * scan expecting a constant, possibly symbolic + * scan expecting a constant, possibly symbolic */ void scan_num(tokp) @@ -123,7 +126,7 @@ } /* - * Peek at the next token + * Peek at the next token */ void peek(tokp) @@ -134,7 +137,7 @@ } /* - * Peek at the next token and scan it if it matches what you expect + * Peek at the next token and scan it if it matches what you expect */ int peekscan(expect, tokp) @@ -150,7 +153,7 @@ } /* - * Get the next token, printing out any directive that are encountered. + * Get the next token, printing out any directive that are encountered. */ void get_token(tokp) @@ -176,8 +179,8 @@ if (commenting) { break; } else if (cppline(curline)) { - docppline(curline, &linenum, - &infilename); + docppline(curline, &linenum, + &infilename); } else if (directive(curline)) { printdirective(curline); } else { @@ -206,7 +209,7 @@ } /* - * 'where' is not whitespace, comment or directive Must be a token! + * 'where' is not whitespace, comment or directive Must be a token! */ switch (*where) { case ':': @@ -389,28 +392,28 @@ } static token symbols[] = { - {TOK_CONST, "const"}, - {TOK_UNION, "union"}, - {TOK_SWITCH, "switch"}, - {TOK_CASE, "case"}, - {TOK_DEFAULT, "default"}, - {TOK_STRUCT, "struct"}, - {TOK_TYPEDEF, "typedef"}, - {TOK_ENUM, "enum"}, - {TOK_OPAQUE, "opaque"}, - {TOK_BOOL, "bool"}, - {TOK_VOID, "void"}, - {TOK_CHAR, "char"}, - {TOK_INT, "int"}, - {TOK_UNSIGNED, "unsigned"}, - {TOK_SHORT, "short"}, - {TOK_LONG, "long"}, - {TOK_FLOAT, "float"}, - {TOK_DOUBLE, "double"}, - {TOK_STRING, "string"}, - {TOK_PROGRAM, "program"}, - {TOK_VERSION, "version"}, - {TOK_EOF, "??????"}, + {TOK_CONST, "const"}, + {TOK_UNION, "union"}, + {TOK_SWITCH, "switch"}, + {TOK_CASE, "case"}, + {TOK_DEFAULT, "default"}, + {TOK_STRUCT, "struct"}, + {TOK_TYPEDEF, "typedef"}, + {TOK_ENUM, "enum"}, + {TOK_OPAQUE, "opaque"}, + {TOK_BOOL, "bool"}, + {TOK_VOID, "void"}, + {TOK_CHAR, "char"}, + {TOK_INT, "int"}, + {TOK_UNSIGNED, "unsigned"}, + {TOK_SHORT, "short"}, + {TOK_LONG, "long"}, + {TOK_FLOAT, "float"}, + {TOK_DOUBLE, "double"}, + {TOK_STRING, "string"}, + {TOK_PROGRAM, "program"}, + {TOK_VERSION, "version"}, + {TOK_EOF, "??????"}, }; static