summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-04-23 10:39:33 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-04-23 10:39:33 (GMT)
commitcb37c28cf9df9a8ebdca318c7f03f697e5b5ee7d (patch)
tree1bc0bc631c40f95af5a19d0b893abb7791875b17 /generic/tclObj.c
parent9c56563bbe703e1bd7c267c6a43c8f62b978ae11 (diff)
downloadtcl-cb37c28cf9df9a8ebdca318c7f03f697e5b5ee7d.zip
tcl-cb37c28cf9df9a8ebdca318c7f03f697e5b5ee7d.tar.gz
tcl-cb37c28cf9df9a8ebdca318c7f03f697e5b5ee7d.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.
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r--generic/tclObj.c10
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);
}
/*