diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-02-19 11:45:08 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-02-19 11:45:08 (GMT) |
commit | dce78bcb0455e180116b61b634496b64c6e5254d (patch) | |
tree | 473ac79a684d30769f6e2178a7d7039974497cdf /generic | |
parent | 5ae0e88cc49f83ebe127f1aebddadc4e5d7c1990 (diff) | |
download | tk-dce78bcb0455e180116b61b634496b64c6e5254d.zip tk-dce78bcb0455e180116b61b634496b64c6e5254d.tar.gz tk-dce78bcb0455e180116b61b634496b64c6e5254d.tar.bz2 |
Use Tcl_ObjCmdProc(2?) in stead of full signature, where possible
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkInt.h | 14 | ||||
-rw-r--r-- | generic/tkText.c | 10 | ||||
-rw-r--r-- | generic/tkText.h | 10 | ||||
-rw-r--r-- | generic/tkTextBTree.c | 27 | ||||
-rw-r--r-- | generic/ttk/ttkTheme.h | 4 |
5 files changed, 27 insertions, 38 deletions
diff --git a/generic/tkInt.h b/generic/tkInt.h index 30361d9..2b89d2a 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -983,13 +983,13 @@ typedef struct { * commands and optionally to create sub-ensembles. */ +#if (TCL_MAJOR_VERSION < 9) && !defined(Tcl_ObjCmdProc2) +#define Tcl_ObjCmdProc2 Tcl_ObjCmdProc +#endif + typedef struct TkEnsemble { const char *name; -#if TCL_MAJOR_VERSION > 8 Tcl_ObjCmdProc2 *proc; -#else - Tcl_ObjCmdProc *proc; -#endif const struct TkEnsemble *subensemble; } TkEnsemble; @@ -1200,11 +1200,7 @@ MODULE_SCOPE void Ttk_TkDestroyedHandler(Tcl_Interp *interp); MODULE_SCOPE Tcl_ObjCmdProc Tk_BellObjCmd; MODULE_SCOPE Tcl_ObjCmdProc Tk_BindObjCmd; MODULE_SCOPE Tcl_ObjCmdProc Tk_BindtagsObjCmd; -#if TCL_MAJOR_VERSION > 8 - MODULE_SCOPE Tcl_ObjCmdProc2 Tk_BusyObjCmd; -#else - MODULE_SCOPE Tcl_ObjCmdProc Tk_BusyObjCmd; -#endif +MODULE_SCOPE Tcl_ObjCmdProc2 Tk_BusyObjCmd; MODULE_SCOPE Tcl_ObjCmdProc Tk_ButtonObjCmd; MODULE_SCOPE Tcl_ObjCmdProc Tk_CanvasObjCmd; MODULE_SCOPE Tcl_ObjCmdProc Tk_CheckbuttonObjCmd; diff --git a/generic/tkText.c b/generic/tkText.c index c3568ec..8e6c9c1 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -353,7 +353,7 @@ static int InsertChars(TkSharedText *sharedTextPtr, TkText *textPtr, TkTextIndex *indexPtr, Tcl_Obj *stringPtr, int viewUpdate); static void TextBlinkProc(void *clientData); -static void TextCmdDeletedProc(void *clientData); +static Tcl_CmdDeleteProc TextCmdDeletedProc; static int CreateWidget(TkSharedText *sharedPtr, Tk_Window tkwin, Tcl_Interp *interp, const TkText *parent, Tcl_Size objc, Tcl_Obj *const objv[]); @@ -375,12 +375,8 @@ static int TextSearchCmd(TkText *textPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); static int TextEditCmd(TkText *textPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); -static int TextWidgetObjCmd(void *clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int SharedTextObjCmd(void *clientData, - Tcl_Interp *interp, - Tcl_Size objc, Tcl_Obj *const objv[]); +static Tcl_ObjCmdProc TextWidgetObjCmd; +static Tcl_ObjCmdProc2 SharedTextObjCmd; static void TextWorldChangedCallback(void *instanceData); static void TextWorldChanged(TkText *textPtr, int mask); static int TextDumpCmd(TkText *textPtr, Tcl_Interp *interp, diff --git a/generic/tkText.h b/generic/tkText.h index 070ea45..5fa86a7 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -319,7 +319,7 @@ typedef struct TkTextTag { /* If non-NULL, then this tag only applies to * the given text widget (when there are peer * widgets). */ - int priority; /* Priority of this tag within widget. 0 means + Tcl_Size priority; /* Priority of this tag within widget. 0 means * lowest priority. Exactly one tag has each * integer value between 0 and numTags-1. */ struct Node *tagRootPtr; /* Pointer into the B-Tree at the lowest node @@ -328,7 +328,7 @@ typedef struct TkTextTag { * there is no information about the tag. One * or more children of the node do contain * information about the tag. */ - int toggleCount; /* Total number of tag toggles. */ + Tcl_Size toggleCount; /* Total number of tag toggles. */ /* * Information for displaying text with this tag. The information belows @@ -541,7 +541,7 @@ typedef struct TkSharedText { * pointers to TkTextTag structures. The "sel" * tag does not feature in this table, since * there's one of those for each text peer. */ - int numTags; /* Number of tags currently defined for + Tcl_Size numTags; /* Number of tags currently defined for * widget; needed to keep track of * priorities. */ Tcl_HashTable markTable; /* Hash table that maps from mark names to @@ -911,9 +911,9 @@ typedef int TkTextCountType; #define LOTSA_TAGS 1000 typedef struct TkTextElideInfo { - int numTags; /* Total tags in widget. */ + Tcl_Size numTags; /* Total tags in widget. */ int elide; /* Is the state currently elided. */ - int elidePriority; /* Tag priority controlling elide state. */ + Tcl_Size elidePriority; /* Tag priority controlling elide state. */ TkTextSegment *segPtr; /* Segment to look at next. */ int segOffset; /* Offset of segment within line. */ int deftagCnts[LOTSA_TAGS]; diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index fc55937..0765ad0 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -44,7 +44,7 @@ typedef struct Summary { TkTextTag *tagPtr; /* Handle for tag. */ - int toggleCount; /* Number of transitions into or out of this + Tcl_Size toggleCount; /* Number of transitions into or out of this * tag that occur in the subtree rooted at * this node. */ struct Summary *nextPtr; /* Next in list of all tags for same node, or @@ -63,7 +63,7 @@ typedef struct Node { Summary *summaryPtr; /* First in malloc-ed list of info about tags * in this subtree (NULL if no tag info in the * subtree). */ - int level; /* Level of this node in the B-tree. 0 refers + Tcl_Size level; /* Level of this node in the B-tree. 0 refers * to the bottom of the tree (children are * lines, not nodes). */ union { /* First in linked list of children. */ @@ -154,7 +154,7 @@ static int AdjustPixelClient(BTree *treePtr, int defaultHeight, int useReference, int newPixelReferences, int *counting); static void ChangeNodeToggleCount(Node *nodePtr, - TkTextTag *tagPtr, int delta); + TkTextTag *tagPtr, Tcl_Size delta); static void CharCheckProc(TkTextSegment *segPtr, TkTextLine *linePtr); static int CharDeleteProc(TkTextSegment *segPtr, @@ -2314,12 +2314,12 @@ ChangeNodeToggleCount( Node *nodePtr, /* Node whose toggle count for a tag must be * changed. */ TkTextTag *tagPtr, /* Information about tag. */ - int delta) /* Amount to add to current toggle count for + Tcl_Size delta) /* Amount to add to current toggle count for * tag (may be negative). */ { Summary *summaryPtr, *prevPtr; Node *node2Ptr; - int rootLevel; /* Level of original tag root. */ + Tcl_Size rootLevel; /* Level of original tag root. */ tagPtr->toggleCount += delta; if (tagPtr->tagRootPtr == NULL) { @@ -2366,7 +2366,7 @@ ChangeNodeToggleCount( * first place). */ - Tcl_Panic("ChangeNodeToggleCount: bad toggle count (%d) max (%d)", + Tcl_Panic("ChangeNodeToggleCount: bad toggle count (%" TCL_SIZE_MODIFIER "d) max (%" TCL_SIZE_MODIFIER "d)", summaryPtr->toggleCount, tagPtr->toggleCount); } @@ -3790,7 +3790,7 @@ TkBTreeCheck( TkTextTag *tagPtr; Tcl_HashEntry *entryPtr; Tcl_HashSearch search; - int count; + Tcl_Size count; /* * Make sure that the tag toggle counts and the tag root pointers are OK. @@ -3802,7 +3802,7 @@ TkBTreeCheck( nodePtr = tagPtr->tagRootPtr; if (nodePtr == NULL) { if (tagPtr->toggleCount != 0) { - Tcl_Panic("TkBTreeCheck found \"%s\" with toggles (%d) but no root", + Tcl_Panic("TkBTreeCheck found \"%s\" with toggles (%" TCL_SIZE_MODIFIER "d) but no root", tagPtr->name, tagPtr->toggleCount); } continue; /* No ranges for the tag. */ @@ -3810,7 +3810,7 @@ TkBTreeCheck( Tcl_Panic("TkBTreeCheck found root for \"%s\" with no toggles", tagPtr->name); } else if (tagPtr->toggleCount & 1) { - Tcl_Panic("TkBTreeCheck found odd toggle count for \"%s\" (%d)", + Tcl_Panic("TkBTreeCheck found odd toggle count for \"%s\" (%" TCL_SIZE_MODIFIER "d)", tagPtr->name, tagPtr->toggleCount); } for (summaryPtr = nodePtr->summaryPtr; summaryPtr != NULL; @@ -3844,7 +3844,7 @@ TkBTreeCheck( } } if (count != tagPtr->toggleCount) { - Tcl_Panic("TkBTreeCheck toggleCount (%d) wrong for \"%s\" should be (%d)", + Tcl_Panic("TkBTreeCheck toggleCount (%" TCL_SIZE_MODIFIER "d) wrong for \"%s\" should be (%" TCL_SIZE_MODIFIER "d)", tagPtr->toggleCount, tagPtr->name, count); } } @@ -3930,8 +3930,9 @@ CheckNodeConsistency( Summary *summaryPtr, *summaryPtr2; TkTextLine *linePtr; TkTextSegment *segPtr; - int numChildren, numLines, toggleCount, minChildren, i; + int numChildren, numLines, minChildren, i; int *numPixels; + Tcl_Size toggleCount; int pixels[PIXEL_CLIENTS]; if (nodePtr->parentPtr != NULL) { @@ -3996,7 +3997,7 @@ CheckNodeConsistency( Tcl_Panic("CheckNodeConsistency: node doesn't point to parent"); } if (childNodePtr->level != (nodePtr->level-1)) { - Tcl_Panic("CheckNodeConsistency: level mismatch (%d %d)", + Tcl_Panic("CheckNodeConsistency: level mismatch (%" TCL_SIZE_MODIFIER "d %" TCL_SIZE_MODIFIER "d)", nodePtr->level, childNodePtr->level); } CheckNodeConsistency(childNodePtr, references); @@ -4077,7 +4078,7 @@ CheckNodeConsistency( } } if (toggleCount != summaryPtr->toggleCount) { - Tcl_Panic("CheckNodeConsistency: mismatch in toggleCount (%d %d)", + Tcl_Panic("CheckNodeConsistency: mismatch in toggleCount (%" TCL_SIZE_MODIFIER "d %" TCL_SIZE_MODIFIER "d)", toggleCount, summaryPtr->toggleCount); } for (summaryPtr2 = summaryPtr->nextPtr; summaryPtr2 != NULL; diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h index a0a27cd..d0406c9 100644 --- a/generic/ttk/ttkTheme.h +++ b/generic/ttk/ttkTheme.h @@ -376,11 +376,7 @@ MODULE_SCOPE int TtkGetOrientFromObj(Tcl_Interp *interp, typedef struct TtkEnsemble { const char *name; /* subcommand name */ -#if TCL_MAJOR_VERSION > 8 Tcl_ObjCmdProc2 *command; /* subcommand implementation, OR: */ -#else - Tcl_ObjCmdProc *command; -#endif const struct TtkEnsemble *ensemble; /* subcommand ensemble */ } Ttk_Ensemble; |