diff options
| author | dgp@users.sourceforge.net <dgp> | 2005-04-21 21:23:54 (GMT) |
|---|---|---|
| committer | dgp@users.sourceforge.net <dgp> | 2005-04-21 21:23:54 (GMT) |
| commit | 6015b7ab65fdf4359f7b7d1590c656dc66322ca7 (patch) | |
| tree | 0eeb5dc7ec0a497ed05606eaaa34b74c679b505d /generic/tclBasic.c | |
| parent | 5ac62d29f1ae8f5a71a654a6958ee5cc2a2565f6 (diff) | |
| download | tcl-6015b7ab65fdf4359f7b7d1590c656dc66322ca7.zip tcl-6015b7ab65fdf4359f7b7d1590c656dc66322ca7.tar.gz tcl-6015b7ab65fdf4359f7b7d1590c656dc66322ca7.tar.bz2 | |
* generic/tclBasic.c: Updated callers to call new routine.
* generic/tclCompCmds.c: Updated callers to call new routine.
Diffstat (limited to 'generic/tclBasic.c')
| -rw-r--r-- | generic/tclBasic.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 17da494..43a0a2a 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.145 2005/04/19 16:32:53 dgp Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.146 2005/04/21 21:24:03 dgp Exp $ */ #include "tclInt.h" @@ -4042,20 +4042,7 @@ Tcl_ExprBoolean(interp, string, ptr) /* * Store a boolean based on the expression result. */ - - if (resultPtr->typePtr == &tclIntType) { - *ptr = (resultPtr->internalRep.longValue != 0); - } else if (resultPtr->typePtr == &tclDoubleType) { - *ptr = (resultPtr->internalRep.doubleValue != 0.0); - } else if (resultPtr->typePtr == &tclWideIntType) { -#ifndef TCL_WIDE_INT_IS_LONG - *ptr = (resultPtr->internalRep.wideValue != 0); -#else - *ptr = (resultPtr->internalRep.longValue != 0); -#endif - } else { - result = Tcl_GetBooleanFromObj(interp, resultPtr, ptr); - } + result = TclGetTruthValueFromObj(interp, resultPtr, ptr); Tcl_DecrRefCount(resultPtr); /* discard the result object */ } if (result != TCL_OK) { @@ -4165,13 +4152,7 @@ Tcl_ExprBooleanObj(interp, objPtr, ptr) result = Tcl_ExprObj(interp, objPtr, &resultPtr); if (result == TCL_OK) { - if (resultPtr->typePtr == &tclIntType) { - *ptr = (resultPtr->internalRep.longValue != 0); - } else if (resultPtr->typePtr == &tclDoubleType) { - *ptr = (resultPtr->internalRep.doubleValue != 0.0); - } else { - result = Tcl_GetBooleanFromObj(interp, resultPtr, ptr); - } + result = TclGetTruthValueFromObj(interp, resultPtr, ptr); Tcl_DecrRefCount(resultPtr); /* discard the result object */ } return result; |
