From b37630e3a60231e10f8c5e4020f70277f7a1941a Mon Sep 17 00:00:00 2001 From: Stefan Farfeleder Date: Sat, 13 Aug 2005 08:38:02 +0000 Subject: [PATCH] - Provide all initialisers for a struct event. - Include init.h in the generated init.c. - Generate prototypes and put the brace on the next line. --- bin/sh/mkinit.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/sh/mkinit.c b/bin/sh/mkinit.c index 27c97107091c..b158b5f6f745 100644 --- a/bin/sh/mkinit.c +++ b/bin/sh/mkinit.c @@ -133,10 +133,10 @@ char shellproc[] = "\ struct event event[] = { - {"INIT", "init", init}, - {"RESET", "reset", reset}, - {"SHELLPROC", "initshellproc", shellproc}, - {NULL, NULL} + { "INIT", "init", init, { NULL, 0, NULL, NULL } }, + { "RESET", "reset", reset, { NULL, 0, NULL, NULL } }, + { "SHELLPROC", "initshellproc", shellproc, { NULL, 0, NULL, NULL } }, + { NULL, NULL, NULL, { NULL, 0, NULL, NULL } } }; @@ -172,6 +172,7 @@ main(int argc __unused, char *argv[]) header_files[0] = "\"shell.h\""; header_files[1] = "\"mystring.h\""; + header_files[2] = "\"init.h\""; for (ap = argv + 1 ; *ap ; ap++) readfile(*ap); output(); @@ -391,7 +392,7 @@ output(void) for (ep = event ; ep->name ; ep++) { fputs("\n\n\n", fp); fputs(ep->comment, fp); - fprintf(fp, "\nvoid\n%s() {\n", ep->routine); + fprintf(fp, "\nvoid\n%s(void)\n{\n", ep->routine); writetext(&ep->code, fp); fprintf(fp, "}\n"); }