Fix some signed/unsigned comparison warnings.

It seems mingw's gcc treats pointer subtraction differently to how linux's
gcc does.
This commit is contained in:
Bill Currie 2013-01-05 17:40:59 +09:00
parent 34c0c82408
commit e0e69ac71a
2 changed files with 4 additions and 3 deletions

View file

@ -257,7 +257,7 @@ PR_LeaveFunction (progs_t *pr)
VISIBLE void
PR_BoundsCheckSize (progs_t *pr, pointer_t addr, unsigned size)
{
if (addr < pr->pr_return - pr->pr_globals)
if (addr < (pointer_t) (pr->pr_return - pr->pr_globals))
PR_RunError (pr, "null pointer access");
if (addr >= pr->globals_size
|| size > (unsigned) (pr->globals_size - addr))

View file

@ -507,9 +507,10 @@ add_qfo_strings (qfo_mspace_t *strings)
{
const char *str = strings->d.strings;
while (str - strings->d.strings < strings->data_size) {
while ((pr_uint_t) (str - strings->d.strings) < strings->data_size) {
linker_add_string (str);
while (str - strings->d.strings < strings->data_size && *str)
while ((pr_uint_t) (str - strings->d.strings) < strings->data_size
&& *str)
str++;
str++; // advance past the terminating nul
}