couple of minor/cosmetic fixes from RT’s compile farm:

• promote SCO OpenServer and UnixWare to !oswarn
• omit trying -O2/-O on OpenServer 5 and USL C
• cast mksh_ari_t to int, mksh_uari_t to unsigned int for printf
• skip ulimit-1 on syllable (which is still too broken)
• write ((mksh_ari_t)-2147483648) ipv UB ((mksh_ari_t)1 << 31)
  and add a comment that that is actually meant
• rewrite functions returning !void ending in NOTREACHED
  so they’ve got a jump target returning an error at the
  end, to aid older compilers and just to be safe
• cast struct stat.st_size to off_t or size_t explicitly when needed
• shorten struct env by two bytes and an alignment, at least

also, optimise control flow and fix more paren matching cases
This commit is contained in:
tg
2012-03-29 19:23:01 +00:00
parent 45fa321c23
commit cf75e7b6ce
8 changed files with 43 additions and 33 deletions

5
eval.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.114 2012/03/27 22:58:38 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.115 2012/03/29 19:22:57 tg Exp $");
/*
* string expansion
@ -393,7 +393,8 @@ expand(const char *cp, /* input word */
NZATUpdateString(h,
str_val(st->var));
NZATFinish(h);
x.str = shf_smprintf("%08X", h);
x.str = shf_smprintf("%08X",
(unsigned int)h);
break;
}
case '0': {