Skip to content

Commit

Permalink
Another round of int -> Tcl_Size changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Mar 7, 2024
1 parent 138756e commit 390585b
Show file tree
Hide file tree
Showing 20 changed files with 153 additions and 212 deletions.
8 changes: 4 additions & 4 deletions generic/tkBind.c
Expand Up @@ -734,7 +734,7 @@ static int GetVirtualEvent(Tcl_Interp *interp, VirtualEventTable *vetPtr,
Tcl_Obj *virtName);
static Tk_Uid GetVirtualEventUid(Tcl_Interp *interp, char *virtString);
static int HandleEventGenerate(Tcl_Interp *interp, Tk_Window main,
int objc, Tcl_Obj *const objv[]);
Tcl_Size objc, Tcl_Obj *const objv[]);
static void InitVirtualEventTable(VirtualEventTable *vetPtr);
static PatSeq * MatchPatterns(TkDisplay *dispPtr, Tk_BindingTable bindPtr, PSList *psList,
PSList *psSuccList, unsigned patIndex, const Event *eventPtr,
Expand Down Expand Up @@ -3896,7 +3896,7 @@ static int
HandleEventGenerate(
Tcl_Interp *interp, /* Interp for errors return and name lookup. */
Tk_Window mainWin, /* Main window associated with interp. */
int objc, /* Number of arguments. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
union { XEvent general; XVirtualEvent virt; } event;
Expand All @@ -3916,7 +3916,7 @@ HandleEventGenerate(
unsigned count;
unsigned flags;
int number;
unsigned i;
Tcl_Size i;

static const char *const fieldStrings[] = {
"-when", "-above", "-borderwidth", "-button",
Expand Down Expand Up @@ -4026,7 +4026,7 @@ HandleEventGenerate(
warp = 0;
pos = TCL_QUEUE_TAIL;

for (i = 2; i < (unsigned) objc; i += 2) {
for (i = 2; i < objc; i += 2) {
Tcl_Obj *optionPtr, *valuePtr;
#if defined(_MSC_VER)
/* Work around MSVC compiler optimization bug, see [d93c8175fd]. */
Expand Down
8 changes: 4 additions & 4 deletions generic/tkBusy.c
Expand Up @@ -43,7 +43,7 @@ static void BusyGeometryProc(void *clientData,
static void BusyCustodyProc(void *clientData,
Tk_Window tkwin);
static int ConfigureBusy(Tcl_Interp *interp, Busy *busyPtr,
int objc, Tcl_Obj *const objv[]);
Tcl_Size objc, Tcl_Obj *const objv[]);
static Busy * CreateBusy(Tcl_Interp *interp, Tk_Window tkRef);
static Tcl_FreeProc DestroyBusy;
static void DoConfigureNotify(Tk_FakeWin *winPtr);
Expand All @@ -53,7 +53,7 @@ static Busy * GetBusy(Tcl_Interp *interp,
Tcl_Obj *const windowObj);
static int HoldBusy(Tcl_HashTable *busyTablePtr,
Tcl_Interp *interp, Tcl_Obj *const windowObj,
int configObjc, Tcl_Obj *const configObjv[]);
Tcl_Size configObjc, Tcl_Obj *const configObjv[]);
static void MakeTransparentWindowExist(Tk_Window tkwin,
Window parent);
static inline Tk_Window NextChild(Tk_Window tkwin);
Expand Down Expand Up @@ -640,7 +640,7 @@ static int
ConfigureBusy(
Tcl_Interp *interp,
Busy *busyPtr,
int objc,
Tcl_Size objc,
Tcl_Obj *const objv[])
{
Tk_Cursor oldCursor = busyPtr->cursor;
Expand Down Expand Up @@ -731,7 +731,7 @@ HoldBusy(
Tcl_HashTable *busyTablePtr,/* Busy hash table. */
Tcl_Interp *interp, /* Interpreter to report errors to. */
Tcl_Obj *const windowObj, /* Window name. */
int configObjc, /* Option pairs. */
Tcl_Size configObjc, /* Option pairs. */
Tcl_Obj *const configObjv[])
{
Tk_Window tkwin;
Expand Down
12 changes: 5 additions & 7 deletions generic/tkButton.c
Expand Up @@ -514,7 +514,7 @@ static const enum command map[][8] = {

static void ButtonCmdDeletedProc(void *clientData);
static int ButtonCreate(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], int type);
static void ButtonEventProc(void *clientData,
XEvent *eventPtr);
Expand All @@ -533,11 +533,9 @@ static char * ButtonTextVarProc(void *clientData,
static char * ButtonVarProc(void *clientData,
Tcl_Interp *interp, const char *name1,
const char *name2, int flags);
static int ButtonWidgetObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc ButtonWidgetObjCmd;
static int ConfigureButton(Tcl_Interp *interp, TkButton *butPtr,
int objc, Tcl_Obj *const objv[]);
Tcl_Size objc, Tcl_Obj *const objv[]);
static void DestroyButton(TkButton *butPtr);

/*
Expand Down Expand Up @@ -621,7 +619,7 @@ static int
ButtonCreate(
TCL_UNUSED(void *), /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument values. */
int type) /* Type of button to create: TYPE_LABEL,
* TYPE_BUTTON, TYPE_CHECK_BUTTON, or
Expand Down Expand Up @@ -1029,7 +1027,7 @@ ConfigureButton(
Tcl_Interp *interp, /* Used for error reporting. */
TkButton *butPtr, /* Information about widget; may or may
* not already have values for some fields. */
int objc, /* Number of arguments. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
Tk_SavedOptions savedOptions;
Expand Down
6 changes: 2 additions & 4 deletions generic/tkConsole.c
Expand Up @@ -51,15 +51,13 @@ static int ConsoleHandle(void *instanceData, int direction,
void **handlePtr);
static int ConsoleInput(void *instanceData, char *buf, int toRead,
int *errorCode);
static int ConsoleObjCmd(void *clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc ConsoleObjCmd;
static int ConsoleOutput(void *instanceData, const char *buf,
int toWrite, int *errorCode);
static void ConsoleWatch(void *instanceData, int mask);
static void DeleteConsoleInterp(void *clientData);
static void InterpDeleteProc(void *clientData, Tcl_Interp *interp);
static int InterpreterObjCmd(void *clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc InterpreterObjCmd;

/*
* This structure describes the channel type structure for file based IO:
Expand Down
28 changes: 12 additions & 16 deletions generic/tkEntry.c
Expand Up @@ -406,7 +406,7 @@ static const char *const selElementNames[] = {
*/

static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr,
int objc, Tcl_Obj *const objv[]);
Tcl_Size objc, Tcl_Obj *const objv[]);
static int DeleteChars(Entry *entryPtr, Tcl_Size index, Tcl_Size count);
static Tcl_FreeProc DestroyEntry;
static void DisplayEntry(void *clientData);
Expand Down Expand Up @@ -437,9 +437,7 @@ static int EntryValueChanged(Entry *entryPtr,
const char *newValue);
static void EntryVisibleRange(Entry *entryPtr,
double *firstPtr, double *lastPtr);
static int EntryWidgetObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc EntryWidgetObjCmd;
static void EntryWorldChanged(void *instanceData);
static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr,
Tcl_Obj *indexObj, Tcl_Size *indexPtr);
Expand All @@ -449,9 +447,7 @@ static int InsertChars(Entry *entryPtr, Tcl_Size index, const char *string);
* These forward declarations are the spinbox specific ones:
*/

