summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-25 20:35:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-25 20:35:50 (GMT)
commit39e505e32599e4cdb59d8a8f9949615cb2480d4e (patch)
treed9b8433dd66623de75099ebdb6d1b1112c48e4d7 /generic/ttk
parentdbeb7c8dd837efbd78d4a8d4e4114f349fda0dcb (diff)
parent295b02cdfbc034362af781b66d116e86198e8dd7 (diff)
downloadtk-39e505e32599e4cdb59d8a8f9949615cb2480d4e.zip
tk-39e505e32599e4cdb59d8a8f9949615cb2480d4e.tar.gz
tk-39e505e32599e4cdb59d8a8f9949615cb2480d4e.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/ttk')
-rw-r--r--generic/ttk/ttkTagSet.c21
-rw-r--r--generic/ttk/ttkWidget.h4
2 files changed, 13 insertions, 12 deletions
diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c
index 6ec68a6..5645325 100644
--- a/generic/ttk/ttkTagSet.c
+++ b/generic/ttk/ttkTagSet.c
@@ -12,7 +12,7 @@
* +++ Internal data structures.
*/
struct TtkTag {
- int priority; /* 1=>highest */
+ Tcl_Size priority; /* 1=>highest */
const char *tagName; /* Back-pointer to hash table entry */
void *tagRecord; /* User data */
};
@@ -21,8 +21,8 @@ struct TtkTagTable {
Tk_Window tkwin; /* owner window */
const Tk_OptionSpec *optionSpecs; /* ... */
Tk_OptionTable optionTable; /* ... */
- int recordSize; /* size of tag record */
- int nTags; /* #tags defined so far */
+ size_t recordSize; /* size of tag record */
+ Tcl_Size nTags; /* #tags defined so far */
Tcl_HashTable tags; /* defined tags */
};
@@ -53,7 +53,7 @@ static void DeleteTag(Ttk_TagTable tagTable, Ttk_Tag tag)
Ttk_TagTable Ttk_CreateTagTable(
Tcl_Interp *interp, Tk_Window tkwin,
- const Tk_OptionSpec *optionSpecs, int recordSize)
+ const Tk_OptionSpec *optionSpecs, size_t recordSize)
{
Ttk_TagTable tagTable = (Ttk_TagTable)ckalloc(sizeof(*tagTable));
tagTable->tkwin = tkwin;
@@ -155,7 +155,7 @@ Ttk_TagSet Ttk_GetTagSetFromObj(
Tcl_Obj *Ttk_NewTagSetObj(Ttk_TagSet tagset)
{
Tcl_Obj *result = Tcl_NewListObj(0,0);
- int i;
+ Tcl_Size i;
for (i = 0; i < tagset->nTags; ++i) {
Tcl_ListObjAppendElement(
@@ -174,7 +174,7 @@ void Ttk_FreeTagSet(Ttk_TagSet tagset)
*/
int Ttk_TagSetContains(Ttk_TagSet tagset, Ttk_Tag tag)
{
- int i;
+ Tcl_Size i;
for (i = 0; i < tagset->nTags; ++i) {
if (tagset->tags[i] == tag) {
return 1;
@@ -190,7 +190,7 @@ int Ttk_TagSetContains(Ttk_TagSet tagset, Ttk_Tag tag)
*/
int Ttk_TagSetAdd(Ttk_TagSet tagset, Ttk_Tag tag)
{
- int i;
+ Tcl_Size i;
for (i = 0; i < tagset->nTags; ++i) {
if (tagset->tags[i] == tag) {
return 0;
@@ -209,7 +209,8 @@ int Ttk_TagSetAdd(Ttk_TagSet tagset, Ttk_Tag tag)
*/
int Ttk_TagSetAddSet(Ttk_TagSet tagset, Ttk_TagSet tagsetFrom)
{
- int i, j, result = 0, found, total, nTags = tagset->nTags;
+ Tcl_Size i, j, total, nTags = tagset->nTags;
+ int result = 0, found;
Ttk_Tag tag;
total = tagsetFrom->nTags + tagset->nTags;
@@ -238,7 +239,7 @@ int Ttk_TagSetAddSet(Ttk_TagSet tagset, Ttk_TagSet tagsetFrom)
*/
int Ttk_TagSetRemove(Ttk_TagSet tagset, Ttk_Tag tag)
{
- int i = 0, j = 0;
+ Tcl_Size i = 0, j = 0;
while (i < tagset->nTags) {
if ((tagset->tags[j] = tagset->tags[i]) != tag) {
++j;
@@ -317,7 +318,7 @@ void Ttk_TagSetDefaults(Ttk_TagTable tagTable, Ttk_Style style, void *record)
void Ttk_TagSetValues(Ttk_TagTable tagTable, Ttk_TagSet tagSet, void *record)
{
const int LOWEST_PRIORITY = 0x7FFFFFFF;
- int i, j;
+ Tcl_Size i, j;
for (i = 0; tagTable->optionSpecs[i].type != TK_OPTION_END; ++i) {
const Tk_OptionSpec *optionSpec = tagTable->optionSpecs + i;
diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h
index 3f20426..e11e013 100644
--- a/generic/ttk/ttkWidget.h
+++ b/generic/ttk/ttkWidget.h
@@ -210,11 +210,11 @@ typedef struct TtkTag *Ttk_Tag;
typedef struct TtkTagTable *Ttk_TagTable;
typedef struct TtkTagSet { /* TODO: make opaque */
Ttk_Tag *tags;
- int nTags;
+ Tcl_Size nTags;
} *Ttk_TagSet;
MODULE_SCOPE Ttk_TagTable Ttk_CreateTagTable(
- Tcl_Interp *, Tk_Window tkwin, const Tk_OptionSpec *, int recordSize);
+ Tcl_Interp *, Tk_Window tkwin, const Tk_OptionSpec *, size_t recordSize);
MODULE_SCOPE void Ttk_DeleteTagTable(Ttk_TagTable);
MODULE_SCOPE Ttk_Tag Ttk_GetTag(Ttk_TagTable, const char *tagName);