fix most of the fixable bitchings of MIPSpro compiler (complainer?)

This commit is contained in:
tg 2008-03-28 13:28:33 +00:00
parent aacc0b2179
commit 66f433ace0
2 changed files with 6 additions and 7 deletions

View File

@ -5,7 +5,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.69 2008/02/24 15:57:20 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.70 2008/03/28 13:28:33 tg Exp $");
/* A leading = means assignments before command are kept; /* A leading = means assignments before command are kept;
* a leading * means a POSIX special builtin; * a leading * means a POSIX special builtin;
@ -2499,7 +2499,7 @@ c_test(const char **wp)
return !0; return !0;
if (argc == 3) { if (argc == 3) {
opnd1 = (*te.getopnd)(&te, TO_NONOP, 1); opnd1 = (*te.getopnd)(&te, TO_NONOP, 1);
if ((op = (*te.isa)(&te, TM_BINOP))) { if ((op = (*te.isa)(&te, TM_BINOP)) != TO_NONOP) {
opnd2 = (*te.getopnd)(&te, op, 1); opnd2 = (*te.getopnd)(&te, op, 1);
res = (*te.eval)(&te, op, opnd1, res = (*te.eval)(&te, op, opnd1,
opnd2, 1); opnd2, 1);
@ -2793,7 +2793,7 @@ test_primary(Test_env *te, int do_eval)
} }
return res; return res;
} }
if ((op = (*te->isa)(te, TM_UNOP))) { if ((op = (*te->isa)(te, TM_UNOP)) != TO_NONOP) {
/* unary expression */ /* unary expression */
opnd1 = (*te->getopnd)(te, op, do_eval); opnd1 = (*te->getopnd)(te, op, do_eval);
if (!opnd1) { if (!opnd1) {
@ -2947,7 +2947,7 @@ c_ulimit(const char **wp)
{ "swap(KiB)", RLIMIT, RLIMIT_SWAP, RLIMIT_SWAP, { "swap(KiB)", RLIMIT, RLIMIT_SWAP, RLIMIT_SWAP,
1024, 'w' }, 1024, 'w' },
#endif #endif
{ NULL, 0, 0, 0, 0, 0 } { NULL, RLIMIT, 0, 0, 0, 0 }
}; };
static char opts[3 + NELEM(limits)]; static char opts[3 + NELEM(limits)];
rlim_t val = (rlim_t)0; rlim_t val = (rlim_t)0;

5
shf.c
View File

@ -2,7 +2,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.16 2007/10/25 15:23:10 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/shf.c,v 1.17 2008/03/28 13:28:33 tg Exp $");
/* flags to shf_emptybuf() */ /* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */ #define EB_READSW 0x01 /* about to switch to reading */
@ -676,8 +676,7 @@ shf_snprintf(char *buf, int bsize, const char *fmt, ...)
int n; int n;
if (!buf || bsize <= 0) if (!buf || bsize <= 0)
internal_errorf("shf_snprintf: buf %lx, bsize %d", internal_errorf("shf_snprintf: buf %p, bsize %d", buf, bsize);
(long)buf, bsize);
shf_sopen(buf, bsize, SHF_WR, &shf); shf_sopen(buf, bsize, SHF_WR, &shf);
va_start(args, fmt); va_start(args, fmt);