diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-02-04 22:46:56 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-02-04 22:46:56 (GMT) |
| commit | d50da922b1c1a3043e6ee9f24282a638ee143b48 (patch) | |
| tree | 937d8b4d10f30a85b1657a2af519b72b243bd63e /generic/tclBasic.c | |
| parent | 795fcf4f08882df1123a1ab6228a6cdf31fbb3eb (diff) | |
| parent | 73b6b4eab6a4b0a4ecf0f0c6bcf00bd815c34dd5 (diff) | |
| download | tcl-d50da922b1c1a3043e6ee9f24282a638ee143b48.zip tcl-d50da922b1c1a3043e6ee9f24282a638ee143b48.tar.gz tcl-d50da922b1c1a3043e6ee9f24282a638ee143b48.tar.bz2 | |
merge 8.7
Diffstat (limited to 'generic/tclBasic.c')
| -rw-r--r-- | generic/tclBasic.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 644b54b..c560633 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -1058,11 +1058,11 @@ Tcl_CreateInterp(void) TCL_GLOBAL_ONLY); Tcl_SetVar2Ex(interp, "tcl_platform", "wordSize", - Tcl_NewLongObj((long) sizeof(long)), TCL_GLOBAL_ONLY); + Tcl_NewWideIntObj(sizeof(long)), TCL_GLOBAL_ONLY); /* TIP #291 */ Tcl_SetVar2Ex(interp, "tcl_platform", "pointerSize", - Tcl_NewLongObj((long) sizeof(void *)), TCL_GLOBAL_ONLY); + Tcl_NewWideIntObj(sizeof(void *)), TCL_GLOBAL_ONLY); /* * Set up other variables such as tcl_version and tcl_library @@ -2747,7 +2747,7 @@ TclInvokeStringCommand( Command *cmdPtr = clientData; int i, result; const char **argv = - TclStackAlloc(interp, (unsigned)(objc + 1) * sizeof(char *)); + TclStackAlloc(interp, (objc + 1) * sizeof(char *)); for (i = 0; i < objc; i++) { argv[i] = TclGetString(objv[i]); @@ -2776,7 +2776,7 @@ TclInvokeStringCommand( * in the Command structure. * * Results: - * A standard Tcl string result value. + * A standard Tcl result value. * * Side effects: * Besides those side effects of the called Tcl_ObjCmdProc, @@ -2796,7 +2796,7 @@ TclInvokeObjectCommand( Tcl_Obj *objPtr; int i, length, result; Tcl_Obj **objv = - TclStackAlloc(interp, (unsigned)(argc * sizeof(Tcl_Obj *))); + TclStackAlloc(interp, (argc * sizeof(Tcl_Obj *))); for (i = 0; i < argc; i++) { length = strlen(argv[i]); @@ -3870,7 +3870,7 @@ OldMathFuncProc( #ifdef ACCEPT_NAN if (result != TCL_OK) { const Tcl_ObjIntRep *irPtr - = Tcl_FetchIntRep(valuePtr, &tclDoubleType); + = TclFetchIntRep(valuePtr, &tclDoubleType); if (irPtr) { d = irPtr->doubleValue; @@ -4976,7 +4976,7 @@ TEOV_NotFound( Tcl_ListObjGetElements(NULL, currNsPtr->unknownHandlerPtr, &handlerObjc, &handlerObjv); newObjc = objc + handlerObjc; - newObjv = TclStackAlloc(interp, (int) sizeof(Tcl_Obj *) * newObjc); + newObjv = TclStackAlloc(interp, sizeof(Tcl_Obj *) * newObjc); /* * Copy command prefix from unknown handler and add on the real command's @@ -4988,7 +4988,7 @@ TEOV_NotFound( newObjv[i] = handlerObjv[i]; Tcl_IncrRefCount(newObjv[i]); } - memcpy(newObjv+handlerObjc, objv, sizeof(Tcl_Obj *) * (unsigned)objc); + memcpy(newObjv+handlerObjc, objv, sizeof(Tcl_Obj *) * objc); /* * Look up and invoke the handler (by recursive call to this function). If @@ -7021,7 +7021,7 @@ Tcl_ExprString( * An empty string. Just set the interpreter's result to 0. */ - Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0)); } else { Tcl_Obj *resultPtr, *exprObj = Tcl_NewStringObj(expr, -1); @@ -7435,7 +7435,7 @@ ExprCeilFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); if (irPtr) { Tcl_SetObjResult(interp, objv[1]); @@ -7475,7 +7475,7 @@ ExprFloorFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); if (irPtr) { Tcl_SetObjResult(interp, objv[1]); @@ -7615,7 +7615,7 @@ ExprSqrtFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); if (irPtr) { Tcl_SetObjResult(interp, objv[1]); @@ -7662,7 +7662,7 @@ ExprUnaryFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); if (irPtr) { d = irPtr->doubleValue; @@ -7726,7 +7726,7 @@ ExprBinaryFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d1); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); if (irPtr) { d1 = irPtr->doubleValue; @@ -7741,7 +7741,7 @@ ExprBinaryFunc( code = Tcl_GetDoubleFromObj(interp, objv[2], &d2); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); if (irPtr) { d2 = irPtr->doubleValue; @@ -7790,7 +7790,7 @@ ExprAbsFunc( while (numBytes) { if (*bytes == '-') { - Tcl_SetObjResult(interp, Tcl_NewLongObj(0)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0)); return TCL_OK; } bytes++; numBytes--; @@ -7889,7 +7889,7 @@ ExprDoubleFunc( } if (Tcl_GetDoubleFromObj(interp, objv[1], &dResult) != TCL_OK) { #ifdef ACCEPT_NAN - if (Tcl_FetchIntRep(objv[1], &tclDoubleType)) { + if (objv[1]->typePtr == &tclDoubleType) { Tcl_SetObjResult(interp, objv[1]); return TCL_OK; } @@ -8155,7 +8155,7 @@ ExprRoundFunc( if (type == TCL_NUMBER_DOUBLE) { double fractPart, intPart; - long max = LONG_MAX, min = LONG_MIN; + Tcl_WideInt max = WIDE_MAX, min = WIDE_MIN; fractPart = modf(*((const double *) ptr), &intPart); if (fractPart <= -0.5) { @@ -8178,14 +8178,14 @@ ExprRoundFunc( Tcl_SetObjResult(interp, Tcl_NewBignumObj(&big)); return TCL_OK; } else { - long result = (long)intPart; + Tcl_WideInt result = (Tcl_WideInt)intPart; if (fractPart <= -0.5) { result--; } else if (fractPart >= 0.5) { result++; } - Tcl_SetObjResult(interp, Tcl_NewLongObj(result)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result)); return TCL_OK; } } |
