diff options
author | cwt <cwt@FreeBSD.org> | 1997-12-15 23:23:35 +0000 |
---|---|---|
committer | cwt <cwt@FreeBSD.org> | 1997-12-15 23:23:35 +0000 |
commit | 7cb55de6f5fe34cf96591b368ea2596664c34a99 (patch) | |
tree | 6c996d5a5ed8fb0c736ab166bbf0422f729a3acc /contrib/global/lib | |
parent | 4fda3be4508d5e4d5cebf2deac98f970dba97f16 (diff) | |
download | FreeBSD-src-7cb55de6f5fe34cf96591b368ea2596664c34a99.zip FreeBSD-src-7cb55de6f5fe34cf96591b368ea2596664c34a99.tar.gz |
Resolve -Wall issues and be stylistic about #include directives.
Diffstat (limited to 'contrib/global/lib')
-rw-r--r-- | contrib/global/lib/dbio.c | 8 | ||||
-rw-r--r-- | contrib/global/lib/dbio.h | 2 | ||||
-rw-r--r-- | contrib/global/lib/find.c | 6 | ||||
-rw-r--r-- | contrib/global/lib/find.h | 4 | ||||
-rw-r--r-- | contrib/global/lib/getdbpath.c | 13 | ||||
-rw-r--r-- | contrib/global/lib/gtagsopen.c | 11 | ||||
-rw-r--r-- | contrib/global/lib/locatestring.c | 4 | ||||
-rw-r--r-- | contrib/global/lib/lookup.c | 2 | ||||
-rw-r--r-- | contrib/global/lib/lookup.h | 2 | ||||
-rw-r--r-- | contrib/global/lib/mgets.c | 2 | ||||
-rw-r--r-- | contrib/global/lib/strop.c | 10 | ||||
-rw-r--r-- | contrib/global/lib/strop.h | 4 | ||||
-rw-r--r-- | contrib/global/lib/tab.c | 2 | ||||
-rw-r--r-- | contrib/global/lib/tag.c | 9 | ||||
-rw-r--r-- | contrib/global/lib/tag.h | 2 | ||||
-rw-r--r-- | contrib/global/lib/test.c | 10 |
16 files changed, 64 insertions, 27 deletions
diff --git a/contrib/global/lib/dbio.c b/contrib/global/lib/dbio.c index c569782..c29a914 100644 --- a/contrib/global/lib/dbio.c +++ b/contrib/global/lib/dbio.c @@ -31,10 +31,16 @@ * dbio.c 14-Dec-97 * */ -#include <stdlib.h> +#include <sys/stat.h> + #include <fcntl.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + #include "dbio.h" #include "die.h" +#include "test.h" DBT key; /* key of record */ DBT dat; /* data of record */ diff --git a/contrib/global/lib/dbio.h b/contrib/global/lib/dbio.h index bc0abf4..7c1994e 100644 --- a/contrib/global/lib/dbio.h +++ b/contrib/global/lib/dbio.h @@ -82,7 +82,7 @@ typedef struct { DBIO *db_open __P((char *, int, int, int)); char *db_get __P((DBIO *, char *)); void db_put __P((DBIO *, char *, char *)); -void de_del __P((DBIO *, char *)); +void db_del __P((DBIO *, char *)); char *db_first __P((DBIO *, char *, int)); char *db_next __P((DBIO *)); void db_close __P((DBIO *)); diff --git a/contrib/global/lib/find.c b/contrib/global/lib/find.c index fd3537c..6203e00 100644 --- a/contrib/global/lib/find.c +++ b/contrib/global/lib/find.c @@ -73,7 +73,7 @@ int issource(path) char *path; { - char c, *p, *q; + char *p; if (!(p = locatestring(path, ".", 2))) return 0; @@ -88,7 +88,7 @@ char *path; } void -findopen() +findopen(void) { char edit[512], *p, *q; int i, lim; @@ -158,7 +158,7 @@ int *length; return (char *)0; } void -findclose() +findclose(void) { pclose(ip); opened = 0; diff --git a/contrib/global/lib/find.h b/contrib/global/lib/find.h index c745a19..bb140e0 100644 --- a/contrib/global/lib/find.h +++ b/contrib/global/lib/find.h @@ -44,8 +44,8 @@ #endif int issource __P((char *)); -void findopen __P(()); +void findopen __P((void)); char *findread __P((int *)); -void findclose __P(()); +void findclose __P((void)); #endif /* ! _FIND_H_ */ diff --git a/contrib/global/lib/getdbpath.c b/contrib/global/lib/getdbpath.c index 9c689da..fc4b635 100644 --- a/contrib/global/lib/getdbpath.c +++ b/contrib/global/lib/getdbpath.c @@ -34,9 +34,14 @@ #include <sys/param.h> #include <sys/types.h> #include <sys/stat.h> + +#include <unistd.h> #include <stdlib.h> + #include "die.h" +#include "getdbpath.h" #include "locatestring.h" +#include "test.h" static char *makeobjdirprefix; /* obj partition */ static char *makeobjdir; /* obj directory */ @@ -105,18 +110,18 @@ char *dbpath; die("It's root directory! What are you doing?"); if (getenv("OSTYPE") && locatestring(getenv("OSTYPE"), "BSD", 0)) { - if (p = getenv("MAKEOBJDIRPREFIX")) + if ((p = getenv("MAKEOBJDIRPREFIX")) != NULL) makeobjdirprefix = p; else makeobjdirprefix = "/usr/obj"; - if (p = getenv("MAKEOBJDIR")) + if ((p = getenv("MAKEOBJDIR")) != NULL) makeobjdir = p; else makeobjdir = "obj"; bsd = 1; } - if (p = getenv("GTAGSROOT")) { + if ((p = getenv("GTAGSROOT")) != NULL) { if (*p != '/') die("GTAGSROOT must be an absolute path."); if (stat(p, &sb) || !S_ISDIR(sb.st_mode)) @@ -125,7 +130,7 @@ char *dbpath; /* * GTAGSDBPATH is meaningful only when GTAGSROOT exist. */ - if (p = getenv("GTAGSDBPATH")) { + if ((p = getenv("GTAGSDBPATH")) != NULL) { if (*p != '/') die("GTAGSDBPATH must be an absolute path."); if (stat(p, &sb) || !S_ISDIR(sb.st_mode)) diff --git a/contrib/global/lib/gtagsopen.c b/contrib/global/lib/gtagsopen.c index 2331c4b..90f0481 100644 --- a/contrib/global/lib/gtagsopen.c +++ b/contrib/global/lib/gtagsopen.c @@ -32,12 +32,17 @@ * */ #include <sys/param.h> -#include <fcntl.h> + +#include <ctype.h> #include <db.h> +#include <fcntl.h> +#include <stdlib.h> + #include "dbio.h" +#include "dbname.h" #include "die.h" +#include "gtagsopen.h" #include "makepath.h" -#include "dbname.h" #define VERSIONKEY " __.VERSION" static int support_version = 1; /* accept this format version */ @@ -82,7 +87,7 @@ int mode; * if 'format version record' is not found, it's assumed * version 1. */ - if (p = db_get(dbio, VERSIONKEY)) { + if ((p = db_get(dbio, VERSIONKEY)) != NULL) { for (p += strlen(VERSIONKEY); *p && isspace(*p); p++) ; version_number = atoi(p); diff --git a/contrib/global/lib/locatestring.c b/contrib/global/lib/locatestring.c index f2aeecf..230ccce 100644 --- a/contrib/global/lib/locatestring.c +++ b/contrib/global/lib/locatestring.c @@ -31,6 +31,10 @@ * locatestring.c 20-Oct-97 * */ +#include <string.h> + +#include "locatestring.h" + /* * locatestring: locate pattern from string * diff --git a/contrib/global/lib/lookup.c b/contrib/global/lib/lookup.c index 0583d6b..d317ba6 100644 --- a/contrib/global/lib/lookup.c +++ b/contrib/global/lib/lookup.c @@ -57,7 +57,7 @@ char *name; return (p) ? 1 : 0; } void -lookupclose() +lookupclose(void) { db_close(dbio); opened = 0; diff --git a/contrib/global/lib/lookup.h b/contrib/global/lib/lookup.h index cfe8c8e..037102f 100644 --- a/contrib/global/lib/lookup.h +++ b/contrib/global/lib/lookup.h @@ -45,6 +45,6 @@ void lookupopen __P((char *)); int lookup __P((char *)); -void lookupclose __P(()); +void lookupclose __P((void)); #endif /* ! _LOOKUP_H_ */ diff --git a/contrib/global/lib/mgets.c b/contrib/global/lib/mgets.c index 880338e..2bc6099 100644 --- a/contrib/global/lib/mgets.c +++ b/contrib/global/lib/mgets.c @@ -32,6 +32,8 @@ * */ #include <stdio.h> +#include <stdlib.h> + #include "mgets.h" #include "die.h" diff --git a/contrib/global/lib/strop.c b/contrib/global/lib/strop.c index e15db16..b024abc 100644 --- a/contrib/global/lib/strop.c +++ b/contrib/global/lib/strop.c @@ -31,8 +31,12 @@ * strop.c 20-Oct-97 * */ -#include "strop.h" +#include <stdlib.h> +#include <string.h> + #include "die.h" +#include "strop.h" + /* * usage: string buffer * @@ -49,7 +53,7 @@ static int sbufsize; static int opened; void -stropen() +stropen(void) { if (opened) die("nested call to stropen."); @@ -107,7 +111,7 @@ int c; *curp = 0; } char * -strclose() +strclose(void) { opened = 0; /* diff --git a/contrib/global/lib/strop.h b/contrib/global/lib/strop.h index aa9fa68..9289566 100644 --- a/contrib/global/lib/strop.h +++ b/contrib/global/lib/strop.h @@ -43,10 +43,10 @@ #endif #endif -void stropen __P(()); +void stropen __P((void)); void strputs __P((char *)); void strnputs __P((char *, int)); void strputc __P((int)); -char *strclose __P(()); +char *strclose __P((void)); #endif /* ! _STROP_H_ */ diff --git a/contrib/global/lib/tab.c b/contrib/global/lib/tab.c index 8f5adbf..d309386 100644 --- a/contrib/global/lib/tab.c +++ b/contrib/global/lib/tab.c @@ -33,6 +33,8 @@ */ #include <stdio.h> +#include "tab.h" + #define TABPOS(i) ((i)%8 == 0) /* * detab: convert tabs into spaces and print diff --git a/contrib/global/lib/tag.c b/contrib/global/lib/tag.c index 81d9aae..e80d634 100644 --- a/contrib/global/lib/tag.c +++ b/contrib/global/lib/tag.c @@ -31,11 +31,16 @@ * tag.c 20-Oct-97 * */ +#include <ctype.h> +#include <string.h> + #include "dbio.h" #include "die.h" #include "gtagsopen.h" -#include "tag.h" #include "locatestring.h" +#include "tab.h" +#include "tag.h" + static DBIO *dbio; static int opened; @@ -73,7 +78,7 @@ char *path; } } void -tagclose() +tagclose(void) { db_close(dbio); opened = 0; diff --git a/contrib/global/lib/tag.h b/contrib/global/lib/tag.h index b12caaa..8bac2ac 100644 --- a/contrib/global/lib/tag.h +++ b/contrib/global/lib/tag.h @@ -46,6 +46,6 @@ void tagopen __P((char *, int, int)); void tagput __P((char *, char *)); void tagdelete __P((char *)); -void tagclose __P(()); +void tagclose __P((void)); #endif /* ! _TAG_H_ */ diff --git a/contrib/global/lib/test.c b/contrib/global/lib/test.c index 99aae9d..a3b5966 100644 --- a/contrib/global/lib/test.c +++ b/contrib/global/lib/test.c @@ -31,9 +31,13 @@ * test.c 12-Dec-97 * */ -#include <unistd.h> -#include <sys/types.h> #include <sys/stat.h> +#include <sys/types.h> + +#include <unistd.h> + +#include "test.h" + /* * test: * @@ -60,7 +64,7 @@ char *path; if (stat(path, &sb) < 0) return 0; - while (c = *flags++) { + while ((c = *flags++) != NULL) { switch (c) { case 'f': if (!S_ISREG(sb.st_mode)) |