summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r--generic/tclObj.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c
index a06b8fd..5726596 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -341,12 +341,12 @@ typedef struct ResolvedCmdName {
* it's possible that the cmd's containing
* namespace was deleted and a new one created
* at the same address). */
- unsigned int refNsCmdEpoch; /* Value of the referencing namespace's
+ int refNsCmdEpoch; /* Value of the referencing namespace's
* cmdRefEpoch when the pointer was cached.
* Before using the cached pointer, we check
* if the namespace's epoch was incremented;
* if so, this cached pointer is invalid. */
- unsigned int cmdEpoch; /* Value of the command's cmdEpoch when this
+ int cmdEpoch; /* Value of the command's cmdEpoch when this
* pointer was cached. Before using the cached
* pointer, we check if the cmd's epoch was
* incremented; if so, the cmd was renamed,
@@ -387,7 +387,9 @@ TclInitObjSubsystem(void)
Tcl_RegisterObjType(&tclByteArrayType);
Tcl_RegisterObjType(&tclDoubleType);
+#if (TCL_UTF_MAX < 4) || !defined(TCL_NO_DEPRECATED)
Tcl_RegisterObjType(&tclStringType);
+#endif
Tcl_RegisterObjType(&tclListType);
Tcl_RegisterObjType(&tclDictType);
Tcl_RegisterObjType(&tclByteCodeType);
@@ -875,7 +877,7 @@ Tcl_AppendAllObjTypes(
* Get the test for a valid list out of the way first.
*/
- if (TclListObjLength(interp, objPtr, &numElems) != TCL_OK) {
+ if (TclListObjLengthM(interp, objPtr, &numElems) != TCL_OK) {
return TCL_ERROR;
}
@@ -2004,7 +2006,7 @@ Tcl_FreeInternalRep(
*
* This function is normally called when not debugging: i.e., when
* TCL_MEM_DEBUG is not defined. It creates a new Tcl_Obj and
- * initializes it from the argument boolean value. A nonzero "boolValue"
+ * initializes it from the argument boolean value. A nonzero "intValue"
* is coerced to 1.
*
* When TCL_MEM_DEBUG is defined, this function just returns the result
@@ -2025,20 +2027,20 @@ Tcl_FreeInternalRep(
Tcl_Obj *
Tcl_NewBooleanObj(
- int boolValue) /* Boolean used to initialize new object. */
+ int intValue) /* Boolean used to initialize new object. */
{
- return Tcl_DbNewWideIntObj(boolValue!=0, "unknown", 0);
+ return Tcl_DbNewWideIntObj(intValue!=0, "unknown", 0);
}
#else /* if not TCL_MEM_DEBUG */
Tcl_Obj *
Tcl_NewBooleanObj(
- int boolValue) /* Boolean used to initialize new object. */
+ int intValue) /* Boolean used to initialize new object. */
{
Tcl_Obj *objPtr;
- TclNewIntObj(objPtr, boolValue!=0);
+ TclNewIntObj(objPtr, intValue!=0);
return objPtr;
}
#endif /* TCL_MEM_DEBUG */
@@ -2075,7 +2077,7 @@ Tcl_NewBooleanObj(
Tcl_Obj *
Tcl_DbNewBooleanObj(
- int boolValue, /* Boolean used to initialize new object. */
+ int intValue, /* Boolean used to initialize new object. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
int line) /* Line number in the source file; used for
@@ -2087,7 +2089,7 @@ Tcl_DbNewBooleanObj(
/* Optimized TclInvalidateStringRep() */
objPtr->bytes = NULL;
- objPtr->internalRep.wideValue = (boolValue != 0);
+ objPtr->internalRep.wideValue = (intValue != 0);
objPtr->typePtr = &tclIntType;
return objPtr;
}
@@ -2096,11 +2098,11 @@ Tcl_DbNewBooleanObj(
Tcl_Obj *
Tcl_DbNewBooleanObj(
- int boolValue, /* Boolean used to initialize new object. */
+ int intValue, /* Boolean used to initialize new object. */
TCL_UNUSED(const char *) /*file*/,
TCL_UNUSED(int) /*line*/)
{
- return Tcl_NewBooleanObj(boolValue);
+ return Tcl_NewBooleanObj(intValue);
}
#endif /* TCL_MEM_DEBUG */
@@ -2110,7 +2112,7 @@ Tcl_DbNewBooleanObj(
* Tcl_SetBooleanObj --
*
* Modify an object to be a boolean object and to have the specified
- * boolean value. A nonzero "boolValue" is coerced to 1.
+ * boolean value. A nonzero "intValue" is coerced to 1.
*
* Results:
* None.
@@ -2126,13 +2128,13 @@ Tcl_DbNewBooleanObj(
void
Tcl_SetBooleanObj(
Tcl_Obj *objPtr, /* Object whose internal rep to init. */
- int boolValue) /* Boolean used to set object's value. */
+ int intValue) /* Boolean used to set object's value. */
{
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetBooleanObj");
}
- TclSetIntObj(objPtr, boolValue!=0);
+ TclSetIntObj(objPtr, intValue!=0);
}
#endif /* TCL_NO_DEPRECATED */
@@ -2159,15 +2161,15 @@ int
Tcl_GetBooleanFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr, /* The object from which to get boolean. */
- int *boolPtr) /* Place to store resulting boolean. */
+ int *intPtr) /* Place to store resulting boolean. */
{
do {
if (objPtr->typePtr == &tclIntType) {
- *boolPtr = (objPtr->internalRep.wideValue != 0);
+ *intPtr = (objPtr->internalRep.wideValue != 0);
return TCL_OK;
}
if (objPtr->typePtr == &tclBooleanType) {
- *boolPtr = objPtr->internalRep.longValue != 0;
+ *intPtr = objPtr->internalRep.longValue != 0;
return TCL_OK;
}
if (objPtr->typePtr == &tclDoubleType) {
@@ -2184,11 +2186,11 @@ Tcl_GetBooleanFromObj(
if (Tcl_GetDoubleFromObj(interp, objPtr, &d) != TCL_OK) {
return TCL_ERROR;
}
- *boolPtr = (d != 0.0);
+ *intPtr = (d != 0.0);
return TCL_OK;
}
if (objPtr->typePtr == &tclBignumType) {
- *boolPtr = 1;
+ *intPtr = 1;
return TCL_OK;
}
} while ((ParseBoolean(objPtr) == TCL_OK) || (TCL_OK ==
@@ -2674,7 +2676,7 @@ Tcl_Obj *
Tcl_NewIntObj(
int intValue) /* Int used to initialize the new object. */
{
- return Tcl_DbNewWideIntObj((long)intValue, "unknown", 0);
+ return Tcl_DbNewWideIntObj(intValue, "unknown", 0);
}
#else /* if not TCL_MEM_DEBUG */
@@ -2766,7 +2768,7 @@ Tcl_GetIntFromObj(
if ((ULONG_MAX > UINT_MAX) && ((l > UINT_MAX) || (l < INT_MIN))) {
if (interp != NULL) {
const char *s =
- "integer value too large to represent as non-long integer";
+ "integer value too large to represent";
Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1));
Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, NULL);
}