Fixed mixed type compares and conversions
authorjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 20 Apr 2001 02:17:56 +0000 (02:17 +0000)
committerjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 20 Apr 2001 02:17:56 +0000 (02:17 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@746 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/mcs51/gen.c
src/mcs51/ralloc.c

index 048b2148af6fda89745e13a4d95dda3b5dc347e3..8e96cc85e9fa76700407a4df94f42d7b12b2feed 100644 (file)
@@ -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;
index 5782ad3469175c680fce1b103780558d5abaf6e9..1f77e864200cfa9e3862790d601f0e34bb901603 100644 (file)
@@ -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;