Sat Jan 23 02:33:09 2016 UTC ()
u_int -> unsigned int, in some of the output.

In the bulk of the output making this change would require reworking a
bunch of the internals to allow spaces in type names, which at the
moment doesn't seem worthwhile.


(dholland)
diff -r1.37 -r1.38 src/usr.bin/rpcgen/rpc_cout.c
diff -r1.24 -r1.25 src/usr.bin/rpcgen/rpc_hout.c
diff -r1.21 -r1.22 src/usr.bin/rpcgen/rpc_parse.c
diff -r1.14 -r1.15 src/usr.bin/rpcgen/rpc_tblout.c

cvs diff -r1.37 -r1.38 src/usr.bin/rpcgen/rpc_cout.c (expand / switch to unified diff)

--- src/usr.bin/rpcgen/rpc_cout.c 2015/09/20 16:57:13 1.37
+++ src/usr.bin/rpcgen/rpc_cout.c 2016/01/23 02:33:09 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rpc_cout.c,v 1.37 2015/09/20 16:57:13 kamil Exp $ */ 1/* $NetBSD: rpc_cout.c,v 1.38 2016/01/23 02:33:09 dholland Exp $ */
2/* 2/*
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape 4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users 5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized 6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or 7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user or with the express written consent of 8 * program developed by the user or with the express written consent of
9 * Sun Microsystems, Inc. 9 * Sun Microsystems, Inc.
10 * 10 *
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 * 14 *
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * 2550 Garcia Avenue 28 * 2550 Garcia Avenue
29 * Mountain View, California 94043 29 * Mountain View, California 94043
30 */ 30 */
31 31
32#if HAVE_NBTOOL_CONFIG_H 32#if HAVE_NBTOOL_CONFIG_H
33#include "nbtool_config.h" 33#include "nbtool_config.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37#if defined(__RCSID) && !defined(lint) 37#if defined(__RCSID) && !defined(lint)
38#if 0 38#if 0
39static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; 39static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI";
40#else 40#else
41__RCSID("$NetBSD: rpc_cout.c,v 1.37 2015/09/20 16:57:13 kamil Exp $"); 41__RCSID("$NetBSD: rpc_cout.c,v 1.38 2016/01/23 02:33:09 dholland Exp $");
42#endif 42#endif
43#endif 43#endif
44 44
45/* 45/*
46 * rpc_cout.c, XDR routine outputter for the RPC protocol compiler 46 * rpc_cout.c, XDR routine outputter for the RPC protocol compiler
47 */ 47 */
48#include <ctype.h> 48#include <ctype.h>
49#include <err.h> 49#include <err.h>
50#include <stdio.h> 50#include <stdio.h>
51#include <stdlib.h> 51#include <stdlib.h>
52#include <string.h> 52#include <string.h>
53#include "rpc_scan.h" 53#include "rpc_scan.h"
54#include "rpc_parse.h" 54#include "rpc_parse.h"
@@ -193,29 +193,29 @@ print_ifopen(int indent, const char *nam @@ -193,29 +193,29 @@ print_ifopen(int indent, const char *nam
193 f_print(fout, "if (!xdr_%s(xdrs", name); 193 f_print(fout, "if (!xdr_%s(xdrs", name);
194} 194}
195 195
196static void 196static void
197print_ifarg(const char *arg) 197print_ifarg(const char *arg)
198{ 198{
199 f_print(fout, ", %s", arg); 199 f_print(fout, ", %s", arg);
200} 200}
201 201
202static void 202static void
203print_ifsizeof(const char *prefix, const char *type) 203print_ifsizeof(const char *prefix, const char *type)
204{ 204{
205 if (streq(type, "bool")) { 205 if (streq(type, "bool")) {
206 f_print(fout, ", (u_int)sizeof(bool_t), (xdrproc_t)xdr_bool"); 206 f_print(fout, ", (unsigned int)sizeof(bool_t), (xdrproc_t)xdr_bool");
207 } else { 207 } else {
208 f_print(fout, ", (u_int)sizeof("); 208 f_print(fout, ", (unsigned int)sizeof(");
209 if (undefined(type) && prefix) { 209 if (undefined(type) && prefix) {
210 f_print(fout, "%s ", prefix); 210 f_print(fout, "%s ", prefix);
211 } 211 }
212 f_print(fout, "%s), (xdrproc_t)xdr_%s", type, type); 212 f_print(fout, "%s), (xdrproc_t)xdr_%s", type, type);
213 } 213 }
214} 214}
215 215
216static void 216static void
217print_ifclose(int indent) 217print_ifclose(int indent)
218{ 218{
219 f_print(fout, "))\n"); 219 f_print(fout, "))\n");
220 tabify(fout, indent); 220 tabify(fout, indent);
221 f_print(fout, "\treturn (FALSE);\n"); 221 f_print(fout, "\treturn (FALSE);\n");
@@ -262,30 +262,30 @@ print_ifstat(int indent, const char *pre @@ -262,30 +262,30 @@ print_ifstat(int indent, const char *pre
262 alt = "bytes"; 262 alt = "bytes";
263 } 263 }
264 if (streq(type, "string")) { 264 if (streq(type, "string")) {
265 print_ifopen(indent, alt); 265 print_ifopen(indent, alt);
266 print_ifarg(objname); 266 print_ifarg(objname);
267 } else { 267 } else {
268 if (alt) { 268 if (alt) {
269 print_ifopen(indent, alt); 269 print_ifopen(indent, alt);
270 } else { 270 } else {
271 print_ifopen(indent, "array"); 271 print_ifopen(indent, "array");
272 } 272 }
273 print_ifarg("(char **)(void *)"); 273 print_ifarg("(char **)(void *)");
274 if (*objname == '&') { 274 if (*objname == '&') {
275 f_print(fout, "%s.%s_val, (u_int *)%s.%s_len", 275 f_print(fout, "%s.%s_val, (unsigned int *)%s.%s_len",
276 objname, name, objname, name); 276 objname, name, objname, name);
277 } else { 277 } else {
278 f_print(fout, "&%s->%s_val, (u_int *)&%s->%s_len", 278 f_print(fout, "&%s->%s_val, (unsigned int *)&%s->%s_len",
279 objname, name, objname, name); 279 objname, name, objname, name);
280 } 280 }
281 } 281 }
282 print_ifarg(amax); 282 print_ifarg(amax);
283 if (!alt) { 283 if (!alt) {
284 print_ifsizeof(prefix, type); 284 print_ifsizeof(prefix, type);
285 } 285 }
286 break; 286 break;
287 case REL_ALIAS: 287 case REL_ALIAS:
288 print_ifopen(indent, type); 288 print_ifopen(indent, type);
289 print_ifarg(objname); 289 print_ifarg(objname);
290 break; 290 break;
291 } 291 }

