diff options
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | lib.c | 8 | ||||
-rw-r--r-- | lib.h | 6 | ||||
-rw-r--r-- | parser.c | 2 | ||||
-rw-r--r-- | socket.c | 2 | ||||
-rw-r--r-- | sysif.c | 2 | ||||
-rw-r--r-- | termios.c | 4 |
7 files changed, 16 insertions, 10 deletions
@@ -134,7 +134,7 @@ yacc_is_newer_bison= nm='$(cross)$(tool_prefix)nm' opt_flags='-O2 -fno-stack-protector' lang_flags='-ansi -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE' -diag_flags='-Wall -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=strict-prototypes' +diag_flags='-Wall -Wextra -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=strict-prototypes' debug_flags=-g debug_only_flags=-DTXR_DEBUG debug_also= @@ -12437,7 +12437,7 @@ static val make_time_impl(time_t (*pmktime)(struct tm *), val hour, val minute, val second, val isdst) { - struct tm local = { 0 }; + struct tm local = all_zero_init; time_t time; time_fields_to_tm(&local, year, month, day, @@ -12458,7 +12458,7 @@ val make_time(val year, val month, val day, static struct tm epoch_tm(void) { - struct tm ep = { 0 }; + struct tm ep = all_zero_init; ep.tm_year = 70; ep.tm_mday = 1; return ep; @@ -12560,7 +12560,7 @@ static val time_meth(val utc_p, val time_struct) static val time_string_meth(val time_struct, val format) { - struct tm tms = { 0 }; + struct tm tms = all_zero_init; time_struct_to_tm(&tms, time_struct, t); char buffer[512] = ""; char *fmt = utf8_dup_to(c_str(format)); @@ -12577,7 +12577,7 @@ static val time_string_meth(val time_struct, val format) static val time_parse_meth(val time_struct, val format, val string) { - struct tm tms = { 0 }; + struct tm tms = all_zero_init; time_struct_to_tm(&tms, time_struct, nil); val ret = nil; @@ -1298,3 +1298,9 @@ loc list_collect_revappend(loc ptail, val obj); #define static_forward(decl) static decl #define static_def(def) static def #endif + +#ifdef __cplusplus +#define all_zero_init { } +#else +#define all_zero_init { 0 } +#endif @@ -206,7 +206,7 @@ val parser_set_lineno(val self, val stream, val lineno) void prime_parser(parser_t *p, val name, enum prime_parser prim) { - struct yy_token sec_tok = { 0 }; + struct yy_token sec_tok = all_zero_init; switch (prim) { case prime_lisp: @@ -819,7 +819,7 @@ static val sock_mark_connected(val sock) if (sfd) { val family = sock_family(sock); - struct sockaddr_storage sa = { 0 }; + struct sockaddr_storage sa = all_zero_init; socklen_t salen = sizeof sa; (void) getpeername(c_num(sfd), coerce(struct sockaddr *, &sa), &salen); @@ -889,7 +889,7 @@ static val fcntl_wrap(val fd_in, val cmd_in, val arg_in) if (missingp(arg_in)) { errno = EINVAL; } else { - struct flock fl = { 0 }; + struct flock fl = all_zero_init; flock_pack(self, arg_in, &fl); res = fcntl(fd, cmd, &fl); if (cmd == F_GETLK) @@ -337,7 +337,7 @@ static val tcflow_wrap(val action, val stream) static val encode_speeds(val termios) { - struct termios tio = { 0 }; + struct termios tio = all_zero_init; tio.c_iflag = c_num(slot(termios, iflag_s)); tio.c_cflag = c_num(slot(termios, cflag_s)); @@ -351,7 +351,7 @@ static val encode_speeds(val termios) static val decode_speeds(val termios) { - struct termios tio = { 0 }; + struct termios tio = all_zero_init; tio.c_cflag = c_num(slot(termios, cflag_s)); tio.c_iflag = c_num(slot(termios, iflag_s)); |