one can’t cast an unsigned int to a signed int portably either, if the value

is larger than the positive range of the latter (implementation-defined), so
avoid them in all explicit cases and rearrange stuff and check for it

(I’m gonna have to revise lots more code…)
This commit is contained in:
tg
2013-04-01 02:37:53 +00:00
parent fb3555d7f5
commit 7cce9de0bc
6 changed files with 61 additions and 48 deletions

4
misc.c
View File

@ -30,7 +30,7 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.207 2013/02/24 14:22:43 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.208 2013/04/01 02:37:51 tg Exp $");
#define KSH_CHVT_FLAG
#ifdef MKSH_SMALL
@ -1979,7 +1979,7 @@ chvt(const char *fn)
NZATInit(h);
NZATUpdateMem(h, &rndsetupstate, sizeof(rndsetupstate));
NZAATFinish(h);
rndset((long)h);
rndset((unsigned long)h);
}
chvt_reinit();
}