diff options
author | jan.nijtmans <jan.nijtmans@noemail.net> | 2013-04-23 10:39:33 (GMT) |
---|---|---|
committer | jan.nijtmans <jan.nijtmans@noemail.net> | 2013-04-23 10:39:33 (GMT) |
commit | ed72cbac2048816e5efeaf78919e7d4e479b6d2e (patch) | |
tree | 1bc0bc631c40f95af5a19d0b893abb7791875b17 /generic/tclObj.c | |
parent | c32c2187f7c4b81257f65a9319fb5ee4827eb8d4 (diff) | |
download | tcl-ed72cbac2048816e5efeaf78919e7d4e479b6d2e.zip tcl-ed72cbac2048816e5efeaf78919e7d4e479b6d2e.tar.gz tcl-ed72cbac2048816e5efeaf78919e7d4e479b6d2e.tar.bz2 |
Implement Tcl_NewBooleanObj, Tcl_DbNewBooleanObj and Tcl_SetBooleanObj as macros using Tcl_NewIntObj, Tcl_DbNewLongObj and Tcl_SetIntObj.
Starting with Tcl 8.5, this is exactly the same, it only eliminates code duplication.
FossilOrigin-Name: fee45978cb0c460ab763a4568312f445eb22b5d7
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r-- | generic/tclObj.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index 96a4082..fb09a9e 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -1700,14 +1700,14 @@ Tcl_InvalidateStringRep( *---------------------------------------------------------------------- */ -#ifdef TCL_MEM_DEBUG #undef Tcl_NewBooleanObj +#ifdef TCL_MEM_DEBUG Tcl_Obj * Tcl_NewBooleanObj( register int boolValue) /* Boolean used to initialize new object. */ { - return Tcl_DbNewBooleanObj(boolValue, "unknown", 0); + return Tcl_DbNewLongObj(boolValue!=0, "unknown", 0); } #else /* if not TCL_MEM_DEBUG */ @@ -1718,7 +1718,7 @@ Tcl_NewBooleanObj( { register Tcl_Obj *objPtr; - TclNewBooleanObj(objPtr, boolValue); + TclNewIntObj(objPtr, boolValue!=0); return objPtr; } #endif /* TCL_MEM_DEBUG */ @@ -1749,6 +1749,7 @@ Tcl_NewBooleanObj( *---------------------------------------------------------------------- */ +#undef Tcl_DbNewBooleanObj #ifdef TCL_MEM_DEBUG Tcl_Obj * @@ -1801,6 +1802,7 @@ Tcl_DbNewBooleanObj( *---------------------------------------------------------------------- */ +#undef Tcl_SetBooleanObj void Tcl_SetBooleanObj( register Tcl_Obj *objPtr, /* Object whose internal rep to init. */ @@ -1810,7 +1812,7 @@ Tcl_SetBooleanObj( Tcl_Panic("%s called with shared object", "Tcl_SetBooleanObj"); } - TclSetBooleanObj(objPtr, boolValue); + TclSetIntObj(objPtr, boolValue!=0); } /* |