summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-10-14 14:38:11 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-10-14 14:38:11 (GMT)
commit067d863d12e2cd4addec751e34811347ee420091 (patch)
treeb18efa637a01799a54bf813dc65a535163f80aab
parenta341d14776f7362b59934c5f874380b68711ba16 (diff)
downloadtcl-067d863d12e2cd4addec751e34811347ee420091.zip
tcl-067d863d12e2cd4addec751e34811347ee420091.tar.gz
tcl-067d863d12e2cd4addec751e34811347ee420091.tar.bz2
removed another do {} while(0)
-rw-r--r--generic/tclExecute.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index ca92bcb..6705193 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.211 2005/10/14 14:18:45 kennykb Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.212 2005/10/14 14:38:11 kennykb Exp $
*/
#include "tclInt.h"
@@ -1148,7 +1148,7 @@ TclIncrObj(interp, valuePtr, incrPtr)
Tcl_AddErrorInfo(interp, "\n (reading increment)");
return TCL_ERROR;
}
- do {if ((type1 != TCL_NUMBER_BIG) && (type2 != TCL_NUMBER_BIG)) {
+ if ((type1 != TCL_NUMBER_BIG) && (type2 != TCL_NUMBER_BIG)) {
Tcl_WideInt w1, w2, sum;
TclGetWideIntFromObj(NULL, valuePtr, &w1);
TclGetWideIntFromObj(NULL, incrPtr, &w2);
@@ -1156,16 +1156,15 @@ TclIncrObj(interp, valuePtr, incrPtr)
#ifndef NO_WIDE_TYPE
if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE))
#endif
- {
- /* Check for overflow */
- if (((w1 < 0) && (w2 < 0) && (sum > 0))
- || ((w1 > 0) && (w2 > 0) && (sum < 0))) {
- break;
+ {
+ /* Check for overflow */
+ if ((w1 >= 0 || w2 >= 0 || sum < 0)
+ && (w1 < 0 || w2 < 0 || sum >= 0)) {
+ Tcl_SetWideIntObj(valuePtr, sum);
+ return TCL_OK;
+ }
}
- }
- Tcl_SetWideIntObj(valuePtr, sum);
- return TCL_OK;
- }} while (0);
+ }
Tcl_GetBignumAndClearObj(interp, valuePtr, &value);
Tcl_GetBignumFromObj(interp, incrPtr, &incr);