summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r--generic/tclObj.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 92c6655..0ea5511 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -567,7 +567,7 @@ TclContinuationsEnter(
ThreadSpecificData *tsdPtr = TclGetContLineTable();
Tcl_HashEntry *hPtr =
Tcl_CreateHashEntry(tsdPtr->lineCLPtr, objPtr, &newEntry);
- ContLineLoc *clLocPtr = (ContLineLoc *)ckalloc(offsetof(ContLineLoc, loc) + (num + 1) *sizeof(int));
+ ContLineLoc *clLocPtr = (ContLineLoc *)ckalloc(offsetof(ContLineLoc, loc) + (num + 1U) *sizeof(int));
if (!newEntry) {
/*
@@ -2004,7 +2004,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 +2025,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 +2075,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 +2087,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 +2096,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 +2110,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 +2126,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 +2159,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 +2184,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 ==
@@ -2547,7 +2547,7 @@ Tcl_GetDoubleFromObj(
{
do {
if (objPtr->typePtr == &tclDoubleType) {
- if (TclIsNaN(objPtr->internalRep.doubleValue)) {
+ if (isnan(objPtr->internalRep.doubleValue)) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"floating point value is Not a Number", -1));
@@ -3054,7 +3054,7 @@ Tcl_GetLongFromObj(
if (w >= (Tcl_WideInt)(LONG_MIN)
&& w <= (Tcl_WideInt)(ULONG_MAX)) {
- *longPtr = (long) w;
+ *longPtr = (long)w;
return TCL_OK;
}
goto tooLarge;
@@ -3090,12 +3090,12 @@ Tcl_GetLongFromObj(
}
if (big.sign) {
if (value <= 1 + (unsigned long)LONG_MAX) {
- *longPtr = - (long) value;
+ *longPtr = (long)(-value);
return TCL_OK;
}
} else {
if (value <= (unsigned long)ULONG_MAX) {
- *longPtr = (long) value;
+ *longPtr = (long)value;
return TCL_OK;
}
}
@@ -3329,12 +3329,12 @@ Tcl_GetWideIntFromObj(
}
if (big.sign) {
if (value <= 1 + ~(Tcl_WideUInt)WIDE_MIN) {
- *wideIntPtr = - (Tcl_WideInt) value;
+ *wideIntPtr = (Tcl_WideInt)(-value);
return TCL_OK;
}
} else {
if (value <= (Tcl_WideUInt)WIDE_MAX) {
- *wideIntPtr = (Tcl_WideInt) value;
+ *wideIntPtr = (Tcl_WideInt)value;
return TCL_OK;
}
}
@@ -3800,7 +3800,7 @@ Tcl_SetBignumObj(
goto tooLargeForWide;
}
if (bignumValue->sign) {
- TclSetIntObj(objPtr, -(Tcl_WideInt)value);
+ TclSetIntObj(objPtr, (Tcl_WideInt)(-value));
} else {
TclSetIntObj(objPtr, (Tcl_WideInt)value);
}
@@ -3880,7 +3880,7 @@ TclGetNumberFromObj(
{
do {
if (objPtr->typePtr == &tclDoubleType) {
- if (TclIsNaN(objPtr->internalRep.doubleValue)) {
+ if (isnan(objPtr->internalRep.doubleValue)) {
*typePtr = TCL_NUMBER_NAN;
} else {
*typePtr = TCL_NUMBER_DOUBLE;