diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-10-31 14:03:09 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-10-31 14:03:09 (GMT) |
commit | 8ed8f1ee61efdf36fb596b1bf34dc5a2920e051a (patch) | |
tree | a1e7941b8dce1917a193364d1588182935cd99ec /generic/tkStyle.c | |
parent | dd7628898df08d691e1e52afb1b6a2943aaba572 (diff) | |
parent | 7f18fa84d8ebf555b4c1b1df0c826d33685dcb33 (diff) | |
download | tk-8ed8f1ee61efdf36fb596b1bf34dc5a2920e051a.zip tk-8ed8f1ee61efdf36fb596b1bf34dc5a2920e051a.tar.gz tk-8ed8f1ee61efdf36fb596b1bf34dc5a2920e051a.tar.bz2 |
Merge 8.6. Use Tcl_Size in (undocumented) Tk_GetStyledElement function
Diffstat (limited to 'generic/tkStyle.c')
-rw-r--r-- | generic/tkStyle.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tkStyle.c b/generic/tkStyle.c index 418f74f..2da67ae 100644 --- a/generic/tkStyle.c +++ b/generic/tkStyle.c @@ -99,7 +99,7 @@ typedef struct Element { */ typedef struct { - int nbInit; /* Number of calls to the init proc. */ + size_t nbInit; /* Number of calls to the init proc. */ Tcl_HashTable engineTable; /* Map a name to a style engine. Keys are * strings, values are Tk_StyleEngine * pointers. */ @@ -108,7 +108,7 @@ typedef struct { * fallback for all engines. */ Tcl_HashTable styleTable; /* Map a name to a style. Keys are strings, * values are Tk_Style pointers.*/ - int nbElements; /* Size of the below tables. */ + Tcl_Size nbElements; /* Size of the below tables. */ Tcl_HashTable elementTable; /* Map a name to an element Id. Keys are * strings, values are integer element IDs. */ Element *elements; /* Array of Elements. */ @@ -129,7 +129,7 @@ static void FreeStyleEngine(StyleEngine *enginePtr); static void FreeStyleObjProc(Tcl_Obj *objPtr); static void FreeWidgetSpec(StyledWidgetSpec *widgetSpecPtr); static StyledElement * GetStyledElement(StyleEngine *enginePtr, - int elementId); + Tcl_Size elementId); static StyledWidgetSpec*GetWidgetSpec(StyledElement *elementPtr, Tk_OptionTable optionTable); static void InitElement(Element *elementPtr, const char *name, @@ -240,7 +240,7 @@ TkStylePkgFree( Tcl_HashSearch search; Tcl_HashEntry *entryPtr; StyleEngine *enginePtr; - int i; + Tcl_Size i; tsdPtr->nbInit--; if (tsdPtr->nbInit != 0) { @@ -366,7 +366,7 @@ InitStyleEngine( { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - int elementId; + Tcl_Size elementId; if (name == NULL || *name == '\0') { /* @@ -421,7 +421,7 @@ FreeStyleEngine( { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - int elementId; + Tcl_Size elementId; /* * Free allocated elements. @@ -841,7 +841,7 @@ static StyledElement * GetStyledElement( StyleEngine *enginePtr, /* Style engine providing the implementation. * NULL means the default system engine. */ - int elementId) /* Unique element ID */ + Tcl_Size elementId) /* Unique element ID */ { StyledElement *elementPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) @@ -852,7 +852,7 @@ GetStyledElement( enginePtr = tsdPtr->defaultEnginePtr; } - while (elementId >= 0 && elementId < tsdPtr->nbElements) { + while (elementId != TCL_INDEX_NONE && elementId < tsdPtr->nbElements) { /* * Look for an implemented element through the engine chain. */ @@ -1035,7 +1035,7 @@ GetWidgetSpec( Tk_StyledElement Tk_GetStyledElement( Tk_Style style, /* The widget style. */ - int elementId, /* Unique element ID. */ + Tcl_Size elementId, /* Unique element ID. */ Tk_OptionTable optionTable) /* Option table for the widget. */ { Style *stylePtr = (Style *) style; |