diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-11-12 17:01:32 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-11-12 17:01:32 (GMT) |
commit | 7c3be24178b151f0bb1e418d7608eb88cd8e9830 (patch) | |
tree | 8184b011f30f5b027a9ae080db41efb7712b7322 /generic/tclTestObj.c | |
parent | 65d7ec626d98c3b3143917119c49bd55c2c2bbe4 (diff) | |
download | tcl-7c3be24178b151f0bb1e418d7608eb88cd8e9830.zip tcl-7c3be24178b151f0bb1e418d7608eb88cd8e9830.tar.gz tcl-7c3be24178b151f0bb1e418d7608eb88cd8e9830.tar.bz2 |
Fix compiler warning (Tcl_Size != Tcl_WideInt)
Diffstat (limited to 'generic/tclTestObj.c')
-rw-r--r-- | generic/tclTestObj.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index e1836ec..8700c0d 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -1620,7 +1620,7 @@ TestbigdataCmd ( } idx; char *s; unsigned char *p; - Tcl_WideInt i, len, split; + Tcl_Size i, len, split; Tcl_DString ds; Tcl_Obj *objPtr; #define PATTERN_LEN 10 @@ -1638,11 +1638,11 @@ TestbigdataCmd ( if (objc == 2) { len = PATTERN_LEN; } else { - if (Tcl_GetWideIntFromObj(interp, objv[2], &len) != TCL_OK) { + if (Tcl_GetSizeIntFromObj(interp, objv[2], &len) != TCL_OK) { return TCL_ERROR; } if (objc == 4) { - if (Tcl_GetWideIntFromObj(interp, objv[3], &split) != TCL_OK) { + if (Tcl_GetSizeIntFromObj(interp, objv[3], &split) != TCL_OK) { return TCL_ERROR; } if (split >= len) { @@ -1651,13 +1651,12 @@ TestbigdataCmd ( } } /* Need one byte for nul terminator */ - Tcl_WideInt limit = - sizeof(Tcl_Size) == sizeof(Tcl_WideInt) ? WIDE_MAX-1 : INT_MAX-1; + Tcl_Size limit = TCL_SIZE_MAX-1; if (len < 0 || len > limit) { Tcl_SetObjResult( interp, Tcl_ObjPrintf( - "%s is greater than max permitted length %" TCL_LL_MODIFIER "d", + "%s is greater than max permitted length %" TCL_SIZE_MODIFIER "d", Tcl_GetString(objv[2]), limit)); return TCL_ERROR; @@ -1685,7 +1684,6 @@ TestbigdataCmd ( } if (split >= 0) { assert(split < len); - p[split] = 'X'; } Tcl_SetObjResult(interp, objPtr); break; |