summaryrefslogtreecommitdiffstats
path: root/usr.sbin/crunch/crunchgen
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-02-02 21:51:14 +0000
committerpfg <pfg@FreeBSD.org>2013-02-02 21:51:14 +0000
commit4b413731c8635fc79b2a2de63e9dbedca8cc7566 (patch)
tree069f5dcdb85d51e09ca01bf0ff6e9b919f41b9a5 /usr.sbin/crunch/crunchgen
parentd10987d4020421db516b11821338cc2f1dd4b3ef (diff)
downloadFreeBSD-src-4b413731c8635fc79b2a2de63e9dbedca8cc7566.zip
FreeBSD-src-4b413731c8635fc79b2a2de63e9dbedca8cc7566.tar.gz
crunch: Sync some NetBSD changes.
crunchide: Apr 11, 2009: fix some -Wsign-compare issues. Sep 20, 1999: Free the right thing. crunchgen: Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual) Oct 30, 2004: Add (unsigned char) cast to ctype functions Feb 5, 2001: fix nested extern. examples: Aug 30, 2007: NetBSD 36867 - trsp references are deprecated Obtained from: NetBSD MFC after: 1 week
Diffstat (limited to 'usr.sbin/crunch/crunchgen')
-rw-r--r--usr.sbin/crunch/crunchgen/crunchgen.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c
index 48d6f33..e55f339 100644
--- a/usr.sbin/crunch/crunchgen/crunchgen.c
+++ b/usr.sbin/crunch/crunchgen/crunchgen.c
@@ -105,15 +105,16 @@ int list_mode;
/* general library routines */
-void status(char *str);
+void status(const char *str);
void out_of_memory(void);
void add_string(strlst_t **listp, char *str);
-int is_dir(char *pathname);
-int is_nonempty_file(char *pathname);
+int is_dir(const char *pathname);
+int is_nonempty_file(const char *pathname);
int subtract_strlst(strlst_t **lista, strlst_t **listb);
int in_list(strlst_t **listp, char *str);
-/* helper routines for main() */
+
+extern char *crunched_skel[];
void usage(void);
void parse_conf_file(void);
@@ -245,7 +246,7 @@ usage(void)
/* helper routines for parse_conf_file */
void parse_one_file(char *filename);
-void parse_line(char *line, int *fc, char **fv, int nf);
+void parse_line(char *pline, int *fc, char **fv, int nf);
void add_srcdirs(int argc, char **argv);
void add_progs(int argc, char **argv);
void add_link(int argc, char **argv);
@@ -340,15 +341,15 @@ parse_one_file(char *filename)
void
-parse_line(char *line, int *fc, char **fv, int nf)
+parse_line(char *pline, int *fc, char **fv, int nf)
{
char *p;
- p = line;
+ p = pline;
*fc = 0;
while (1) {
- while (isspace(*p))
+ while (isspace((unsigned char)*p))
p++;
if (*p == '\0' || *p == '#')
@@ -357,7 +358,7 @@ parse_line(char *line, int *fc, char **fv, int nf)
if (*fc < nf)
fv[(*fc)++] = p;
- while (*p && !isspace(*p) && *p != '#')
+ while (*p && !isspace((unsigned char)*p) && *p != '#')
p++;
if (*p == '\0' || *p == '#')
@@ -767,17 +768,17 @@ fillin_program_objs(prog_t *p, char *path)
}
cp = line + 6;
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
while(*cp) {
obj = cp;
- while (*cp && !isspace(*cp))
+ while (*cp && !isspace((unsigned char)*cp))
cp++;
if (*cp)
*cp++ = '\0';
add_string(&p->objs, obj);
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
}
}
@@ -887,7 +888,6 @@ gen_output_makefile(void)
void
gen_output_cfile(void)
{
- extern char *crunched_skel[];
char **cp;
FILE *outcf;
prog_t *p;
@@ -945,7 +945,7 @@ char *genident(char *str)
for (d = s = n; *s != '\0'; s++) {
if (*s == '-')
*d++ = '_';
- else if (*s == '_' || isalnum(*s))
+ else if (*s == '_' || isalnum((unsigned char)*s))
*d++ = *s;
}
*d = '\0';
@@ -1135,7 +1135,7 @@ output_strlst(FILE *outf, strlst_t *lst)
*/
void
-status(char *str)
+status(const char *str)
{
static int lastlen = 0;
int len, spaces;
@@ -1211,7 +1211,7 @@ in_list(strlst_t **listp, char *str)
}
int
-is_dir(char *pathname)
+is_dir(const char *pathname)
{
struct stat buf;
@@ -1222,7 +1222,7 @@ is_dir(char *pathname)
}
int
-is_nonempty_file(char *pathname)
+is_nonempty_file(const char *pathname)
{
struct stat buf;
OpenPOWER on IntegriCloud