cvs diff -r1.24 -r1.25 src/usr.bin/rpcgen/rpc_hout.c (expand / switch to unified diff)

--- src/usr.bin/rpcgen/rpc_hout.c 2015/09/20 15:45:07 1.24
+++ src/usr.bin/rpcgen/rpc_hout.c 2016/01/23 02:33:09 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rpc_hout.c,v 1.24 2015/09/20 15:45:07 kamil Exp $ */ 1/* $NetBSD: rpc_hout.c,v 1.25 2016/01/23 02:33:09 dholland Exp $ */
2/* 2/*
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape 4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users 5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized 6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or 7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user or with the express written consent of 8 * program developed by the user or with the express written consent of
9 * Sun Microsystems, Inc. 9 * Sun Microsystems, Inc.
10 * 10 *
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 * 14 *
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * 2550 Garcia Avenue 28 * 2550 Garcia Avenue
29 * Mountain View, California 94043 29 * Mountain View, California 94043
30 */ 30 */
31 31
32#if HAVE_NBTOOL_CONFIG_H 32#if HAVE_NBTOOL_CONFIG_H
33#include "nbtool_config.h" 33#include "nbtool_config.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37#if defined(__RCSID) && !defined(lint) 37#if defined(__RCSID) && !defined(lint)
38#if 0 38#if 0
39static char sccsid[] = "@(#)rpc_hout.c 1.12 89/02/22 (C) 1987 SMI"; 39static char sccsid[] = "@(#)rpc_hout.c 1.12 89/02/22 (C) 1987 SMI";
40#else 40#else
41__RCSID("$NetBSD: rpc_hout.c,v 1.24 2015/09/20 15:45:07 kamil Exp $"); 41__RCSID("$NetBSD: rpc_hout.c,v 1.25 2016/01/23 02:33:09 dholland Exp $");
42#endif 42#endif
43#endif 43#endif
44 44
45/* 45/*
46 * rpc_hout.c, Header file outputter for the RPC protocol compiler 46 * rpc_hout.c, Header file outputter for the RPC protocol compiler
47 */ 47 */
48#include <ctype.h> 48#include <ctype.h>
49#include <err.h> 49#include <err.h>
50#include <stdio.h> 50#include <stdio.h>
51#include "rpc_scan.h" 51#include "rpc_scan.h"
52#include "rpc_parse.h" 52#include "rpc_parse.h"
53#include "rpc_util.h" 53#include "rpc_util.h"
54 54
@@ -437,27 +437,27 @@ ptypedef(definition *def) @@ -437,27 +437,27 @@ ptypedef(definition *def)
437 } else 437 } else
438 if (streq(old, "bool")) { 438 if (streq(old, "bool")) {
439 old = "bool_t"; 439 old = "bool_t";
440 } 440 }
441 if (undefined2(old, name) && def->def.ty.old_prefix) { 441 if (undefined2(old, name) && def->def.ty.old_prefix) {
442 s_print(prefix, "%s ", def->def.ty.old_prefix); 442 s_print(prefix, "%s ", def->def.ty.old_prefix);
443 } else { 443 } else {
444 prefix[0] = 0; 444 prefix[0] = 0;
445 } 445 }
446 f_print(fout, "typedef "); 446 f_print(fout, "typedef ");
447 switch (rel) { 447 switch (rel) {
448 case REL_ARRAY: 448 case REL_ARRAY:
449 f_print(fout, "struct {\n"); 449 f_print(fout, "struct {\n");
450 f_print(fout, "\tu_int %s_len;\n", name); 450 f_print(fout, "\tunsigned int %s_len;\n", name);
451 f_print(fout, "\t%s%s *%s_val;\n", prefix, old, name); 451 f_print(fout, "\t%s%s *%s_val;\n", prefix, old, name);
452 f_print(fout, "} %s", name); 452 f_print(fout, "} %s", name);
453 break; 453 break;
454 case REL_POINTER: 454 case REL_POINTER:
455 f_print(fout, "%s%s *%s", prefix, old, name); 455 f_print(fout, "%s%s *%s", prefix, old, name);
456 break; 456 break;
457 case REL_VECTOR: 457 case REL_VECTOR:
458 f_print(fout, "%s%s %s[%s]", prefix, old, name, 458 f_print(fout, "%s%s %s[%s]", prefix, old, name,
459 def->def.ty.array_max); 459 def->def.ty.array_max);
460 break; 460 break;
461 case REL_ALIAS: 461 case REL_ALIAS:
462 f_print(fout, "%s%s %s", prefix, old, name); 462 f_print(fout, "%s%s %s", prefix, old, name);
463 break; 463 break;
@@ -501,27 +501,27 @@ pdeclaration(const char *name, declarati @@ -501,27 +501,27 @@ pdeclaration(const char *name, declarati
501 case REL_ALIAS: 501 case REL_ALIAS:
502 f_print(fout, "%s%s %s", prefix, type, dec->name); 502 f_print(fout, "%s%s %s", prefix, type, dec->name);
503 break; 503 break;
504 case REL_VECTOR: 504 case REL_VECTOR:
505 f_print(fout, "%s%s %s[%s]", prefix, type, dec->name, 505 f_print(fout, "%s%s %s[%s]", prefix, type, dec->name,
506 dec->array_max); 506 dec->array_max);
507 break; 507 break;
508 case REL_POINTER: 508 case REL_POINTER:
509 f_print(fout, "%s%s *%s", prefix, type, dec->name); 509 f_print(fout, "%s%s *%s", prefix, type, dec->name);
510 break; 510 break;
511 case REL_ARRAY: 511 case REL_ARRAY:
512 f_print(fout, "struct {\n"); 512 f_print(fout, "struct {\n");
513 tabify(fout, tab); 513 tabify(fout, tab);
514 f_print(fout, "\tu_int %s_len;\n", dec->name); 514 f_print(fout, "\tunsigned int %s_len;\n", dec->name);
515 tabify(fout, tab); 515 tabify(fout, tab);
516 f_print(fout, "\t%s%s *%s_val;\n", prefix, type, dec->name); 516 f_print(fout, "\t%s%s *%s_val;\n", prefix, type, dec->name);
517 tabify(fout, tab); 517 tabify(fout, tab);
518 f_print(fout, "} %s", dec->name); 518 f_print(fout, "} %s", dec->name);
519 break; 519 break;
520 } 520 }
521 } 521 }
522 f_print(fout, "%s", separator); 522 f_print(fout, "%s", separator);
523} 523}
524 524
525static int 525static int
526undefined2(const char *type, const char *stop) 526undefined2(const char *type, const char *stop)
527{ 527{

cvs diff -r1.21 -r1.22 src/usr.bin/rpcgen/rpc_parse.c (expand / switch to unified diff)

--- src/usr.bin/rpcgen/rpc_parse.c 2015/05/09 23:29:51 1.21
+++ src/usr.bin/rpcgen/rpc_parse.c 2016/01/23 02:33:09 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rpc_parse.c,v 1.21 2015/05/09 23:29:51 dholland Exp $ */ 1/* $NetBSD: rpc_parse.c,v 1.22 2016/01/23 02:33:09 dholland Exp $ */
2/* 2/*
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape 4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users 5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized 6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or 7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user or with the express written consent of 8 * program developed by the user or with the express written consent of
9 * Sun Microsystems, Inc. 9 * Sun Microsystems, Inc.
10 * 10 *
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 * 14 *
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * 2550 Garcia Avenue 28 * 2550 Garcia Avenue
29 * Mountain View, California 94043 29 * Mountain View, California 94043
30 */ 30 */
31 31
32#if HAVE_NBTOOL_CONFIG_H 32#if HAVE_NBTOOL_CONFIG_H
33#include "nbtool_config.h" 33#include "nbtool_config.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37#if defined(__RCSID) && !defined(lint) 37#if defined(__RCSID) && !defined(lint)
38#if 0 38#if 0
39static char sccsid[] = "@(#)rpc_parse.c 1.8 89/02/22 (C) 1987 SMI"; 39static char sccsid[] = "@(#)rpc_parse.c 1.8 89/02/22 (C) 1987 SMI";
40#else 40#else
41__RCSID("$NetBSD: rpc_parse.c,v 1.21 2015/05/09 23:29:51 dholland Exp $"); 41__RCSID("$NetBSD: rpc_parse.c,v 1.22 2016/01/23 02:33:09 dholland Exp $");
42#endif 42#endif
43#endif 43#endif
44 44
45/* 45/*
46 * rpc_parse.c, Parser for the RPC protocol compiler 46 * rpc_parse.c, Parser for the RPC protocol compiler
47 * Copyright (C) 1987 Sun Microsystems, Inc. 47 * Copyright (C) 1987 Sun Microsystems, Inc.
48 */ 48 */
49#include <stdio.h> 49#include <stdio.h>
50#include <stdlib.h> 50#include <stdlib.h>
51#include <string.h> 51#include <string.h>
52#include "rpc/types.h" 52#include "rpc/types.h"
53#include "rpc_scan.h" 53#include "rpc_scan.h"
54#include "rpc_parse.h" 54#include "rpc_parse.h"
@@ -430,27 +430,27 @@ get_declaration(declaration *dec, defkin @@ -430,27 +430,27 @@ get_declaration(declaration *dec, defkin
430 error("No array-of-pointer declarations -- use typedef"); 430 error("No array-of-pointer declarations -- use typedef");
431 } 431 }
432 dec->rel = REL_VECTOR; 432 dec->rel = REL_VECTOR;
433 scan_num(&tok); 433 scan_num(&tok);
434 dec->array_max = tok.str; 434 dec->array_max = tok.str;
435 scan(TOK_RBRACKET, &tok); 435 scan(TOK_RBRACKET, &tok);
436 } else 436 } else
437 if (peekscan(TOK_LANGLE, &tok)) { 437 if (peekscan(TOK_LANGLE, &tok)) {
438 if (dec->rel == REL_POINTER) { 438 if (dec->rel == REL_POINTER) {
439 error("No array-of-pointer declarations -- use typedef"); 439 error("No array-of-pointer declarations -- use typedef");
440 } 440 }
441 dec->rel = REL_ARRAY; 441 dec->rel = REL_ARRAY;
442 if (peekscan(TOK_RANGLE, &tok)) { 442 if (peekscan(TOK_RANGLE, &tok)) {
443 dec->array_max = "(u_int)~0"; 443 dec->array_max = "(unsigned int)~0";
444 /* unspecified size, use * max */ 444 /* unspecified size, use * max */
445 } else { 445 } else {
446 scan_num(&tok); 446 scan_num(&tok);
447 dec->array_max = tok.str; 447 dec->array_max = tok.str;
448 scan(TOK_RANGLE, &tok); 448 scan(TOK_RANGLE, &tok);
449 } 449 }
450 } 450 }
451 if (streq(dec->type, "opaque")) { 451 if (streq(dec->type, "opaque")) {
452 if (dec->rel != REL_ARRAY && dec->rel != REL_VECTOR) { 452 if (dec->rel != REL_ARRAY && dec->rel != REL_VECTOR) {
453 error("Array declaration expected"); 453 error("Array declaration expected");
454 } 454 }
455 } else 455 } else
456 if (streq(dec->type, "string")) { 456 if (streq(dec->type, "string")) {
@@ -496,40 +496,40 @@ get_prog_declaration(declaration *dec, d @@ -496,40 +496,40 @@ get_prog_declaration(declaration *dec, d
496 if (streq(dec->type, "string")) { 496 if (streq(dec->type, "string")) {
497 error("Pointer to string not allowed in program arguments\n"); 497 error("Pointer to string not allowed in program arguments\n");
498 } 498 }
499 dec->rel = REL_POINTER; 499 dec->rel = REL_POINTER;
500 if (peekscan(TOK_IDENT, &tok)) /* optional name of argument */ 500 if (peekscan(TOK_IDENT, &tok)) /* optional name of argument */
501 dec->name = strdup(tok.str); 501 dec->name = strdup(tok.str);
502 } 502 }
503 if (peekscan(TOK_LANGLE, &tok)) { 503 if (peekscan(TOK_LANGLE, &tok)) {
504 if (!streq(dec->type, "string")) { 504 if (!streq(dec->type, "string")) {
505 error("Arrays cannot be declared as arguments to procedures -- use typedef"); 505 error("Arrays cannot be declared as arguments to procedures -- use typedef");
506 } 506 }
507 dec->rel = REL_ARRAY; 507 dec->rel = REL_ARRAY;
508 if (peekscan(TOK_RANGLE, &tok)) { 508 if (peekscan(TOK_RANGLE, &tok)) {
509 dec->array_max = "(u_int)~0"; 509 dec->array_max = "(unsigned int)~0";
510 /* unspecified size, use max */ 510 /* unspecified size, use max */
511 } else { 511 } else {
512 scan_num(&tok); 512 scan_num(&tok);
513 dec->array_max = tok.str; 513 dec->array_max = tok.str;
514 scan(TOK_RANGLE, &tok); 514 scan(TOK_RANGLE, &tok);
515 } 515 }
516 } 516 }
517 if (streq(dec->type, "string")) { 517 if (streq(dec->type, "string")) {
518 if (dec->rel != REL_ARRAY) { /* .x specifies just string as 518 if (dec->rel != REL_ARRAY) { /* .x specifies just string as
519 * type of argument - make it 519 * type of argument - make it
520 * string<> */ 520 * string<> */
521 dec->rel = REL_ARRAY; 521 dec->rel = REL_ARRAY;
522 dec->array_max = "(u_int)~0"; 522 dec->array_max = "(unsigned int)~0";
523 /* unspecified size, use max */ 523 /* unspecified size, use max */
524 } 524 }
525 } 525 }
526} 526}
527 527
528 528
529 529
530static void 530static void
531get_type(const char **prefixp, const char **typep, defkind dkind) 531get_type(const char **prefixp, const char **typep, defkind dkind)
532{ 532{
533 token tok; 533 token tok;
534 534
535 *prefixp = NULL; 535 *prefixp = NULL;

cvs diff -r1.14 -r1.15 src/usr.bin/rpcgen/rpc_tblout.c (expand / switch to unified diff)

--- src/usr.bin/rpcgen/rpc_tblout.c 2013/12/15 00:40:17 1.14
+++ src/usr.bin/rpcgen/rpc_tblout.c 2016/01/23 02:33:09 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rpc_tblout.c,v 1.14 2013/12/15 00:40:17 christos Exp $ */ 1/* $NetBSD: rpc_tblout.c,v 1.15 2016/01/23 02:33:09 dholland Exp $ */
2/* 2/*
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape 4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users 5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized 6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or 7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user or with the express written consent of 8 * program developed by the user or with the express written consent of
9 * Sun Microsystems, Inc. 9 * Sun Microsystems, Inc.
10 * 10 *
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 * 14 *
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * 2550 Garcia Avenue 28 * 2550 Garcia Avenue
29 * Mountain View, California 94043 29 * Mountain View, California 94043
30 */ 30 */
31 31
32#if HAVE_NBTOOL_CONFIG_H 32#if HAVE_NBTOOL_CONFIG_H
33#include "nbtool_config.h" 33#include "nbtool_config.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37#if defined(__RCSID) && !defined(lint) 37#if defined(__RCSID) && !defined(lint)
38#if 0 38#if 0
39static char sccsid[] = "@(#)rpc_tblout.c 1.4 89/02/22 (C) 1988 SMI"; 39static char sccsid[] = "@(#)rpc_tblout.c 1.4 89/02/22 (C) 1988 SMI";
40#else 40#else
41__RCSID("$NetBSD: rpc_tblout.c,v 1.14 2013/12/15 00:40:17 christos Exp $"); 41__RCSID("$NetBSD: rpc_tblout.c,v 1.15 2016/01/23 02:33:09 dholland Exp $");
42#endif 42#endif
43#endif 43#endif
44 44
45/* 45/*
46 * rpc_tblout.c, Dispatch table outputter for the RPC protocol compiler 46 * rpc_tblout.c, Dispatch table outputter for the RPC protocol compiler
47 */ 47 */
48#include <stdio.h> 48#include <stdio.h>
49#include <string.h> 49#include <string.h>
50#include <stdlib.h> 50#include <stdlib.h>
51#include "rpc_scan.h" 51#include "rpc_scan.h"
52#include "rpc_parse.h" 52#include "rpc_parse.h"
53#include "rpc_util.h" 53#include "rpc_util.h"
54 54
@@ -56,27 +56,27 @@ __RCSID("$NetBSD: rpc_tblout.c,v 1.14 20 @@ -56,27 +56,27 @@ __RCSID("$NetBSD: rpc_tblout.c,v 1.14 20
56#define TABCOUNT 5 56#define TABCOUNT 5
57#define TABSTOP (TABSIZE*TABCOUNT) 57#define TABSTOP (TABSIZE*TABCOUNT)
58 58
59static char tabstr[TABCOUNT + 1] = "\t\t\t\t\t"; 59static char tabstr[TABCOUNT + 1] = "\t\t\t\t\t";
60 60
61static const char tbl_hdr[] = "struct rpcgen_table %s_table[] = {\n"; 61static const char tbl_hdr[] = "struct rpcgen_table %s_table[] = {\n";
62static const char tbl_end[] = "};\n"; 62static const char tbl_end[] = "};\n";
63 63
64static const char null_entry[] = "\t(char *(*)())0,\n\ 64static const char null_entry[] = "\t(char *(*)())0,\n\
65 \t(xdrproc_t)xdr_void,\t\t0,\n\ 65 \t(xdrproc_t)xdr_void,\t\t0,\n\
66 \t(xdrproc_t)xdr_void,\t\t0,\n"; 66 \t(xdrproc_t)xdr_void,\t\t0,\n";
67 67
68static const char tbl_nproc[] = 68static const char tbl_nproc[] =
69 "u_int %s_nproc =\n\t(u_int)(sizeof(%s_table)/sizeof(%s_table[0]));\n\n"; 69 "unsigned int %s_nproc =\n\t(unsigned int)(sizeof(%s_table)/sizeof(%s_table[0]));\n\n";
70 70
71static void write_table(definition *); 71static void write_table(definition *);
72static void printit(const char *, const char *); 72static void printit(const char *, const char *);
73 73
74void 74void
75write_tables(void) 75write_tables(void)
76{ 76{
77 list *l; 77 list *l;
78 definition *def; 78 definition *def;
79 79
80 f_print(fout, "\n"); 80 f_print(fout, "\n");
81 for (l = defined; l != NULL; l = l->next) { 81 for (l = defined; l != NULL; l = l->next) {
82 def = (definition *) l->val; 82 def = (definition *) l->val;
@@ -162,20 +162,20 @@ printit(const char *prefix, const char * @@ -162,20 +162,20 @@ printit(const char *prefix, const char *
162 int tabs; 162 int tabs;
163 163
164 164
165 len = fprintf(fout, "\txdr_%s,", stringfix(type)); 165 len = fprintf(fout, "\txdr_%s,", stringfix(type));
166 /* account for leading tab expansion */ 166 /* account for leading tab expansion */
167 len += TABSIZE - 1; 167 len += TABSIZE - 1;
168 /* round up to tabs required */ 168 /* round up to tabs required */
169 tabs = (TABSTOP - len + TABSIZE - 1) / TABSIZE; 169 tabs = (TABSTOP - len + TABSIZE - 1) / TABSIZE;
170 f_print(fout, "%s", &tabstr[TABCOUNT - tabs]); 170 f_print(fout, "%s", &tabstr[TABCOUNT - tabs]);
171 171
172 if (streq(type, "void")) { 172 if (streq(type, "void")) {
173 f_print(fout, "0"); 173 f_print(fout, "0");
174 } else { 174 } else {
175 f_print(fout, "(u_int)sizeof("); 175 f_print(fout, "(unsigned int)sizeof(");
176 /* XXX: should "follow" be 1 ??? */ 176 /* XXX: should "follow" be 1 ??? */
177 ptype(prefix, type, 0); 177 ptype(prefix, type, 0);
178 f_print(fout, ")"); 178 f_print(fout, ")");
179 } 179 }
180 f_print(fout, ",\n"); 180 f_print(fout, ",\n");
181} 181}