From: Michal Rokos Date: 2002-04-21T15:51:52+09:00 Subject: [Patch] Make -Wall compilation happier Hello, this patch is for making -Wall compilation more calm. Please check it. Michal Index: array.c =================================================================== RCS file: /src/ruby/array.c,v retrieving revision 1.80 diff -u -r1.80 array.c --- array.c 2002/04/18 08:46:17 1.80 +++ array.c 2002/04/19 15:37:39 @@ -207,13 +207,6 @@ return rb_convert_type(ary, T_ARRAY, "Array", "to_ary"); } -static VALUE -to_ary_failed(failed) - int *failed; -{ - *failed = Qtrue; -} - static VALUE rb_ary_replace _((VALUE, VALUE)); static VALUE Index: error.c =================================================================== RCS file: /src/ruby/error.c,v retrieving revision 1.42 diff -u -r1.42 error.c --- error.c 2002/04/15 07:48:45 1.42 +++ error.c 2002/04/19 15:37:47 @@ -182,30 +182,30 @@ int type; const char *name; } builtin_types[] = { - T_NIL, "nil", - T_OBJECT, "Object", - T_CLASS, "Class", - T_ICLASS, "iClass", /* internal use: mixed-in module holder */ - T_MODULE, "Module", - T_FLOAT, "Float", - T_STRING, "String", - T_REGEXP, "Regexp", - T_ARRAY, "Array", - T_FIXNUM, "Fixnum", - T_HASH, "Hash", - T_STRUCT, "Struct", - T_BIGNUM, "Bignum", - T_FILE, "File", - T_TRUE, "true", - T_FALSE, "false", - T_SYMBOL, "Symbol", /* :symbol */ - T_DATA, "Data", /* internal use: wrapped C pointers */ - T_MATCH, "MatchData", /* data of $~ */ - T_VARMAP, "Varmap", /* internal use: dynamic variables */ - T_SCOPE, "Scope", /* internal use: variable scope */ - T_NODE, "Node", /* internal use: syntax tree node */ - T_UNDEF, "undef", /* internal use: #undef; should not happen */ - -1, 0, + {T_NIL, "nil"}, + {T_OBJECT, "Object"}, + {T_CLASS, "Class"}, + {T_ICLASS, "iClass"}, /* internal use: mixed-in module holder */ + {T_MODULE, "Module"}, + {T_FLOAT, "Float"}, + {T_STRING, "String"}, + {T_REGEXP, "Regexp"}, + {T_ARRAY, "Array"}, + {T_FIXNUM, "Fixnum"}, + {T_HASH, "Hash"}, + {T_STRUCT, "Struct"}, + {T_BIGNUM, "Bignum"}, + {T_FILE, "File"}, + {T_TRUE, "true"}, + {T_FALSE, "false"}, + {T_SYMBOL, "Symbol"}, /* :symbol */ + {T_DATA, "Data"}, /* internal use: wrapped C pointers */ + {T_MATCH, "MatchData"}, /* data of $~ */ + {T_VARMAP, "Varmap"}, /* internal use: dynamic variables */ + {T_SCOPE, "Scope"}, /* internal use: variable scope */ + {T_NODE, "Node"}, /* internal use: syntax tree node */ + {T_UNDEF, "undef"}, /* internal use: #undef; should not happen */ + {-1, 0} }; void Index: pack.c =================================================================== RCS file: /src/ruby/pack.c,v retrieving revision 1.35 diff -u -r1.35 pack.c --- pack.c 2002/04/15 07:48:45 1.35 +++ pack.c 2002/04/19 15:39:44 @@ -1541,6 +1541,8 @@ static int first = 1; static int b64_xtable[256]; + a=b=c=d=0; /* init */ + if (first) { int i; first = 0; Index: parse.y =================================================================== RCS file: /src/ruby/parse.y,v retrieving revision 1.166 diff -u -r1.166 parse.y --- parse.y 2002/04/19 04:14:07 1.166 +++ parse.y 2002/04/19 15:40:18 @@ -5203,46 +5203,46 @@ ID token; char *name; } op_tbl[] = { - tDOT2, "..", - tDOT3, "...", - '+', "+", - '-', "-", - '+', "+(binary)", - '-', "-(binary)", - '*', "*", - '/', "/", - '%', "%", - tPOW, "**", - tUPLUS, "+@", - tUMINUS, "-@", - tUPLUS, "+(unary)", - tUMINUS, "-(unary)", - '|', "|", - '^', "^", - '&', "&", - tCMP, "<=>", - '>', ">", - tGEQ, ">=", - '<', "<", - tLEQ, "<=", - tEQ, "==", - tEQQ, "===", - tNEQ, "!=", - tMATCH, "=~", - tNMATCH, "!~", - '!', "!", - '~', "~", - '!', "!(unary)", - '~', "~(unary)", - '!', "!@", - '~', "~@", - tAREF, "[]", - tASET, "[]=", - tLSHFT, "<<", - tRSHFT, ">>", - tCOLON2, "::", - '`', "`", - 0, 0, + {tDOT2, ".."}, + {tDOT3, "..."}, + {'+', "+"}, + {'-', "-"}, + {'+', "+(binary)"}, + {'-', "-(binary)"}, + {'*', "*"}, + {'/', "/"}, + {'%', "%"}, + {tPOW, "**"}, + {tUPLUS, "+@"}, + {tUMINUS, "-@"}, + {tUPLUS, "+(unary)"}, + {tUMINUS, "-(unary)"}, + {'|', "|"}, + {'^', "^"}, + {'&', "&"}, + {tCMP, "<=>"}, + {'>', ">"}, + {tGEQ, ">="}, + {'<', "<"}, + {tLEQ, "<="}, + {tEQ, "=="}, + {tEQQ, "==="}, + {tNEQ, "!="}, + {tMATCH, "=~"}, + {tNMATCH, "!~"}, + {'!', "!"}, + {'~', "~"}, + {'!', "!(unary)"}, + {'~', "~(unary)"}, + {'!', "!@"}, + {'~', "~@"}, + {tAREF, "[]"}, + {tASET, "[]="}, + {tLSHFT, "<<"}, + {tRSHFT, ">>"}, + {tCOLON2, "::"}, + {'`', "`"}, + {0, 0} }; static st_table *sym_tbl; Index: signal.c =================================================================== RCS file: /src/ruby/signal.c,v retrieving revision 1.32 diff -u -r1.32 signal.c --- signal.c 2002/03/11 08:02:02 1.32 +++ signal.c 2002/04/19 15:40:22 @@ -34,139 +34,139 @@ int signo; } siglist [] = { #ifdef SIGHUP - "HUP", SIGHUP, + {"HUP", SIGHUP}, #endif #ifdef SIGINT - "INT", SIGINT, + {"INT", SIGINT}, #endif #ifdef SIGQUIT - "QUIT", SIGQUIT, + {"QUIT", SIGQUIT}, #endif #ifdef SIGILL - "ILL", SIGILL, + {"ILL", SIGILL}, #endif #ifdef SIGTRAP - "TRAP", SIGTRAP, + {"TRAP", SIGTRAP}, #endif #ifdef SIGIOT - "IOT", SIGIOT, + {"IOT", SIGIOT}, #endif #ifdef SIGABRT - "ABRT", SIGABRT, + {"ABRT", SIGABRT}, #endif #ifdef SIGEMT - "EMT", SIGEMT, + {"EMT", SIGEMT}, #endif #ifdef SIGFPE - "FPE", SIGFPE, + {"FPE", SIGFPE}, #endif #ifdef SIGKILL - "KILL", SIGKILL, + {"KILL", SIGKILL}, #endif #ifdef SIGBUS - "BUS", SIGBUS, + {"BUS", SIGBUS}, #endif #ifdef SIGSEGV - "SEGV", SIGSEGV, + {"SEGV", SIGSEGV}, #endif #ifdef SIGSYS - "SYS", SIGSYS, + {"SYS", SIGSYS}, #endif #ifdef SIGPIPE - "PIPE", SIGPIPE, + {"PIPE", SIGPIPE}, #endif #ifdef SIGALRM - "ALRM", SIGALRM, + {"ALRM", SIGALRM}, #endif #ifdef SIGTERM - "TERM", SIGTERM, + {"TERM", SIGTERM}, #endif #ifdef SIGURG - "URG", SIGURG, + {"URG", SIGURG}, #endif #ifdef SIGSTOP - "STOP", SIGSTOP, + {"STOP", SIGSTOP}, #endif #ifdef SIGTSTP - "TSTP", SIGTSTP, + {"TSTP", SIGTSTP}, #endif #ifdef SIGCONT - "CONT", SIGCONT, + {"CONT", SIGCONT}, #endif #ifdef SIGCHLD - "CHLD", SIGCHLD, + {"CHLD", SIGCHLD}, #endif #ifdef SIGCLD - "CLD", SIGCLD, + {"CLD", SIGCLD}, #else # ifdef SIGCHLD - "CLD", SIGCHLD, + {"CLD", SIGCHLD}, # endif #endif #ifdef SIGTTIN - "TTIN", SIGTTIN, + {"TTIN", SIGTTIN}, #endif #ifdef SIGTTOU - "TTOU", SIGTTOU, + {"TTOU", SIGTTOU}, #endif #ifdef SIGIO - "IO", SIGIO, + {"IO", SIGIO}, #endif #ifdef SIGXCPU - "XCPU", SIGXCPU, + {"XCPU", SIGXCPU}, #endif #ifdef SIGXFSZ - "XFSZ", SIGXFSZ, + {"XFSZ", SIGXFSZ}, #endif #ifdef SIGVTALRM - "VTALRM", SIGVTALRM, + {"VTALRM", SIGVTALRM}, #endif #ifdef SIGPROF - "PROF", SIGPROF, + {"PROF", SIGPROF}, #endif #ifdef SIGWINCH - "WINCH", SIGWINCH, + {"WINCH", SIGWINCH}, #endif #ifdef SIGUSR1 - "USR1", SIGUSR1, + {"USR1", SIGUSR1}, #endif #ifdef SIGUSR2 - "USR2", SIGUSR2, + {"USR2", SIGUSR2}, #endif #ifdef SIGLOST - "LOST", SIGLOST, + {"LOST", SIGLOST}, #endif #ifdef SIGMSG - "MSG", SIGMSG, + {"MSG", SIGMSG}, #endif #ifdef SIGPWR - "PWR", SIGPWR, + {"PWR", SIGPWR}, #endif #ifdef SIGPOLL - "POLL", SIGPOLL, + {"POLL", SIGPOLL}, #endif #ifdef SIGDANGER - "DANGER", SIGDANGER, + {"DANGER", SIGDANGER}, #endif #ifdef SIGMIGRATE - "MIGRATE", SIGMIGRATE, + {"MIGRATE", SIGMIGRATE}, #endif #ifdef SIGPRE - "PRE", SIGPRE, + {"PRE", SIGPRE}, #endif #ifdef SIGGRANT - "GRANT", SIGGRANT, + {"GRANT", SIGGRANT}, #endif #ifdef SIGRETRACT - "RETRACT", SIGRETRACT, + {"RETRACT", SIGRETRACT}, #endif #ifdef SIGSOUND - "SOUND", SIGSOUND, + {"SOUND", SIGSOUND}, #endif #ifdef SIGINFO - "INFO", SIGINFO, + {"INFO", SIGINFO}, #endif - NULL, 0, + {NULL, 0} }; static int @@ -481,7 +481,7 @@ { sighandler_t func; VALUE command, old; - int sig; + int sig = -1; char *s; func = sighandler; Index: time.c =================================================================== RCS file: /src/ruby/time.c,v retrieving revision 1.56 diff -u -r1.56 time.c --- time.c 2002/04/18 08:46:18 1.56 +++ time.c 2002/04/19 15:40:48 @@ -1153,9 +1153,11 @@ VALUE time; { struct time_object *tobj; +#if !defined(HAVE_TM_ZONE) && (!defined(HAVE_TZNAME) || !defined(HAVE_DAYLIGHT)) char buf[64]; int len; - +#endif + GetTimeval(time, tobj); if (tobj->tm_got == 0) { time_get_tm(time, tobj->gmt); -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michal Rokos Czech Technical University, Prague E-mail:m.rokos@sh.cvut.cz ICQ:36118339 Jabber:majkl@jabber.sh.cvut.cz -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-