* as/hc08/lkaomf51.c (OutputName): made name unsigned char,
[fw/sdcc] / src / avr / gen.c
index 5993a46c7f2aaa02915370ac52bd9b4d7799a293..cde734ea6a7c045364837ed46dfe5e8f7fda913b 100644 (file)
@@ -249,7 +249,7 @@ emitcode (char *inst, char *fmt, ...)
        else
                vsprintf (lb, fmt, ap);
 
-       while (isspace (*lbp))
+       while (isspace ((unsigned char)*lbp))
                lbp++;
 
        if (lbp && *lbp)
@@ -296,7 +296,7 @@ hasInc (operand *op, iCode *ic)
                        return lic;
                }
                /* if the operand used or deffed */
-               if (bitVectBitValue(OP_USES(op),lic->key) || ((unsigned) lic->defKey == op->key)) {
+               if (bitVectBitValue(OP_USES(op),lic->key) || (lic->defKey == op->key)) {
                        return NULL;
                }
                lic = lic->next;
@@ -1041,7 +1041,7 @@ aopPut (asmop * aop, char *s, int offset)
                break;
 
        case AOP_REG:
-               if (toupper (*s) != 'R') {
+               if (toupper ((unsigned char)*s) != 'R') {
                        if (s == zero) {
                                emitcode ("clr", "%s",
                                          aop->aopu.aop_reg[offset]->name);
@@ -1109,7 +1109,7 @@ aopPut (asmop * aop, char *s, int offset)
 
        case AOP_CRY:
                /* if used only for a condition code check */
-               assert (toupper (*s) == 'R');
+               assert (toupper ((unsigned char)*s) == 'R');
                if (offset == 0) {
                        emitcode ("xrl", "r0,r0");
                        emitcode ("cpi", "%s,0", s);
@@ -1545,7 +1545,7 @@ static void
 genCall (iCode * ic)
 {
 
-       /* if send set is not empty the assign */
+       /* if send set is not empty then assign */
        if (_G.sendSet) {
                iCode *sic;
                int rnum = 16;
@@ -4971,7 +4971,7 @@ genCast (iCode * ic)
                            exit(1);
                        }
                        
-                       sprintf(gpValStr, "#0x%d", gpVal);
+                       sprintf(gpValStr, "#0x%x", gpVal);
                        aopPut (AOP (result), gpValStr, GPTRSIZE - 1);
                    }               
                    goto release;