Fix compiler warnings.

Compiler warned about comparison between signed and unsigned values.
This commit is contained in:
Emil Skoeldberg 2018-04-26 18:11:55 +01:00 committed by Quentin Carbonneaux
parent 39b1f468b0
commit e7a3875859
11 changed files with 21 additions and 21 deletions

View file

@ -458,7 +458,7 @@ anumber(ANum *ai, Blk *b, Con *con)
int a, a1, a2, n1, n2, t1, t2;
Ins *i;
for (i=b->ins; i-b->ins < b->nins; i++) {
for (i=b->ins; i<&b->ins[b->nins]; i++) {
if (rtype(i->to) == RTmp)
ai[i->to.val].i = i;
if (i->op != Oadd && i->op != Omul)
@ -574,7 +574,7 @@ amd64_isel(Fn *fn)
b = fn->start;
/* specific to NAlign == 3 */ /* or change n=4 and sz /= 4 below */
for (al=Oalloc, n=4; al<=Oalloc1; al++, n*=2)
for (i=b->ins; i-b->ins < b->nins; i++)
for (i=b->ins; i<&b->ins[b->nins]; i++)
if (i->op == al) {
if (rtype(i->arg[0]) != RCon)
break;

View file

@ -642,7 +642,7 @@ amd64_sysv_abi(Fn *fn)
b->visit = 0;
/* lower parameters */
for (b=fn->start, i=b->ins; i-b->ins<b->nins; i++)
for (b=fn->start, i=b->ins; i<&b->ins[b->nins]; i++)
if (!ispar(i->op))
break;
fa = selpar(fn, b->ins, i);