diff options
author | keramida <keramida@FreeBSD.org> | 2006-12-01 07:01:19 +0000 |
---|---|---|
committer | keramida <keramida@FreeBSD.org> | 2006-12-01 07:01:19 +0000 |
commit | b9438a66362d4965c5f8ff02e33ebce161002907 (patch) | |
tree | 1028e0dbbe1763d196e58cdfd96451b6503f48ad /contrib/top | |
parent | 2f43ac99c06c3206e61b738783b082ec1c9f603f (diff) | |
download | FreeBSD-src-b9438a66362d4965c5f8ff02e33ebce161002907.zip FreeBSD-src-b9438a66362d4965c5f8ff02e33ebce161002907.tar.gz |
The sigconv.awk script generates a sigdesc.h header file, which
contains a sigdec[] vector of structures, but the generated output is
missing braces around the initializer of each struct, which
triggers warnings in WARNS=3:
src/usr.bin/top/sigdesc.h:10: warning: missing braces around initializer
src/usr.bin/top/sigdesc.h:10: warning: (near initialization for `sigdesc[0]')
* Fix the sigconv.awk script to generate a header with initializers
which look better.
* Add rules to usr.bin/top/Makefile that rebuilds a new sigconv.h
header which matches the correct signal set from the build-time
version of `${DESTDIR}/usr/include/signal.h' (so sigconv.h doesn't
get stale once changes are made to the header).
* Remove the old sigconv.h header, now that it is autoupdated at
build time.
* Various Makefile style fixes (the committed Makefile was kindly
submitted by Ruslan):
- Reorder .PATH, PROG, SRCS and CFLAGS to match style.Makefile(5)
- Split off the generated sources (sigdesc.h top.local.h) in an
SRCS+= line of their own.
- Add entries to CLEANFILES near the rules that generate the
respective files.
- Move the explicit rule which builds top.1 after the implicit
rules which generate its dependencies.
Reviewed by: ru, bde
Submitted by: ru (Makefile)
MFC after: 2 weeks
Diffstat (limited to 'contrib/top')
-rw-r--r-- | contrib/top/sigconv.awk | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/top/sigconv.awk b/contrib/top/sigconv.awk index 8c90d8d..8e065fa 100644 --- a/contrib/top/sigconv.awk +++ b/contrib/top/sigconv.awk @@ -1,3 +1,5 @@ +# $FreeBSD$ + BEGIN { nsig = 0; j = 0; @@ -10,7 +12,7 @@ BEGIN { print "struct sigdesc sigdesc[] = {" } -/^#define[ \t][ \t]*SIG[A-Z]/ { +/^#define[ \t][ \t]*SIG[A-Z]+[0-9]*[ \t]/ { j = sprintf("%d", $3); str = $2; @@ -18,10 +20,10 @@ BEGIN { if (nsig < j) nsig = j; - siglist[j] = sprintf("\"%s\",\t%2d,", \ + siglist[j] = sprintf("{ \"%s\",\t%2d },", \ substr(str, 4), j); } -/^#[ \t]*define[ \t][ \t]*SIG[A-Z]/ { +/^#[ \t]*define[ \t][ \t]*SIG[A-Z]+[0-9]*[ \t]/ { j = sprintf("%d", $4); str = $3; @@ -29,10 +31,10 @@ BEGIN { if (nsig < j) nsig = j; - siglist[j] = sprintf("\"%s\",\t%2d,", \ + siglist[j] = sprintf("{ \"%s\",\t%2d },", \ substr(str, 4), j); } -/^#[ \t]*define[ \t][ \t]*_SIG[A-Z]/ { +/^#[ \t]*define[ \t][ \t]*_SIG[A-Z]+[0-9]*[ \t]/ { j = sprintf("%d", $4); str = $3; @@ -40,7 +42,7 @@ BEGIN { if (nsig < j) nsig = j; - siglist[j] = sprintf("\"%s\",\t%2d,", \ + siglist[j] = sprintf("{ \"%s\",\t%2d },", \ substr(str, 5), j); } @@ -49,5 +51,5 @@ END { if (siglist[n] != "") printf(" %s\n", siglist[n]); - printf(" NULL,\t 0\n};\n"); + printf(" { NULL,\t 0 }\n};\n"); } |