summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkmakefile.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2010-06-13 16:54:11 +0000
committerimp <imp@FreeBSD.org>2010-06-13 16:54:11 +0000
commit72eba20f2c3d064ee0cc48d8ded11924960daf75 (patch)
treec937d8ec59ee2a891312624d980138bcabcda92d /usr.sbin/config/mkmakefile.c
parent99cceb7b938fa416f005fc4d7ec39677a7240607 (diff)
downloadFreeBSD-src-72eba20f2c3d064ee0cc48d8ded11924960daf75.zip
FreeBSD-src-72eba20f2c3d064ee0cc48d8ded11924960daf75.tar.gz
style(9) fixes:
o make cmd scoped to the whole do_rules function, since it really is scoped to the whole fucnion. Making it static was the wrong way to fix referencing it outside of the block in which it was declared (and conforms to the style of the rest of the file). o remove a couple of meaningless blank lines o properly wrap one line.
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r--usr.sbin/config/mkmakefile.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index b5a0e35..1a5a547 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -683,6 +683,7 @@ do_rules(FILE *f)
char *cp, *np, och;
struct file_list *ftp;
char *compilewith;
+ char cmd[128];
STAILQ_FOREACH(ftp, &ftab, f_next) {
if (ftp->f_warn)
@@ -720,25 +721,22 @@ do_rules(FILE *f)
compilewith = ftp->f_compilewith;
if (compilewith == 0) {
const char *ftype = NULL;
- static char cmd[128];
switch (ftp->f_type) {
-
case NORMAL:
ftype = "NORMAL";
break;
-
case PROFILING:
if (!profiling)
continue;
ftype = "PROFILE";
break;
-
default:
printf("config: don't know rules for %s\n", np);
break;
}
- snprintf(cmd, sizeof(cmd), "${%s_%c%s}\n\t@${NORMAL_CTFCONVERT}", ftype,
+ snprintf(cmd, sizeof(cmd),
+ "${%s_%c%s}\n\t@${NORMAL_CTFCONVERT}", ftype,
toupper(och),
ftp->f_flags & NOWERROR ? "_NOWERROR" : "");
compilewith = cmd;
OpenPOWER on IntegriCloud