memcpy(buf, strObjPtr->bytes, strObjPtr->length + 1);
for (i = 0; i < strObjPtr->length; i++)
- buf[i] = tolower(buf[i]);
+ buf[i] = tolower((unsigned)buf[i]);
return Jim_NewStringObjNoAlloc(interp, buf, strObjPtr->length);
}
memcpy(buf, strObjPtr->bytes, strObjPtr->length + 1);
for (i = 0; i < strObjPtr->length; i++)
- buf[i] = toupper(buf[i]);
+ buf[i] = toupper((unsigned)buf[i]);
return Jim_NewStringObjNoAlloc(interp, buf, strObjPtr->length);
}
case '8':
case '9':
accum = 0;
- while (isdigit(*fmt) && (fmtLen > 0)) {
+ while (isdigit((unsigned)*fmt) && (fmtLen > 0)) {
accum = (accum * 10) + (*fmt - '0');
fmt++; fmtLen--;
}
index = INT_MAX;
else
index = -(index + 1);
- } else if (!end && index < 0)
+ } else if (index < 0)
index = -INT_MAX;
/* Free the old internal repr and set the new one. */
Jim_FreeIntRep(interp, objPtr);
"Got floating-point value where integer was expected", -1);
error = 1;
goto err;
- break;
case JIM_EXPROP_ADD: dC = dA + dB; break;
case JIM_EXPROP_SUB: dC = dA-dB; break;
case JIM_EXPROP_MUL: dC = dA*dB; break;
case JIM_EXPROP_GT: dC = dA > dB; break;
case JIM_EXPROP_LTE: dC = dA <= dB; break;
case JIM_EXPROP_GTE: dC = dA >= dB; break;
+ /* FIXME comparing floats for equality/inequality is bad juju */
case JIM_EXPROP_NUMEQ: dC = dA == dB; break;
case JIM_EXPROP_NUMNE: dC = dA != dB; break;
case JIM_EXPROP_LOGICAND_LEFT:
Jim_GetWide(interp, objPtr, &wideValueB) != JIM_OK)
{
Jim_DecrRefCount(interp, varAObjPtr);
- if (varBObjPtr)
- Jim_DecrRefCount(interp, varBObjPtr);
+ Jim_DecrRefCount(interp, varBObjPtr);
goto noopt;
}
}