summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkPanedwindow.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-25 15:32:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-25 15:32:11 (GMT)
commitb686909c25b4ce6bac5b383885345d16a4a41ffd (patch)
tree76f3545ffd1a47aaf678965bc11467b680e9e29e /generic/ttk/ttkPanedwindow.c
parent4130f00f7b4fe4f5f25a463cf32a3fa08c1f4b1c (diff)
downloadtk-b686909c25b4ce6bac5b383885345d16a4a41ffd.zip
tk-b686909c25b4ce6bac5b383885345d16a4a41ffd.tar.gz
tk-b686909c25b4ce6bac5b383885345d16a4a41ffd.tar.bz2
Eliminate many (Tcl_Size) typecasts, which are no longer necessary
Diffstat (limited to 'generic/ttk/ttkPanedwindow.c')
-rw-r--r--generic/ttk/ttkPanedwindow.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c
index 55236b2..4e268d9 100644
--- a/generic/ttk/ttkPanedwindow.c
+++ b/generic/ttk/ttkPanedwindow.c
@@ -838,19 +838,19 @@ static int PanedSashposCommand(
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Paned *pw = (Paned *)recordPtr;
- int sashIndex, position = -1;
+ Tcl_WideInt sashIndex, position = -1;
Pane *pane;
if (objc < 3 || objc > 4) {
Tcl_WrongNumArgs(interp, 2,objv, "index ?newpos?");
return TCL_ERROR;
}
- if (Tcl_GetIntFromObj(interp, objv[2], &sashIndex) != TCL_OK) {
+ if (Tcl_GetWideIntFromObj(interp, objv[2], &sashIndex) != TCL_OK) {
return TCL_ERROR;
}
- if (sashIndex < 0 || (Tcl_Size)sashIndex + 1 >= Ttk_NumberContent(pw->paned.mgr)) {
+ if (sashIndex < 0 || sashIndex >= Ttk_NumberContent(pw->paned.mgr) - 1) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "sash index %d out of range", sashIndex));
+ "sash index %" TCL_SIZE_MODIFIER "d out of range", sashIndex));
Tcl_SetErrorCode(interp, "TTK", "PANE", "SASH_INDEX", NULL);
return TCL_ERROR;
}
@@ -863,7 +863,7 @@ static int PanedSashposCommand(
}
/* else -- set new sash position */
- if (Tcl_GetIntFromObj(interp, objv[3], &position) != TCL_OK) {
+ if (Tcl_GetWideIntFromObj(interp, objv[3], &position) != TCL_OK) {
return TCL_ERROR;
}