ACK found a missing "static", gcc on Minix found a missing cast; add more type size checks

This commit is contained in:
tg 2011-06-12 14:45:34 +00:00
parent 3589604dea
commit c133d423df
2 changed files with 7 additions and 4 deletions

4
eval.c
View File

@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.104 2011/05/02 22:52:51 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/eval.c,v 1.105 2011/06/12 14:45:33 tg Exp $");
/* /*
* string expansion * string expansion
@ -373,7 +373,7 @@ expand(const char *cp, /* input word */
switch (stype & 0x17F) { switch (stype & 0x17F) {
case 0x100 | '#': case 0x100 | '#':
x.str = shf_smprintf("%08X", x.str = shf_smprintf("%08X",
hash(str_val(st->var))); (unsigned int)hash(str_val(st->var)));
break; break;
case '0': { case '0': {
char *beg, *mid, *end, *stg; char *beg, *mid, *end, *stg;

7
misc.c
View File

@ -29,7 +29,7 @@
#include <grp.h> #include <grp.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.166 2011/05/29 02:18:53 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/misc.c,v 1.167 2011/06/12 14:45:34 tg Exp $");
/* type bits for unsigned char */ /* type bits for unsigned char */
unsigned char chtypes[UCHAR_MAX + 1]; unsigned char chtypes[UCHAR_MAX + 1];
@ -872,7 +872,7 @@ cclass(const unsigned char *p, int sub)
} }
/* Look for next ) or | (if match_sep) in *(foo|bar) pattern */ /* Look for next ) or | (if match_sep) in *(foo|bar) pattern */
const unsigned char * static const unsigned char *
pat_scan(const unsigned char *p, const unsigned char *pe, bool match_sep) pat_scan(const unsigned char *p, const unsigned char *pe, bool match_sep)
{ {
int nest = 0; int nest = 0;
@ -1885,6 +1885,9 @@ chvt(const char *fn)
#endif #endif
#ifdef DEBUG #ifdef DEBUG
char intsize_is_okay[sizeof(int) >= 4 ? 1 : -1];
char intsizes_are_okay[sizeof(int) == sizeof(unsigned int) ? 1 : -1];
char longsize_is_okay[sizeof(long) >= sizeof(int) ? 1 : -1];
char longsizes_are_okay[sizeof(long) == sizeof(unsigned long) ? 1 : -1]; char longsizes_are_okay[sizeof(long) == sizeof(unsigned long) ? 1 : -1];
char arisize_is_okay[sizeof(mksh_ari_t) == 4 ? 1 : -1]; char arisize_is_okay[sizeof(mksh_ari_t) == 4 ? 1 : -1];
char uarisize_is_okay[sizeof(mksh_uari_t) == 4 ? 1 : -1]; char uarisize_is_okay[sizeof(mksh_uari_t) == 4 ? 1 : -1];