static int SpinboxWidgetObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc SpinboxWidgetObjCmd;
static int GetSpinboxElement(Spinbox *sbPtr, int x, int y);
static int SpinboxInvoke(Tcl_Interp *interp, Spinbox *sbPtr,
int element);
Expand Down Expand Up @@ -1051,7 +1047,7 @@ DestroyEntry(
* Tk_FreeOptions handle all the standard option-related stuff.
*/

ckfree((char *)entryPtr->string);
ckfree((void *)entryPtr->string);
if (entryPtr->textVarName != NULL) {
Tcl_UntraceVar2(entryPtr->interp, entryPtr->textVarName,
NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
Expand All @@ -1066,7 +1062,7 @@ DestroyEntry(
}
Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler);
if (entryPtr->displayString != entryPtr->string) {
ckfree((char *)entryPtr->displayString);
ckfree((void *)entryPtr->displayString);
}
if (entryPtr->type == TK_SPINBOX) {
Spinbox *sbPtr = (Spinbox *) entryPtr;
Expand Down Expand Up @@ -1113,7 +1109,7 @@ ConfigureEntry(
Tcl_Interp *interp, /* Used for error reporting. */
Entry *entryPtr, /* Information about widget; may or may not
* already have values for some fields. */
int objc, /* Number of valid entries in argv. */
Tcl_Size objc, /* Number of valid entries in argv. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_SavedOptions savedOptions;
Expand Down Expand Up @@ -1400,7 +1396,7 @@ ConfigureEntry(
}
snprintf(sbPtr->formatBuf, formatSpace, sbPtr->valueFormat, dvalue);

/*
/*
* No check for error return here as well, because any possible
* error will be trapped below when attempting tracing.
*/
Expand Down Expand Up @@ -1980,7 +1976,7 @@ EntryComputeGeometry(
char *p;

if (entryPtr->displayString != entryPtr->string) {
ckfree((char *)entryPtr->displayString);
ckfree((void *)entryPtr->displayString);
entryPtr->displayString = entryPtr->string;
entryPtr->numDisplayBytes = entryPtr->numBytes;
}
Expand Down Expand Up @@ -2188,7 +2184,7 @@ InsertChars(
return TCL_OK;
}

ckfree((char *)string);
ckfree((void *)string);
entryPtr->string = newStr;

/*
Expand Down Expand Up @@ -2294,7 +2290,7 @@ DeleteChars(
}

ckfree(toDelete);
ckfree((char *)entryPtr->string);
ckfree((void *)entryPtr->string);
entryPtr->string = newStr;
entryPtr->numChars -= count;
entryPtr->numBytes -= byteCount;
Expand Down Expand Up @@ -2484,13 +2480,13 @@ EntrySetValue(

if (entryPtr->flags & VALIDATE_ABORT) {
entryPtr->flags &= ~VALIDATE_ABORT;
ckfree((char *)value);
ckfree((void *)value);
return;
}
}

oldSource = entryPtr->string;
ckfree((char *)entryPtr->string);
ckfree((void *)entryPtr->string);

if (malloced) {
entryPtr->string = value;
Expand Down
20 changes: 9 additions & 11 deletions generic/tkFrame.c
Expand Up @@ -328,9 +328,9 @@ static const Tk_OptionSpec *const optionSpecs[] = {

static void ComputeFrameGeometry(Frame *framePtr);
static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr,
int objc, Tcl_Obj *const objv[]);
Tcl_Size objc, Tcl_Obj *const objv[]);
static int CreateFrame(void *clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[],
Tcl_Size objc, Tcl_Obj *const objv[],
enum FrameType type, const char *appName);
static Tcl_FreeProc DestroyFrame;
static void DestroyFramePartly(Frame *framePtr);
Expand All @@ -350,9 +350,7 @@ static void FrameRequestProc(void *clientData,
Tk_Window tkwin);
static void FrameStructureProc(void *clientData,
XEvent *eventPtr);
static int FrameWidgetObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc FrameWidgetObjCmd;
static void FrameWorldChanged(void *instanceData);
static void MapFrame(void *clientData);

Expand Down Expand Up @@ -504,7 +502,7 @@ static int
CreateFrame(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument objects. */
enum FrameType type, /* What widget type to create. */
const char *appName) /* Should only be non-NULL if there are no
Expand All @@ -518,8 +516,8 @@ CreateFrame(
Tk_Window newWin;
const char *className, *screenName, *visualName, *colormapName;
const char *arg, *useOption;
int i, depth;
Tcl_Size length;
int depth;
Tcl_Size i, length;
unsigned int mask;
Colormap colormap;
Visual *visual;
Expand Down Expand Up @@ -774,8 +772,8 @@ FrameWidgetObjCmd(
};
Frame *framePtr = (Frame *)clientData;
int result = TCL_OK, index;
int c, i;
Tcl_Size length;
int c;
Tcl_Size i, length;
Tcl_Obj *objPtr;

if (objc < 2) {
Expand Down Expand Up @@ -982,7 +980,7 @@ ConfigureFrame(
Tcl_Interp *interp, /* Used for error reporting. */
Frame *framePtr, /* Information about widget; may or may not
* already have values for some fields. */
int objc, /* Number of valid entries in objv. */
Tcl_Size objc, /* Number of valid entries in objv. */
Tcl_Obj *const objv[]) /* Arguments. */
{
Tk_SavedOptions savedOptions;
Expand Down

0 comments on commit 390585b

Please sign in to comment.