Skip to content

Commit

Permalink
Still more int -> Tcl_Size
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Apr 25, 2023
1 parent 972e5c5 commit 5ff6c68
Show file tree
Hide file tree
Showing 26 changed files with 162 additions and 157 deletions.
2 changes: 1 addition & 1 deletion doc/GetScroll.3
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int
.AS "Tcl_Interp" *fractionPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
.AP int objc in
.AP Tcl_Size objc in
Number of Tcl_Obj's in \fIobjv\fR array.
.AP "Tcl_Obj *const *" objv in
Argument objects. These represent the entire widget command, of
Expand Down
2 changes: 1 addition & 1 deletion doc/SetOptions.3
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ For options such as \fBTK_OPTION_COLOR\fR, this argument indicates
the window in which the option will be used. If \fIoptionTable\fR uses
no window-dependent options, then a NULL value may be supplied for
this argument.
.AP int objc in
.AP Tcl_Size objc in
Number of values in \fIobjv\fR.
.AP Tcl_Obj "*const *objv" in
Command-line arguments for setting configuring options.
Expand Down
4 changes: 2 additions & 2 deletions generic/tkCanvArc.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ ArcCoords(
return TCL_ERROR;
} else if (objc != 4) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 4, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 4, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "ARC",
NULL);
return TCL_ERROR;
Expand Down Expand Up @@ -404,7 +404,7 @@ ArcCoords(
ComputeArcBbox(canvas, arcPtr);
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 0 or 4, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 0 or 4, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "ARC", NULL);
return TCL_ERROR;
}
Expand Down
4 changes: 2 additions & 2 deletions generic/tkCanvBmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ BitmapCoords(
return TCL_ERROR;
} else if (objc != 2) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 2, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 2, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "BITMAP",
NULL);
return TCL_ERROR;
Expand All @@ -278,7 +278,7 @@ BitmapCoords(
ComputeBitmapBbox(canvas, bmapPtr);
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 0 or 2, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 0 or 2, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "BITMAP", NULL);
return TCL_ERROR;
}
Expand Down
4 changes: 2 additions & 2 deletions generic/tkCanvImg.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ ImageCoords(
return TCL_ERROR;
} else if (objc != 2) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 2, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 2, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "IMAGE",
NULL);
return TCL_ERROR;
Expand All @@ -262,7 +262,7 @@ ImageCoords(
ComputeImageBbox(canvas, imgPtr);
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 0 or 2, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 0 or 2, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "IMAGE", NULL);
return TCL_ERROR;
}
Expand Down
4 changes: 2 additions & 2 deletions generic/tkCanvLine.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ LineCoords(
}
if (objc & 1) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected an even number, got %" TKSIZET_MODIFIER "u",
"wrong # coordinates: expected an even number, got %" TCL_SIZE_MODIFIER "u",
objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "LINE", NULL);
return TCL_ERROR;
} else if (objc < 4) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected at least 4, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected at least 4, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "LINE", NULL);
return TCL_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion generic/tkCanvPoly.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ PolygonCoords(
}
if (objc & 1) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected an even number, got %" TKSIZET_MODIFIER "u",
"wrong # coordinates: expected an even number, got %" TCL_SIZE_MODIFIER "u",
objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "POLYGON", NULL);
return TCL_ERROR;
Expand Down
4 changes: 2 additions & 2 deletions generic/tkCanvText.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ TextCoords(
return TCL_OK;
} else if (objc > 2) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 0 or 2, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 0 or 2, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "TEXT", NULL);
return TCL_ERROR;
}
Expand All @@ -444,7 +444,7 @@ TextCoords(
return TCL_ERROR;
} else if (objc != 2) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 2, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 2, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "TEXT", NULL);
return TCL_ERROR;
}
Expand Down
4 changes: 2 additions & 2 deletions generic/tkCanvWind.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ WinItemCoords(
return TCL_ERROR;
} else if (objc != 2) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 2, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 2, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "WINDOW",
NULL);
return TCL_ERROR;
Expand All @@ -275,7 +275,7 @@ WinItemCoords(
ComputeWindowBbox(canvas, winItemPtr);
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 0 or 2, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 0 or 2, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "WINDOW", NULL);
return TCL_ERROR;
}
Expand Down
7 changes: 3 additions & 4 deletions generic/tkCmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,12 @@ AppnameCmd(

winPtr = (TkWindow *) tkwin;

if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?newName?");
return TCL_ERROR;
}
if (objc == 2) {
string = Tcl_GetString(objv[1]);
winPtr->nameUid = Tk_GetUid(Tk_SetAppName(tkwin, string));
} else if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, "?newName?");
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewStringObj(winPtr->nameUid, TCL_INDEX_NONE));
return TCL_OK;
Expand Down
6 changes: 2 additions & 4 deletions generic/tkInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@
# define TCL_LL_MODIFIER "ll"
#endif

#if TCL_MAJOR_VERSION > 8
# define TKSIZET_MODIFIER TCL_Z_MODIFIER
#else
# define TKSIZET_MODIFIER ""
#if !defined(TCL_SIZE_MODIFIER)
# define TCL_SIZE_MODIFIER ""
#endif

