diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-12-05 14:40:06 -0800 |
---|---|---|
committer | David Brownell <dbrownell@users.sourceforge.net> | 2009-12-05 14:40:06 -0800 |
commit | dd9d1a3459f7b38e2af99bdbafd322cacc9dacc2 (patch) | |
tree | 33219999ffbd1aa191ff1a5262364f962a9d60cd /src/helper | |
parent | 12b67a2b41557160b8daa23305cbc30a349588c1 (diff) | |
download | openocd_libswd-dd9d1a3459f7b38e2af99bdbafd322cacc9dacc2.tar.gz openocd_libswd-dd9d1a3459f7b38e2af99bdbafd322cacc9dacc2.tar.bz2 openocd_libswd-dd9d1a3459f7b38e2af99bdbafd322cacc9dacc2.tar.xz openocd_libswd-dd9d1a3459f7b38e2af99bdbafd322cacc9dacc2.zip |
misc code review updates
More updates from the code review by Steve Grubb <sgrubb@redhat.com>.
The Jim float-comparision bug just gets a comment not a fix, though.
Cc: Steve Grubb <sgrubb@redhat.com>.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/helper')
-rw-r--r-- | src/helper/jim.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/helper/jim.c b/src/helper/jim.c index 117ec56f..c04acf09 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -6077,7 +6077,7 @@ int SetIndexFromAny(Jim_Interp *interp, Jim_Obj *objPtr) 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); @@ -7063,7 +7063,6 @@ trydouble: "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; @@ -7071,6 +7070,7 @@ trydouble: 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: @@ -9889,8 +9889,7 @@ static int Jim_WhileCoreCommand(Jim_Interp *interp, int argc, Jim_GetWide(interp, objPtr, &wideValueB) != JIM_OK) { Jim_DecrRefCount(interp, varAObjPtr); - if (varBObjPtr) - Jim_DecrRefCount(interp, varBObjPtr); + Jim_DecrRefCount(interp, varBObjPtr); goto noopt; } } |