From 45376df63f7f4beda2bac863c73d478746c821ed Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Fri, 5 Oct 2001 22:24:41 +0000 Subject: [PATCH] util-warning-cleanup-20011005 add headers, parens, and braces ifdef notdef unused routines --- src/util/assert.c | 1 + src/util/casestrcpy.c | 7 ++++++ src/util/fileutil.c | 13 ++++++++++- src/util/kreltime.c | 12 +++++----- src/util/ktime.c | 51 ++++++++++++++++++++++++------------------- src/util/uuid.c | 11 ++++++++++ 6 files changed, 67 insertions(+), 28 deletions(-) diff --git a/src/util/assert.c b/src/util/assert.c index 6363e67ed..ca35cc2f4 100644 --- a/src/util/assert.c +++ b/src/util/assert.c @@ -10,6 +10,7 @@ /* ReallyAbort: called from assert. May/85 */ #include #include +#include RCSID("$Header$"); diff --git a/src/util/casestrcpy.c b/src/util/casestrcpy.c index 7f7dbdfb1..ae44a1db2 100644 --- a/src/util/casestrcpy.c +++ b/src/util/casestrcpy.c @@ -12,6 +12,13 @@ RCSID("$Header$"); +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include #include #include diff --git a/src/util/fileutil.c b/src/util/fileutil.c index 1f0cb1c30..d17cf765d 100644 --- a/src/util/fileutil.c +++ b/src/util/fileutil.c @@ -24,13 +24,24 @@ RCSID("$Header$"); #include #include #include "errmap_nt.h" -#else +#endif + +#ifdef HAVE_UNISTD_H #include #endif +#ifdef HAVE_STRING_H #include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include #include #include +#ifdef HAVE_FCNTL_H +#include +#endif #include "fileutil.h" diff --git a/src/util/kreltime.c b/src/util/kreltime.c index 2e953218a..60ee5a39c 100644 --- a/src/util/kreltime.c +++ b/src/util/kreltime.c @@ -18,11 +18,13 @@ RCSID("$Header$"); #include "ktime.h" #include #include -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) +#ifdef HAVE_STRING_H #include #else +#ifdef HAVE_STRINGS_H #include #endif +#endif #include "afsutil.h" @@ -39,10 +41,10 @@ static struct parseseqS char ps_keychar; afs_int32 ps_maxValue; } parseseq[] = { - KTIMEDATE_YEAR, 'y', MAX_YEAR_VALUE, /* no max. value */ - KTIMEDATE_MONTH, 'm', MAX_MONTH_VALUE, /* months max. 12 */ - KTIMEDATE_DAY, 'd', MAX_DAY_VALUE, /* days max. 31 */ - 0, 0, 0, + { KTIMEDATE_YEAR, 'y', MAX_YEAR_VALUE, }, /* no max. value */ + { KTIMEDATE_MONTH, 'm', MAX_MONTH_VALUE, }, /* months max. 12 */ + { KTIMEDATE_DAY, 'd', MAX_DAY_VALUE, }, /* days max. 31 */ + { 0, 0, 0, } }; /* Encodings to and from relative dates. The caller is responsible for diff --git a/src/util/ktime.c b/src/util/ktime.c index b2b2207d8..663a383b7 100644 --- a/src/util/ktime.c +++ b/src/util/ktime.c @@ -19,11 +19,14 @@ RCSID("$Header$"); #ifdef AFS_NT40_ENV #include #endif -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) +#ifdef HAVE_STRING_H #include #else +#ifdef HAVE_STRINGS_H #include #endif +#endif +#include #include "afsutil.h" #include "ktime.h" @@ -50,6 +53,7 @@ static char *day[] = { }; /* free token list returned by parseLine */ +#ifdef undef static LocalFreeTokens(alist) register struct token *alist; { register struct token *nlist; @@ -60,6 +64,7 @@ static LocalFreeTokens(alist) } return 0; } +#endif static space(x) int x; { @@ -71,7 +76,7 @@ static LocalParseLine(aline, alist) char *aline; struct token **alist; { char tbuffer[256]; - register char *tptr; + register char *tptr = NULL; int inToken; struct token *first, *last; register struct token *ttok; @@ -121,26 +126,26 @@ static struct ptemp { char *key; afs_int32 value; } ptkeys [] = { - "sun", 0x10000, - "mon", 0x10001, - "tue", 0x10002, - "wed", 0x10003, - "thu", 0x10004, - "fri", 0x10005, - "sat", 0x10006, - "sunday", 0x10000, - "monday", 0x10001, - "tuesday", 0x10002, - "wednesday", 0x10003, - "thursday", 0x10004, - "thur", 0x10004, - "friday", 0x10005, - "saturday", 0x10006, - "am", 0x20000, - "pm", 0x20001, - "a.m.", 0x20000, - "p.m.", 0x20001, - 0, 0, + { "sun", 0x10000, }, + { "mon", 0x10001, }, + { "tue", 0x10002, }, + { "wed", 0x10003, }, + { "thu", 0x10004, }, + { "fri", 0x10005, }, + { "sat", 0x10006, }, + { "sunday", 0x10000, }, + { "monday", 0x10001, }, + { "tuesday", 0x10002, }, + { "wednesday", 0x10003, }, + { "thursday", 0x10004, }, + { "thur", 0x10004, }, + { "friday", 0x10005, }, + { "saturday", 0x10006, }, + { "am", 0x20000, }, + { "pm", 0x20001, }, + { "a.m.", 0x20000, }, + { "p.m.", 0x20001, }, + { 0, 0, } }; /* ktime_DateOf @@ -395,6 +400,7 @@ struct ktime *aktime; { /* compare date in both formats, and return as in strcmp */ +#ifdef undef static KTimeCmp(aktime, atm) register struct ktime *aktime; register struct tm *atm; { @@ -418,6 +424,7 @@ register struct tm *atm; { } return 0; } +#endif /* compare date in both formats, and return as in strcmp */ static KDateCmp(akdate, atm) diff --git a/src/util/uuid.c b/src/util/uuid.c index 79b99f241..f4629c39a 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -37,6 +37,17 @@ RCSID("$Header$"); #include #endif /* ITIMER_REAL */ #include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include #endif #include #include -- 2.39.5