/*
Expand Down
2 changes: 1 addition & 1 deletion generic/tkRectOval.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ RectOvalCoords(

if (objc != 4) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"wrong # coordinates: expected 0 or 4, got %" TKSIZET_MODIFIER "u", objc));
"wrong # coordinates: expected 0 or 4, got %" TCL_SIZE_MODIFIER "u", objc));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS",
(rectOvalPtr->header.typePtr == &tkRectangleType
? "RECTANGLE" : "OVAL"), NULL);
Expand Down
2 changes: 1 addition & 1 deletion generic/tkSelect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ HandleTclCommand(
* the offset and maximum # of bytes.
*/

command = Tcl_ObjPrintf("%s %" TKSIZET_MODIFIER "u %" TKSIZET_MODIFIER "u",
command = Tcl_ObjPrintf("%s %" TCL_SIZE_MODIFIER "u %" TCL_SIZE_MODIFIER "u",
cmdInfoPtr->command, charOffset, maxBytes);
Tcl_IncrRefCount(command);

Expand Down
2 changes: 1 addition & 1 deletion generic/tkText.c
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ TextPushUndoAction(
Tcl_NewStringObj("set", 3));
markSetRUndoMarkCmdObj = Tcl_DuplicateObj(markSetLUndoMarkCmdObj);
textPtr->sharedTextPtr->undoMarkId++;
snprintf(stringUndoMarkId, TCL_INTEGER_SPACE, "%" TKSIZET_MODIFIER "u", textPtr->sharedTextPtr->undoMarkId);
snprintf(stringUndoMarkId, TCL_INTEGER_SPACE, "%" TCL_SIZE_MODIFIER "u", textPtr->sharedTextPtr->undoMarkId);
strcat(lMarkName, stringUndoMarkId);
strcat(rMarkName, stringUndoMarkId);
Tcl_ListObjAppendElement(NULL, markSetLUndoMarkCmdObj,
Expand Down
6 changes: 3 additions & 3 deletions generic/ttk/ttkButton.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static int ButtonConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
*/
static int
ButtonInvokeCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Button *buttonPtr = (Button *)recordPtr;
if (objc > 2) {
Expand Down Expand Up @@ -547,7 +547,7 @@ CheckbuttonPostConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
*/
static int
CheckbuttonInvokeCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Checkbutton *checkPtr = (Checkbutton *)recordPtr;
WidgetCore *corePtr = &checkPtr->core;
Expand Down Expand Up @@ -735,7 +735,7 @@ RadiobuttonPostConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
*/
static int
RadiobuttonInvokeCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Radiobutton *radioPtr = (Radiobutton *)recordPtr;
WidgetCore *corePtr = &radioPtr->core;
Expand Down
26 changes: 13 additions & 13 deletions generic/ttk/ttkEntry.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ EntryIndex(
*/
static int
EntryBBoxCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
Ttk_Box b;
Expand Down Expand Up @@ -1506,7 +1506,7 @@ EntryBBoxCommand(
*/
static int
EntryDeleteCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
Tcl_Size first, last;
Expand Down Expand Up @@ -1535,7 +1535,7 @@ EntryDeleteCommand(
*/
static int
EntryGetCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
if (objc != 2) {
Expand All @@ -1551,7 +1551,7 @@ EntryGetCommand(
*/
static int
EntryICursorCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
if (objc != 3) {
Expand All @@ -1571,7 +1571,7 @@ EntryICursorCommand(
*/
static int
EntryIndexCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
Tcl_Size index;
Expand All @@ -1593,7 +1593,7 @@ EntryIndexCommand(
*/
static int
EntryInsertCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
Tcl_Size index;
Expand All @@ -1615,7 +1615,7 @@ EntryInsertCommand(
* Clear selection.
*/
static int EntrySelectionClearCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;

Expand All @@ -1632,7 +1632,7 @@ static int EntrySelectionClearCommand(
* Returns 1 if any characters are selected, 0 otherwise.
*/
static int EntrySelectionPresentCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
if (objc != 3) {
Expand All @@ -1648,7 +1648,7 @@ static int EntrySelectionPresentCommand(
* Explicitly set the selection range.
*/
static int EntrySelectionRangeCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
Tcl_Size start, end;
Expand Down Expand Up @@ -1686,7 +1686,7 @@ static const Ttk_Ensemble EntrySelectionCommands[] = {
* Sets the value of an entry widget.
*/
static int EntrySetCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
if (objc != 3) {
Expand All @@ -1702,7 +1702,7 @@ static int EntrySetCommand(
* or error status from -validatecommand / -invalidcommand.
*/
static int EntryValidateCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
int code;
Expand All @@ -1724,7 +1724,7 @@ static int EntryValidateCommand(
/* $entry xview -- horizontal scrolling interface
*/
static int EntryXViewCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Entry *entryPtr = (Entry *)recordPtr;
if (objc == 3) {
Expand Down Expand Up @@ -1843,7 +1843,7 @@ ComboboxConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
* in sync at all times, [$cb current] double-checks
*/
static int ComboboxCurrentCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
Combobox *cbPtr = (Combobox *)recordPtr;
Tcl_Size currentIndex = cbPtr->combobox.currentIndex;
Expand Down
Loading

0 comments on commit 5ff6c68

Please sign in to comment.