PERFORCE change 103940 for review
John Birrell
jb at FreeBSD.org
Tue Aug 15 02:09:16 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=103940
Change 103940 by jb at jb_freebsd2 on 2006/08/15 02:09:09
Fix compiler warnings by including a header to get a prototype; using
a different variable name to stop shadowing a global variable; and
matching the signed/unsigned variable types.
Affected files ...
.. //depot/projects/dtrace/src/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c#3 edit
Differences ...
==== //depot/projects/dtrace/src/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c#3 (text) ====
@@ -67,6 +67,7 @@
* the data array being built in msg.c. The index into this array
* becomes the `message' identifier created in the msg.h file.
*/
+
#pragma ident "@(#)sgsmsg.c 1.16 05/06/08 SMI"
#include <fcntl.h>
@@ -318,21 +319,21 @@
* Dump contents of String Table to standard out
*/
static void
-dump_stringtab(Str_tbl *stp)
+dump_stringtab(Str_tbl *dump_stp)
{
uint_t i;
- if ((stp->st_flags & FLG_STTAB_COMPRESS) == 0) {
+ if ((dump_stp->st_flags & FLG_STTAB_COMPRESS) == 0) {
(void) printf("uncompressed strings: %d\n",
- stp->st_fullstringsize);
+ dump_stp->st_fullstringsize);
return;
}
- for (i = 0; i < stp->st_hbckcnt; i++) {
+ for (i = 0; i < dump_stp->st_hbckcnt; i++) {
Str_hash *sthash;
(void) printf("Bucket: [%3d]\n", i);
- for (sthash = stp->st_hashbcks[i]; sthash;
+ for (sthash = dump_stp->st_hashbcks[i]; sthash;
sthash = sthash->hi_next) {
uint_t stroff;
stroff = sthash->hi_mstr->sm_stlen - sthash->hi_stlen;
@@ -350,7 +351,7 @@
}
}
(void) printf("fullstringsize: %d compressed: %d\n",
- stp->st_fullstringsize, stp->st_stringsize);
+ dump_stp->st_fullstringsize, dump_stp->st_stringsize);
}
/*
* Initialize the message definition header file stream.
@@ -630,7 +631,7 @@
}
static int
-file()
+file(void)
{
char buffer[LINE_MAX], * token;
uint_t bufsize;
@@ -646,8 +647,9 @@
line = 1;
while ((token = fgets(buffer, LINE_MAX, fddesc)) != NULL) {
- char defn[PATH_MAX], * _defn, * str;
- int len;
+ char defn[PATH_MAX], * _defn;
+ const char *str;
+ int len = 0;
switch (*token) {
case '#':
@@ -940,7 +942,7 @@
return (1);
}
- if (len >= bufsize) {
+ if (len >= (int) bufsize) {
bufsize += LINE_MAX;
if ((token_buffer = realloc(
token_buffer, bufsize)) == 0) {
More information about the p4-projects
mailing list