From owner-p4-projects@FreeBSD.ORG Tue Aug 15 02:09:16 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E454816A4E0; Tue, 15 Aug 2006 02:09:15 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1C7C16A4DE for ; Tue, 15 Aug 2006 02:09:15 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7584243D46 for ; Tue, 15 Aug 2006 02:09:15 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7F29F8k082450 for ; Tue, 15 Aug 2006 02:09:15 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7F29FV4082447 for perforce@freebsd.org; Tue, 15 Aug 2006 02:09:15 GMT (envelope-from jb@freebsd.org) Date: Tue, 15 Aug 2006 02:09:15 GMT Message-Id: <200608150209.k7F29FV4082447@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 103940 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 02:09:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=103940 Change 103940 by jb@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 @@ -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) {