diff options
author | dgp <dgp@users.sourceforge.net> | 2005-05-18 20:54:54 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2005-05-18 20:54:54 (GMT) |
commit | 4459bed11ee445f9e2a6f0263e2b93a31add3dfe (patch) | |
tree | f6520152938217e3e1b7c6844e04e8cd77c8c63b /generic/tclCmdMZ.c | |
parent | 50396dd2bcd7655741791d49bc4ba7a88fa5c2b9 (diff) | |
download | tcl-4459bed11ee445f9e2a6f0263e2b93a31add3dfe.zip tcl-4459bed11ee445f9e2a6f0263e2b93a31add3dfe.tar.gz tcl-4459bed11ee445f9e2a6f0263e2b93a31add3dfe.tar.bz2 |
* generic/tclBasic.c (Tcl_ExprBoolean): Rewrite as wrapper around
Tcl_ExprBooleanObj.
* generic/tclCmdMZ.c ([string is boolean/true/false]): Rewrite
dropping string-based Tcl_GetBoolean call, so that internal reps
are kept for subsequent quick boolean operations.
* generic/tclExecute.c: Dropped most special handling of the
"boolean" Tcl_ObjType, since that type should now be rarely
encountered.
* doc/BoolObj.3: Rewrite of documentation dropping many details
about the internals of Tcl_Objs. Shorter documentation focuses on
the function and use of the routines.
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 91e4b1e..5bc89c0 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.119 2005/05/11 00:51:28 hobbs Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.120 2005/05/18 20:55:04 dgp Exp $ */ #include "tclInt.h" @@ -1480,19 +1480,13 @@ Tcl_StringObjCmd(dummy, interp, objc, objv) case STR_IS_BOOL: case STR_IS_TRUE: case STR_IS_FALSE: - if (objPtr->typePtr == &tclBooleanType) { - if ((((enum isOptions) index == STR_IS_TRUE) && + if (TCL_OK != Tcl_ConvertToType(NULL, objPtr, + &tclBooleanType)) { + result = 0; + } else if ((((enum isOptions) index == STR_IS_TRUE) && objPtr->internalRep.longValue == 0) || (((enum isOptions) index == STR_IS_FALSE) && objPtr->internalRep.longValue != 0)) { - result = 0; - } - } else if ((Tcl_GetBoolean(NULL, string1, &i) - == TCL_ERROR) || - (((enum isOptions) index == STR_IS_TRUE) && - i == 0) || - (((enum isOptions) index == STR_IS_FALSE) && - i != 0)) { result = 0; } break; |