RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm lua Date: 18-Aug-2008 21:16:11 Branch: HEAD Handle: 2008081819160901 Modified files: lua/chkconfig chkconfig.c lua/shadow fputsx.c groupadd.c groupio.c gshadow.c list.c prototypes.h pwio.c sgetgrent.c sgetpwent.c sgroupio.c shadowio.c strtoday.c useradd.c rpm CHANGES Log: - jbj: WR: eliminate most compiler warnings. Summary: Revision Changes Path 1.2 +7 -7 lua/chkconfig/chkconfig.c 1.3 +3 -2 lua/shadow/fputsx.c 1.4 +4 -4 lua/shadow/groupadd.c 1.3 +4 -1 lua/shadow/groupio.c 1.3 +1 -4 lua/shadow/gshadow.c 1.3 +5 -3 lua/shadow/list.c 1.3 +7 -1 lua/shadow/prototypes.h 1.3 +4 -1 lua/shadow/pwio.c 1.3 +4 -2 lua/shadow/sgetgrent.c 1.3 +3 -2 lua/shadow/sgetpwent.c 1.3 +4 -2 lua/shadow/sgroupio.c 1.3 +4 -2 lua/shadow/shadowio.c 1.4 +3 -2 lua/shadow/strtoday.c 1.4 +11 -11 lua/shadow/useradd.c 1.2527 +1 -0 rpm/CHANGES ____________________________________________________________________________ patch -p0 <<'@@ .' Index: lua/chkconfig/chkconfig.c ============================================================================ $ cvs diff -u -r1.1 -r1.2 chkconfig.c --- lua/chkconfig/chkconfig.c 17 Aug 2008 18:31:35 -0000 1.1 +++ lua/chkconfig/chkconfig.c 18 Aug 2008 19:16:10 -0000 1.2 @@ -27,7 +27,7 @@ #include <sys/stat.h> #include <unistd.h> -static char *progname; +static const char *progname; #define _(String) gettext((String)) @@ -74,7 +74,7 @@ if (!findServiceEntries(name, level, &globres)) { - for (i = 0; i < globres.gl_pathc; i++) + for (i = 0; i < (int)globres.gl_pathc; i++) unlink(globres.gl_pathv[i]); if (globres.gl_pathc) globfree(&globres); } @@ -94,7 +94,7 @@ for (level = 0; level < 7; level++) { if (!findServiceEntries(name, level, &globres)) { - for (i = 0; i < globres.gl_pathc; i++) + for (i = 0; i < (int)globres.gl_pathc; i++) unlink(globres.gl_pathv[i]); if (globres.gl_pathc) globfree(&globres); } @@ -313,7 +313,7 @@ if (configured && doChange) { for (level = 0; level < 7; level++) { if (!findServiceEntries(name, level, &globres)) { - for (i = 0; i < globres.gl_pathc; i++) + for (i = 0; i < (int)globres.gl_pathc; i++) unlink(globres.gl_pathv[i]); if (globres.gl_pathc) globfree(&globres); @@ -366,7 +366,7 @@ return 0; } -static int isXinetdEnabled() { +static int isXinetdEnabled(void) { int i; struct service s; @@ -511,7 +511,7 @@ return 0; } -int setService(char * name, int where, int state) { +static int setService(char * name, int where, int state) { int i, rc; int what; struct service s; @@ -559,7 +559,7 @@ return 0; } -int chkconfig_main(int argc, char ** argv) { +int chkconfig_main(int argc, const char ** argv) { int listItem = 0, addItem = 0, delItem = 0, overrideItem = 0; int rc, i, x; int LSB = 0; @@ . patch -p0 <<'@@ .' Index: lua/shadow/fputsx.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 fputsx.c --- lua/shadow/fputsx.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/fputsx.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -35,11 +35,12 @@ #include "system.h" #include "shadow_config.h" +#include "defines.h" +#include "prototypes.h" #include <stdio.h> -#include "defines.h" -#ident "$Id: fputsx.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: fputsx.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" char *fgetsx (char *buf, int cnt, FILE * f) @@ . patch -p0 <<'@@ .' Index: lua/shadow/groupadd.c ============================================================================ $ cvs diff -u -r1.3 -r1.4 groupadd.c --- lua/shadow/groupadd.c 18 Aug 2008 17:27:43 -0000 1.3 +++ lua/shadow/groupadd.c 18 Aug 2008 19:16:10 -0000 1.4 @@ -36,7 +36,7 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: groupadd.c,v 1.3 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: groupadd.c,v 1.4 2008/08/18 19:16:10 jbj Exp $" #include <ctype.h> #include <fcntl.h> @@ -470,7 +470,7 @@ /* field all lower level errors and exit */ - if (retval=setjmp(lclack)) return retval; + if ((retval=setjmp(lclack)) != 0) return retval; { /* @@ -618,11 +618,11 @@ */ open_files (); - if (retval=setjmp(lclack)) /* move longjump() target */ + if ((retval=setjmp(lclack)) != 0) /* move longjump() target */ { int r; - if (r=setjmp(lclack)) return r; /* failed doing next line */ + if ((r=setjmp(lclack)) != 0) return r; /* failed doing next line */ close_files(); return retval; } @@ . patch -p0 <<'@@ .' Index: lua/shadow/groupio.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 groupio.c --- lua/shadow/groupio.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/groupio.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -8,7 +8,7 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: groupio.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: groupio.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" #include "prototypes.h" #include "defines.h" @@ -160,16 +160,19 @@ group_db.changed = 1; } +struct commonio_entry *__gr_get_head (void); /* XXX gcc warning. */ struct commonio_entry *__gr_get_head (void) { return group_db.head; } +struct commonio_db *__gr_get_db (void); /* XXX gcc warning. */ struct commonio_db *__gr_get_db (void) { return &group_db; } +void __gr_del_entry (const struct commonio_entry *ent); /* XXX gcc warning. */ void __gr_del_entry (const struct commonio_entry *ent) { commonio_del_entry (&group_db, ent); @@ . patch -p0 <<'@@ .' Index: lua/shadow/gshadow.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 gshadow.c --- lua/shadow/gshadow.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/gshadow.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -39,7 +39,7 @@ /* Newer versions of Linux libc already have shadow support. */ #if defined(SHADOWGRP) && !defined(HAVE_SHADOWGRP) /*{ */ -#ident "$Id: gshadow.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: gshadow.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" #include <stdio.h> #include "prototypes.h" @@ -52,9 +52,6 @@ static size_t nadmins = 0; static struct sgrp sgroup; -extern char *fgetsx (); -extern int fputsx (); - #define FIELDS 4 #ifdef USE_NIS @@ . patch -p0 <<'@@ .' Index: lua/shadow/list.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 list.c --- lua/shadow/list.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/list.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -39,7 +39,7 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: list.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: list.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" #include "prototypes.h" #include "defines.h" @@ -143,8 +143,10 @@ tmp = (char **) xmalloc ((i + 1) * sizeof (char *)); i = 0; - while (*list) - tmp[i++] = xstrdup (*list++); + while (*list) { + tmp[i++] = xstrdup (*list); + list++; + } tmp[i] = (char *) 0; return tmp; @@ . patch -p0 <<'@@ .' Index: lua/shadow/prototypes.h ============================================================================ $ cvs diff -u -r1.2 -r1.3 prototypes.h --- lua/shadow/prototypes.h 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/prototypes.h 18 Aug 2008 19:16:10 -0000 1.3 @@ -12,7 +12,7 @@ * Juha Virtanen, <[EMAIL PROTECTED]>; November 1995 */ /* - * $Id: prototypes.h,v 1.2 2008/08/18 17:27:43 jbj Exp $ + * $Id: prototypes.h,v 1.3 2008/08/18 19:16:10 jbj Exp $ * * Added a macro to work around ancient (non-ANSI) compilers, just in case * someone ever tries to compile this with SunOS cc... --marekm @@ -150,6 +150,12 @@ /* setupenv.c */ extern void setup_env (struct passwd *); +/* sgetgrent.c */ +extern struct group *sgetgrent (const char *buf); + +/* sgetpwent.c */ +extern struct passwd *sgetpwent (const char *buf); + /* shell.c */ extern int shell (const char *, const char *, char *const *); @@ . patch -p0 <<'@@ .' Index: lua/shadow/pwio.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 pwio.c --- lua/shadow/pwio.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/pwio.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -8,7 +8,7 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: pwio.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: pwio.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" #include "prototypes.h" #include "defines.h" @@ -150,16 +150,19 @@ return commonio_unlock (&passwd_db); } +struct commonio_entry *__pw_get_head (void); /* XXX gcc warning */ struct commonio_entry *__pw_get_head (void) { return passwd_db.head; } +void __pw_del_entry (const struct commonio_entry *ent); /* XXX gcc warning */ void __pw_del_entry (const struct commonio_entry *ent) { commonio_del_entry (&passwd_db, ent); } +struct commonio_db *__pw_get_db (void); /* XXX gcc warning */ struct commonio_db *__pw_get_db (void) { return &passwd_db; @@ . patch -p0 <<'@@ .' Index: lua/shadow/sgetgrent.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 sgetgrent.c --- lua/shadow/sgetgrent.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/sgetgrent.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -35,12 +35,14 @@ #include "system.h" #include "shadow_config.h" +#include "defines.h" +#include "prototypes.h" -#ident "$Id: sgetgrent.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: sgetgrent.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" #include <stdio.h> #include <grp.h> -#include "defines.h" + #define NFIELDS 4 /* * list - turn a comma-separated string into an array of (char *)'s @@ . patch -p0 <<'@@ .' Index: lua/shadow/sgetpwent.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 sgetpwent.c --- lua/shadow/sgetpwent.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/sgetpwent.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -35,11 +35,12 @@ #include "system.h" #include "shadow_config.h" +#include "defines.h" +#include "prototypes.h" -#ident "$Id: sgetpwent.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: sgetpwent.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" #include <sys/types.h> -#include "defines.h" #include <stdio.h> #include <pwd.h> #define NFIELDS 7 @@ . patch -p0 <<'@@ .' Index: lua/shadow/sgroupio.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 sgroupio.c --- lua/shadow/sgroupio.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/sgroupio.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -10,7 +10,7 @@ #ifdef SHADOWGRP -#ident "$Id: sgroupio.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: sgroupio.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" #include "prototypes.h" #include "defines.h" @@ -183,11 +183,13 @@ gshadow_db.changed = 1; } +struct commonio_entry *__sgr_get_head (void); /* XXX gcc warning */ struct commonio_entry *__sgr_get_head (void) { return gshadow_db.head; } +void __sgr_del_entry (const struct commonio_entry *ent); /* XXX gcc warning */ void __sgr_del_entry (const struct commonio_entry *ent) { commonio_del_entry (&gshadow_db, ent); @@ -196,7 +198,7 @@ /* Sort with respect to group ordering. */ int sgr_sort () { - extern struct commonio_db *__gr_get_db (); + extern struct commonio_db *__gr_get_db (void); return commonio_sort_wrt (&gshadow_db, __gr_get_db ()); } @@ . patch -p0 <<'@@ .' Index: lua/shadow/shadowio.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 shadowio.c --- lua/shadow/shadowio.c 18 Aug 2008 17:27:43 -0000 1.2 +++ lua/shadow/shadowio.c 18 Aug 2008 19:16:10 -0000 1.3 @@ -8,7 +8,7 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: shadowio.c,v 1.2 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: shadowio.c,v 1.3 2008/08/18 19:16:10 jbj Exp $" #include "prototypes.h" #include "defines.h" @@ -145,11 +145,13 @@ return commonio_unlock (&shadow_db); } +struct commonio_entry *__spw_get_head (void); /* XXX gcc warning */ struct commonio_entry *__spw_get_head (void) { return shadow_db.head; } +void __spw_del_entry (const struct commonio_entry *ent); /* XXX gcc warning */ void __spw_del_entry (const struct commonio_entry *ent) { commonio_del_entry (&shadow_db, ent); @@ -158,7 +160,7 @@ /* Sort with respect to passwd ordering. */ int spw_sort () { - extern struct commonio_db *__pw_get_db (); + extern struct commonio_db *__pw_get_db (void); return commonio_sort_wrt (&shadow_db, __pw_get_db ()); } @@ . patch -p0 <<'@@ .' Index: lua/shadow/strtoday.c ============================================================================ $ cvs diff -u -r1.3 -r1.4 strtoday.c --- lua/shadow/strtoday.c 18 Aug 2008 18:02:52 -0000 1.3 +++ lua/shadow/strtoday.c 18 Aug 2008 19:16:10 -0000 1.4 @@ -39,10 +39,11 @@ #include "system.h" #include "shadow_config.h" +#include "defines.h" +#include "prototypes.h" -#ident "$Id: strtoday.c,v 1.3 2008/08/18 18:02:52 jbj Exp $" +#ident "$Id: strtoday.c,v 1.4 2008/08/18 19:16:10 jbj Exp $" -#include "defines.h" #ifndef USE_GETDATE #define USE_GETDATE 1 #endif @@ . patch -p0 <<'@@ .' Index: lua/shadow/useradd.c ============================================================================ $ cvs diff -u -r1.3 -r1.4 useradd.c --- lua/shadow/useradd.c 18 Aug 2008 17:27:43 -0000 1.3 +++ lua/shadow/useradd.c 18 Aug 2008 19:16:10 -0000 1.4 @@ -36,7 +36,7 @@ #include "system.h" #include "shadow_config.h" -#ident "$Id: useradd.c,v 1.3 2008/08/18 17:27:43 jbj Exp $" +#ident "$Id: useradd.c,v 1.4 2008/08/18 19:16:10 jbj Exp $" #include <ctype.h> #include <errno.h> @@ -175,7 +175,7 @@ /* local function prototypes */ static void fail_exit (int); -static struct group *getgr_nam_gid (const char *); +static const struct group *getgr_nam_gid (const char *); static long get_number (const char *); static uid_t get_uid (const char *); static void get_defaults (void); @@ -216,7 +216,7 @@ longjmp(lclack,code); /* must be non-zero! */ } -static struct group *lcl_getgrnam (const char *grname) +static const struct group *lcl_getgrnam (const char *grname) { const struct group *grp; @@ -241,7 +241,7 @@ return NULL; } -static struct group *lcl_getgrgid (long gid) +static const struct group *lcl_getgrgid (long gid) { const struct group *grp; @@ -255,7 +255,7 @@ while ((grp = getgrent ())) #endif { - if (grp->gr_gid == gid) { + if (grp->gr_gid == (gid_t)gid) { close_files(); return grp; } @@ -265,12 +265,12 @@ return NULL; } -static struct group *getgr_nam_gid (const char *grname) +static const struct group *getgr_nam_gid (const char *grname) { long gid; char *errptr; - struct group* grp = lcl_getgrnam(grname); + const struct group* grp = lcl_getgrnam(grname); if (grp) return grp; @@ -1009,7 +1009,7 @@ * uniqueness. */ -static void find_new_gid () +static void find_new_gid (void) { const struct group *grp; gid_t gid_min, gid_max; @@ -1715,7 +1715,7 @@ { char *spool, *file; int fd; - struct group *gr; + const struct group *gr; gid_t gid; mode_t mode; @@ -1944,11 +1944,11 @@ */ open_files (); - if (retval=setjmp(lclack)) /* move longjump() target */ + if ((retval=setjmp(lclack)) != 0) /* move longjump() target */ { int r; - if (r=setjmp(lclack)) return r; /* failed doing next line */ + if ((r=setjmp(lclack)) != 0) return r; /* failed doing next line */ close_files(); return retval; } @@ . patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2526 -r1.2527 CHANGES --- rpm/CHANGES 18 Aug 2008 18:19:29 -0000 1.2526 +++ rpm/CHANGES 18 Aug 2008 19:16:09 -0000 1.2527 @@ -1,5 +1,6 @@ 5.1.0 -> 5.2a0: + - jbj: WR: eliminate most compiler warnings. - jbj: WR: eliminate duplicated AutoFu boilerplate, use system.h instead. - jbj: WR: eliminate getdate.[ch], use same from rpmio instead. - jbj: WR: eliminate dueling AutoFu defines from shadow_config.h, use RPM's @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org