diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2006-11-30 00:01:21 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2006-11-30 00:01:21 +0000 |
commit | e982c14bc34a48529ca0db1c016a768cce01e115 (patch) | |
tree | bdf201b23b9ec594b4e05704e2119b2e664b10a8 | |
parent | 53280ebcfd46a129f34d6853a093c3cb425a068a (diff) | |
download | mig-e982c14bc34a48529ca0db1c016a768cce01e115.tar.gz mig-e982c14bc34a48529ca0db1c016a768cce01e115.tar.bz2 mig-e982c14bc34a48529ca0db1c016a768cce01e115.zip |
2006-11-29 Thomas Schwinge <tschwinge@gnu.org>
Fix compiler, flex and bison warnings.
* error.c: Include <stdlib.h>.
* lexxer.h (yylex): Add declaration.
* migcom.c: Include <stdlib.h>.
(main): Set USER, SHEADER and IHEADER to `NULL' by default.
(myfclose): Add lost conversion specifications.
* parser.h (yyerror): Add declaration.
* routine.c (rtPrintArg, rtCheckRoutine): Add braces to avoid
ambiguousness.
* server.c (WriteSymTabEntries): Make NUM an `u_int'.
* user.c (WriteUserIndividual): Add a `default' case in a switch
statement and add lost conversion specifications.
* lexxer.l: Set option `nounput'.
* parser.y (%left): Change commas to spaces.
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | error.c | 1 | ||||
-rw-r--r-- | lexxer.h | 2 | ||||
-rw-r--r-- | lexxer.l | 2 | ||||
-rw-r--r-- | migcom.c | 11 | ||||
-rw-r--r-- | parser.h | 2 | ||||
-rw-r--r-- | parser.y | 4 | ||||
-rw-r--r-- | routine.c | 14 | ||||
-rw-r--r-- | server.c | 2 | ||||
-rw-r--r-- | user.c | 4 |
10 files changed, 50 insertions, 7 deletions
@@ -1,5 +1,20 @@ 2006-11-29 Thomas Schwinge <tschwinge@gnu.org> + Fix compiler, flex and bison warnings. + * error.c: Include <stdlib.h>. + * lexxer.h (yylex): Add declaration. + * migcom.c: Include <stdlib.h>. + (main): Set USER, SHEADER and IHEADER to `NULL' by default. + (myfclose): Add lost conversion specifications. + * parser.h (yyerror): Add declaration. + * routine.c (rtPrintArg, rtCheckRoutine): Add braces to avoid + ambiguousness. + * server.c (WriteSymTabEntries): Make NUM an `u_int'. + * user.c (WriteUserIndividual): Add a `default' case in a switch + statement and add lost conversion specifications. + * lexxer.l: Set option `nounput'. + * parser.y (%left): Change commas to spaces. + * configure.ac (AM_INIT_AUTOMAKE): Add the `no-define' option. * build-aux/config.guess: New file, thanks to `autoreconf'. @@ -26,6 +26,7 @@ #include <stdio.h> #include <stdarg.h> +#include <stdlib.h> #include "global.h" #include "error.h" @@ -31,3 +31,5 @@ extern void LookFileName(void); extern void LookString(void); extern void LookQString(void); extern void LookNormal(void); + +extern int yylex (void); @@ -1,3 +1,5 @@ +%option nounput + %k 10000 %n 5000 %a 20000 @@ -71,6 +71,7 @@ */ #include <stdio.h> +#include <stdlib.h> #include "error.h" #include "lexxer.h" @@ -226,13 +227,17 @@ main(int argc, char **argv) uheader = myfopen(UserHeaderFileName, "w"); if (!UserFilePrefix) user = myfopen(UserFileName, "w"); + else + user = NULL; server = myfopen(ServerFileName, "w"); if (ServerHeaderFileName) sheader = myfopen(ServerHeaderFileName, "w"); + else + sheader = NULL; if (IsKernelServer) - { iheader = myfopen(InternalHeaderFileName, "w"); - } + else + iheader = NULL; if (BeVerbose) { @@ -324,5 +329,5 @@ static void myfclose(FILE *file, const char *name) { if (ferror(file) || fclose(file)) - fatal("fclose(): ", name, unix_error_string(errno)); + fatal("fclose(%s): %s", name, unix_error_string(errno)); } @@ -85,3 +85,5 @@ typedef union extern YYSTYPE yylval; + +extern void yyerror(const char *); @@ -98,8 +98,8 @@ %token <string> syFileName %token <flag> syIPCFlag -%left syPlus,syMinus -%left syStar,syDiv +%left syPlus syMinus +%left syStar syDiv %type <statement_kind> ImportIndicant @@ -236,33 +236,41 @@ rtPrintArg(register const argument_t *arg) break; default: if (akCheck(arg->argKind, akbRequest)) + { if (akCheck(arg->argKind, akbSend)) printf("In"); else printf("(In)"); + } if (akCheck(arg->argKind, akbReply)) + { if (akCheck(arg->argKind, akbReturn)) printf("Out"); else printf("(Out)"); + } printf("\t"); } printf("\t%s: %s", arg->argName, it->itName); if (arg->argDeallocate != it->itDeallocate) + { if (arg->argDeallocate == d_YES) printf(", Dealloc"); else if (arg->argDeallocate == d_MAYBE) printf(", Dealloc[]"); else printf(", NotDealloc"); + } if (arg->argLongForm != it->itLongForm) + { if (arg->argLongForm) printf(", IsLong"); else printf(", IsNotLong"); + } if (arg->argServerCopy) printf(", ServerCopy"); @@ -1265,21 +1273,27 @@ rtCheckRoutine(register routine_t *rt) doesn't have its own args and the user specified global values. */ if (rt->rtUReplyPort == argNULL) + { if (rt->rtOneWay) rtAddDummyReplyPort(rt, itZeroReplyPortType, 1); else rtAddDummyReplyPort(rt, itRealReplyPortType, 1); + } if (rt->rtSReplyPort == argNULL) + { if (rt->rtOneWay) rtAddDummyReplyPort(rt, itZeroReplyPortType, 0); else rtAddDummyReplyPort(rt, itRealReplyPortType, 0); + } if (rt->rtMsgOption == argNULL) + { if (MsgOption == strNULL) rtAddMsgOption(rt, "MACH_MSG_OPTION_NONE"); else rtAddMsgOption(rt, MsgOption); + } if ((rt->rtWaitTime == argNULL) && (WaitTime != strNULL)) @@ -100,7 +100,7 @@ WriteSymTabEntries(FILE *file, const statement_t *stats) for (stat = stats; stat != stNULL; stat = stat->stNext) if (stat->stKind == skRoutine) { - register num = stat->stRoutine->rtNumber; + register u_int num = stat->stRoutine->rtNumber; const char *name = stat->stRoutine->rtName; while (++current <= num) @@ -1315,13 +1315,15 @@ WriteUserIndividual(const statement_t *stats) case skUImport: WriteImport(file, s->stFileName); break; + default: + break; } } WriteRoutine(file, stat->stRoutine); WriteEpilog(file); if (ferror(file) || fclose(file)) - fatal("fclose(): ", filename, + fatal("fclose(%s): %s", filename, unix_error_string(errno)); strfree(filename); } |