From: jtvolpe Date: Fri, 20 Apr 2001 02:17:56 +0000 (+0000) Subject: Fixed mixed type compares and conversions X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=700e0b7fd1bdc9df0adb3cf2e69c69e13b8c2d9f;p=fw%2Fsdcc Fixed mixed type compares and conversions git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@746 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 048b2148..8e96cc85 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -385,9 +385,9 @@ aopForRemat (symbol * sym) for (;;) { if (ic->op == '+') - val += operandLitValue (IC_RIGHT (ic)); + val += (int) operandLitValue (IC_RIGHT (ic)); else if (ic->op == '-') - val -= operandLitValue (IC_RIGHT (ic)); + val -= (int) operandLitValue (IC_RIGHT (ic)); else break; @@ -603,7 +603,7 @@ aopOp (operand * op, iCode * ic, bool result) if (sym->ruonly) { - int i; + unsigned i; aop = op->aop = sym->aop = newAsmop (AOP_STR); aop->size = getSize (sym->type); for (i = 0; i < fReturnSizeMCS51; i++) @@ -2567,7 +2567,7 @@ genPlusIncr (iCode * ic) /* if the literal value of the right hand side is greater than 4 then it is not worth it */ - if ((icount = floatFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit)) > 4) + if ((icount = (unsigned int) floatFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit)) > 4) return FALSE; /* if increment 16 bits in register */ @@ -4078,7 +4078,7 @@ hasInc (operand *op, iCode *ic) return lic; } /* if the operand used or deffed */ - if (bitVectBitValue(ic->uses,op->key) || ic->defKey == op->key) { + if (bitVectBitValue(ic->uses,op->key) || (unsigned) ic->defKey == op->key) { return NULL; } lic = lic->next; diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index 5782ad34..1f77e864 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1178,7 +1178,7 @@ serialRegAssign (eBBlock ** ebbs, int count) then mark it */ if (POINTER_GET (ic) && IS_SYMOP (IC_LEFT (ic)) && getSize (OP_SYMBOL (IC_LEFT (ic))->type) - <= PTRSIZE) + <= (unsigned int) PTRSIZE) { mcs51_ptrRegReq++; ptrRegSet = 1;