Date: Sun, 13 Jun 2010 16:54:11 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r209135 - head/usr.sbin/config Message-ID: <201006131654.o5DGsBU9089708@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sun Jun 13 16:54:11 2010 New Revision: 209135 URL: http://svn.freebsd.org/changeset/base/209135 Log: 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. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Sun Jun 13 16:35:20 2010 (r209134) +++ head/usr.sbin/config/mkmakefile.c Sun Jun 13 16:54:11 2010 (r209135) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006131654.o5DGsBU9089708>