if ((ret = mg_dsk_io_cmd(0, 1, mg_io_cmd_identify)) != ERROR_OK)
return ret;
- if ((ret = mg_dsk_wait(mg_io_wait_drq, MG_OEM_DISK_WAIT_TIME_NORMAL)) != ERROR_OK)
+ ret = mg_dsk_wait(mg_io_wait_drq, MG_OEM_DISK_WAIT_TIME_NORMAL);
+ if (ret != ERROR_OK)
return ret;
LOG_INFO("mflash: read drive info");
if (! mflash_bank->drv_info)
mflash_bank->drv_info = malloc(sizeof(struct mg_drv_info));
- target_read_memory(target, mg_buff, 2, sizeof(mg_io_type_drv_info) >> 1,
+ ret = target_read_memory(target, mg_buff, 2,
+ sizeof(mg_io_type_drv_info) >> 1,
(uint8_t *)&mflash_bank->drv_info->drv_id);
if (ret != ERROR_OK)
return ret;
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;
}
}
uint8_t *in_check_mask, int num_bits)
{
int retval = ERROR_OK;
-
- int compare_failed = 0;
+ int compare_failed;
if (in_check_mask)
compare_failed = buf_cmp_mask(captured, in_check_value, in_check_mask, num_bits);