summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-01 20:42:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-01 20:42:48 (GMT)
commit85e3497df412be73ac6056a05721d817dc22d350 (patch)
tree02b371eb929a9f9d70ab02468d6f0bea69f94bcc /generic
parent4323a86241a88bab506135f370ac2ebc614908a9 (diff)
parent28822e5191d3003f1d8fea59eeb79a0c14cf066d (diff)
downloadtk-85e3497df412be73ac6056a05721d817dc22d350.zip
tk-85e3497df412be73ac6056a05721d817dc22d350.tar.gz
tk-85e3497df412be73ac6056a05721d817dc22d350.tar.bz2
Merge 8.6 (and fix merge conflict arising from that)
Diffstat (limited to 'generic')
-rw-r--r--generic/tk3d.c2
-rw-r--r--generic/tkBitmap.c2
-rw-r--r--generic/tkButton.c2
-rw-r--r--generic/tkCanvPs.c2
-rw-r--r--generic/tkCanvas.c30
-rw-r--r--generic/tkColor.c2
-rw-r--r--generic/tkConfig.c2
-rw-r--r--generic/tkEvent.c27
-rw-r--r--generic/tkGet.c2
-rw-r--r--generic/tkGrab.c15
-rw-r--r--generic/tkGrid.c4
-rw-r--r--generic/tkImage.c2
-rw-r--r--generic/tkImgGIF.c4
-rw-r--r--generic/tkImgPhoto.c2
-rw-r--r--generic/tkInt.h11
-rw-r--r--generic/tkMacWinMenu.c2
-rw-r--r--generic/tkMenu.c4
-rw-r--r--generic/tkMenu.h2
-rw-r--r--generic/tkObj.c6
-rw-r--r--generic/tkOldTest.c2
-rw-r--r--generic/tkOption.c2
-rw-r--r--generic/tkPlace.c2
-rw-r--r--generic/tkPointer.c16
-rw-r--r--generic/tkSelect.c2
-rw-r--r--generic/tkStyle.c4
-rw-r--r--generic/tkTest.c2
-rw-r--r--generic/tkText.c2
-rw-r--r--generic/tkTextDisp.c4
-rw-r--r--generic/tkTextIndex.c18
-rw-r--r--generic/tkTextTag.c35
-rw-r--r--generic/tkWindow.c4
-rw-r--r--generic/ttk/ttkTreeview.c2
32 files changed, 77 insertions, 141 deletions
diff --git a/generic/tk3d.c b/generic/tk3d.c
index bcc5673..987bace 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.c
@@ -1315,7 +1315,7 @@ Tk_Get3DBorderFromObj(
*
* Side effects:
* If no error occurs, a blank internal format for a border value is
- * intialized. The final form cannot be done without a Tk_Window.
+ * initialized. The final form cannot be done without a Tk_Window.
*
*----------------------------------------------------------------------
*/
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index 88f3e2b..54bab69 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -88,7 +88,7 @@ typedef struct {
int width, height; /* Dimensions of bitmap. */
} DataKey;
-typedef struct ThreadSpecificData {
+typedef struct {
int initialized; /* 0 means table below needs initializing. */
Tcl_HashTable predefBitmapTable;
/* Hash table created by Tk_DefineBitmap to
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 0d760b0..37cfcd2 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -16,7 +16,7 @@
#include "tkButton.h"
#include "default.h"
-typedef struct ThreadSpecificData {
+typedef struct {
int defaultsInitialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index 2bfdcc5..4e41a2a 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -381,7 +381,7 @@ TkCanvPostscriptCmd(
*/
psInfo.chan = Tcl_GetChannel(interp, psInfo.channelName, &mode);
- if (psInfo.chan == (Tcl_Channel) NULL) {
+ if (psInfo.chan == NULL) {
result = TCL_ERROR;
goto cleanup;
}
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 16f46d7..5dc5932 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -698,7 +698,7 @@ Tk_CanvasObjCmd(
canvasPtr->textInfo.cursorOn = 0;
canvasPtr->insertOnTime = 0;
canvasPtr->insertOffTime = 0;
- canvasPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
+ canvasPtr->insertBlinkHandler = NULL;
canvasPtr->xOrigin = canvasPtr->yOrigin = 0;
canvasPtr->drawableXOrigin = canvasPtr->drawableYOrigin = 0;
canvasPtr->bindingTable = NULL;
@@ -4760,26 +4760,7 @@ CanvasBindProc(
switch (eventPtr->type) {
case ButtonPress:
case ButtonRelease:
- switch (eventPtr->xbutton.button) {
- case Button1:
- mask = Button1Mask;
- break;
- case Button2:
- mask = Button2Mask;
- break;
- case Button3:
- mask = Button3Mask;
- break;
- case Button4:
- mask = Button4Mask;
- break;
- case Button5:
- mask = Button5Mask;
- break;
- default:
- mask = 0;
- break;
- }
+ mask = TkGetButtonMask(eventPtr->xbutton.button);
/*
* For button press events, repick the current item using the button
@@ -4862,7 +4843,7 @@ PickCurrentItem(
* ButtonRelease, or MotionNotify. */
{
double coords[2];
- int buttonDown;
+ unsigned int buttonDown;
Tk_Item *prevItemPtr;
#ifndef USE_OLD_TAG_SEARCH
SearchUids *searchUids = GetStaticUids();
@@ -4875,8 +4856,7 @@ PickCurrentItem(
* for windows.
*/
- buttonDown = canvasPtr->state
- & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask);
+ buttonDown = canvasPtr->state & ALL_BUTTONS;
/*
* Save information about this event in the canvas. The event in the
@@ -5307,7 +5287,7 @@ CanvasFocusProc(
} else {
canvasPtr->textInfo.gotFocus = 0;
canvasPtr->textInfo.cursorOn = 0;
- canvasPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
+ canvasPtr->insertBlinkHandler = NULL;
}
EventuallyRedrawItem(canvasPtr, canvasPtr->textInfo.focusItemPtr);
if (canvasPtr->highlightWidth > 0) {
diff --git a/generic/tkColor.c b/generic/tkColor.c
index ccb9914..f6650f9 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -31,7 +31,7 @@ typedef struct {
* The structure below is used to allocate thread-local data.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
char rgbString[20]; /* */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index d3c8aad..f1a5176 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -31,7 +31,7 @@
* the option tables that have been created for a thread.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
int initialized; /* 0 means table below needs initializing. */
Tcl_HashTable hashTable;
} ThreadSpecificData;
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 69c19ed..8c81379 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -139,7 +139,7 @@ typedef struct ExitHandler {
* storage for the current thread.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
int handlersActive; /* The following variable has a non-zero value
* when a handler is active. */
InProgress *pendingPtr; /* Topmost search in progress, or NULL if
@@ -193,7 +193,6 @@ TCL_DECLARE_MUTEX(exitMutex)
static void CleanUpTkEvent(XEvent *eventPtr);
static void DelayedMotionProc(ClientData clientData);
-static int GetButtonMask(unsigned int Button);
static unsigned long GetEventMaskFromXEvent(XEvent *eventPtr);
static TkWindow * GetTkWindowFromXEvent(XEvent *eventPtr);
static void InvokeClientMessageHandlers(ThreadSpecificData *tsdPtr,
@@ -524,7 +523,7 @@ RefreshKeyboardMappingIfNeeded(
/*
*----------------------------------------------------------------------
*
- * GetButtonMask --
+ * TkGetButtonMask --
*
* Return the proper Button${n}Mask for the button.
*
@@ -537,23 +536,15 @@ RefreshKeyboardMappingIfNeeded(
*----------------------------------------------------------------------
*/
-static int
-GetButtonMask(
+static const int buttonMasks[] = {
+ 0, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
+};
+
+int
+TkGetButtonMask(
unsigned int button)
{
- switch (button) {
- case 1:
- return Button1Mask;
- case 2:
- return Button2Mask;
- case 3:
- return Button3Mask;
- case 4:
- return Button4Mask;
- case 5:
- return Button5Mask;
- }
- return 0;
+ return (button > Button5) ? 0 : buttonMasks[button];
}
/*
diff --git a/generic/tkGet.c b/generic/tkGet.c
index d58b4a5..6eff3a3 100644
--- a/generic/tkGet.c
+++ b/generic/tkGet.c
@@ -22,7 +22,7 @@
* the current thread.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
int initialized;
Tcl_HashTable uidTable;
} ThreadSpecificData;
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index 21c06a9..2855637 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -135,17 +135,6 @@ typedef struct NewGrabWinEvent {
#define GENERATED_GRAB_EVENT_MAGIC ((Bool) 0x147321ac)
/*
- * Mask that selects any of the state bits corresponding to buttons, plus
- * masks that select individual buttons' bits:
- */
-
-#define ALL_BUTTONS \
- (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
-static const unsigned int buttonStates[] = {
- Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
-};
-
-/*
* Forward declarations for functions declared later in this file:
*/
@@ -883,7 +872,7 @@ TkPointerEvent(
} else {
if (eventPtr->xbutton.button != AnyButton &&
((eventPtr->xbutton.state & ALL_BUTTONS)
- == buttonStates[eventPtr->xbutton.button - Button1])) {
+ == (unsigned int)TkGetButtonMask(eventPtr->xbutton.button))) {
ReleaseButtonGrab(dispPtr); /* Note 4. */
}
}
@@ -1382,7 +1371,7 @@ QueueGrabWindowChange(
static int
GrabWinEventProc(
Tcl_Event *evPtr, /* Event of type NewGrabWinEvent. */
- int flags) /* Flags argument to Tk_DoOneEvent: indicates
+ int flags) /* Flags argument to Tcl_DoOneEvent: indicates
* what kinds of events are being processed
* right now. */
{
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index 4e0882a..be15c14 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -1913,7 +1913,7 @@ ResolveConstraints(
GridLayout *layoutPtr; /* Temporary layout structure. */
int requiredSize; /* The natural size of the grid (pixels).
* This is the minimum size needed to
- * accomodate all of the slaves at their
+ * accommodate all of the slaves at their
* requested sizes. */
int offset; /* The pixel offset of the right edge of the
* current slot from the beginning of the
@@ -2486,7 +2486,7 @@ GetGrid(
* Side effects:
* The width and height arguments are filled in the master data
* structure. Additional space is allocated for the constraints to
- * accomodate the offsets.
+ * accommodate the offsets.
*
*----------------------------------------------------------------------
*/
diff --git a/generic/tkImage.c b/generic/tkImage.c
index 32e09c0..dc4e8e0 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.c
@@ -66,7 +66,7 @@ typedef struct ImageMaster {
* when the world is falling apart.) */
} ImageMaster;
-typedef struct ThreadSpecificData {
+typedef struct {
Tk_ImageType *imageTypeList;/* First in a list of all known image
* types. */
Tk_ImageType *oldImageTypeList;
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index 0c32047..76e48d4 100644
--- a/generic/tkImgGIF.c
+++ b/generic/tkImgGIF.c
@@ -63,9 +63,9 @@ typedef struct mFile {
* Most data in a GIF image is binary and is treated as such. However, a few
* key bits are stashed in ASCII. If we try to compare those pieces to the
* char they represent, it will fail on any non-ASCII (eg, EBCDIC) system. To
- * accomodate these systems, we test against the numeric value of the ASCII
+ * accommodate these systems, we test against the numeric value of the ASCII
* characters instead of the characters themselves. This is encoding
- * independant.
+ * independent.
*/
static const char GIF87a[] = { /* ASCII GIF87a */
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 26f1f26..03b3731 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -125,7 +125,7 @@ Tk_ImageType tkPhotoImageType = {
NULL
};
-typedef struct ThreadSpecificData {
+typedef struct {
Tk_PhotoImageFormat *formatList;
/* Pointer to the first in the list of known
* photo image formats.*/
diff --git a/generic/tkInt.h b/generic/tkInt.h
index c7dabc2..de0c608 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -932,6 +932,17 @@ typedef struct TkpClipMask {
#define EXTENDED_MASK (AnyModifier<<3)
/*
+ * Mask that selects any of the state bits corresponding to buttons, plus
+ * masks that select individual buttons' bits:
+ */
+
+#define ALL_BUTTONS \
+ (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
+
+
+MODULE_SCOPE int TkGetButtonMask(unsigned int);
+
+/*
* Object types not declared in tkObj.c need to be mentioned here so they can
* be properly registered with Tcl:
*/
diff --git a/generic/tkMacWinMenu.c b/generic/tkMacWinMenu.c
index 9449838..ab92fec 100644
--- a/generic/tkMacWinMenu.c
+++ b/generic/tkMacWinMenu.c
@@ -13,7 +13,7 @@
#include "tkInt.h"
#include "tkMenu.h"
-typedef struct ThreadSpecificData {
+typedef struct {
int postCommandGeneration;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 3a2d987..5fd8b80 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -77,7 +77,7 @@
#define MENU_HASH_KEY "tkMenus"
-typedef struct ThreadSpecificData {
+typedef struct {
int menusInitialized; /* Flag indicates whether thread-specific
* elements of the Windows Menu module have
* been initialized. */
@@ -90,7 +90,7 @@ static Tcl_ThreadDataKey dataKey;
/*
* The following flag indicates whether the process-wide state for the Menu
- * module has been intialized. The Mutex protects access to that flag.
+ * module has been initialized. The Mutex protects access to that flag.
*/
static int menusInitialized;
diff --git a/generic/tkMenu.h b/generic/tkMenu.h
index 4cc3d1b..ae69d96 100644
--- a/generic/tkMenu.h
+++ b/generic/tkMenu.h
@@ -120,7 +120,7 @@ typedef struct TkMenuEntry {
* always 0 for tearoff and separator
* entries. */
int hideMargin; /* If this is 0, then the item has enough
- * margin to accomodate a standard check mark
+ * margin to accommodate a standard check mark
* and a default right margin. If this is 1,
* then the item has no such margins, and
* checkbuttons and radiobuttons with this set
diff --git a/generic/tkObj.c b/generic/tkObj.c
index 46f2da5..559f0e2 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -47,7 +47,7 @@ typedef struct PixelRep {
* thread.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
const Tcl_ObjType *doubleTypePtr;
const Tcl_ObjType *intTypePtr;
} ThreadSpecificData;
@@ -96,7 +96,7 @@ static int SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
/*
* The following structure defines the implementation of the "pixel" Tcl
* object, used for measuring distances. The pixel object remembers its
- * initial display-independant settings.
+ * initial display-independent settings.
*/
static const Tcl_ObjType pixelObjType = {
@@ -110,7 +110,7 @@ static const Tcl_ObjType pixelObjType = {
/*
* The following structure defines the implementation of the "pixel" Tcl
* object, used for measuring distances. The pixel object remembers its
- * initial display-independant settings.
+ * initial display-independent settings.
*/
static const Tcl_ObjType mmObjType = {
diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c
index f78ebba..948883d 100644
--- a/generic/tkOldTest.c
+++ b/generic/tkOldTest.c
@@ -91,7 +91,7 @@ static int ImageObjCmd(ClientData dummy,
*
* TkOldTestInit --
*
- * This function performs intialization for the Tk test suite
+ * This function performs initialization for the Tk test suite
* extensions for testing support for legacy interfaces.
*
* Results:
diff --git a/generic/tkOption.c b/generic/tkOption.c
index 545a9b9..713a6d5 100644
--- a/generic/tkOption.c
+++ b/generic/tkOption.c
@@ -176,7 +176,7 @@ typedef struct StackLevel {
* of a level. */
} StackLevel;
-typedef struct ThreadSpecificData {
+typedef struct {
int initialized; /* 0 means the ThreadSpecific Data structure
* for the current thread needs to be
* initialized. */
diff --git a/generic/tkPlace.c b/generic/tkPlace.c
index 7aa9b04..59b8a2b 100644
--- a/generic/tkPlace.c
+++ b/generic/tkPlace.c
@@ -616,7 +616,7 @@ ConfigureSlave(
Tk_SavedOptions savedOptions;
int mask;
Slave *slavePtr;
- Tk_Window masterWin = (Tk_Window) NULL;
+ Tk_Window masterWin = NULL;
TkWindow *master;
if (Tk_TopWinHierarchy(tkwin)) {
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index 0141b64..de9d49d 100644
--- a/generic/tkPointer.c
+++ b/generic/tkPointer.c
@@ -23,19 +23,7 @@
#define Cursor XCursor
#endif
-/*
- * Mask that selects any of the state bits corresponding to buttons, plus
- * masks that select individual buttons' bits:
- */
-
-#define ALL_BUTTONS \
- (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
-static const unsigned int buttonMasks[] = {
- Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
-};
-#define ButtonMask(b) (buttonMasks[(b)-Button1])
-
-typedef struct ThreadSpecificData {
+typedef struct {
TkWindow *grabWinPtr; /* Window that defines the top of the grab
* tree in a global grab. */
int lastState; /* Last known state flags. */
@@ -267,7 +255,7 @@ Tk_UpdatePointer(
*/
for (b = Button1; b <= Button5; b++) {
- mask = ButtonMask(b);
+ mask = TkGetButtonMask(b);
if (changes & mask) {
if (state & mask) {
type = ButtonPress;
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 8ba0c5f..c64c93f 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -48,7 +48,7 @@ typedef struct LostCommand {
* The structure below is used to keep each thread's pending list separate.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
TkSelInProgress *pendingPtr;
/* Topmost search in progress, or NULL if
* none. */
diff --git a/generic/tkStyle.c b/generic/tkStyle.c
index e7401df..5c0f204 100644
--- a/generic/tkStyle.c
+++ b/generic/tkStyle.c
@@ -98,7 +98,7 @@ typedef struct Element {
* Thread-local data.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
int 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
@@ -1360,7 +1360,7 @@ Tk_GetStyle(
"style \"%s\" doesn't exist", name));
Tcl_SetErrorCode(interp, "TK", "LOOKUP", "STYLE", name, NULL);
}
- return (Tk_Style) NULL;
+ return NULL;
}
stylePtr = Tcl_GetHashValue(entryPtr);
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 44fec0d..a8929b9 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -212,7 +212,7 @@ static void TrivialEventProc(ClientData clientData,
*
* Tktest_Init --
*
- * This function performs intialization for the Tk test suite exensions.
+ * This function performs initialization for the Tk test suite extensions.
*
* Results:
* Returns a standard Tcl completion code, and leaves an error message in
diff --git a/generic/tkText.c b/generic/tkText.c
index ab06089..7c62621 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -4927,7 +4927,7 @@ DumpLine(
TkTextEmbWindow *ewPtr = &segPtr->body.ew;
const char *pathname;
- if (ewPtr->tkwin == (Tk_Window) NULL) {
+ if (ewPtr->tkwin == NULL) {
pathname = "";
} else {
pathname = Tk_PathName(ewPtr->tkwin);
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index fcefb9a..c848fd2 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -626,7 +626,7 @@ static void AsyncUpdateLineMetrics(ClientData clientData);
static void GenerateWidgetViewSyncEvent(TkText *textPtr, Bool InSync);
static void AsyncUpdateYScrollbar(ClientData clientData);
static int IsStartOfNotMergedLine(TkText *textPtr,
- CONST TkTextIndex *indexPtr);
+ const TkTextIndex *indexPtr);
/*
* Result values returned by TextGetScrollInfoObj:
@@ -6988,7 +6988,7 @@ FindDLine(
static int
IsStartOfNotMergedLine(
TkText *textPtr, /* Widget record for text widget. */
- CONST TkTextIndex *indexPtr) /* Index to check. */
+ const TkTextIndex *indexPtr) /* Index to check. */
{
TkTextIndex indexPtr2;
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index 582e1a8..7430197 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -40,9 +40,9 @@ static const char * StartEnd(TkText *textPtr, const char *string,
static int GetIndex(Tcl_Interp *interp, TkSharedText *sharedPtr,
TkText *textPtr, const char *string,
TkTextIndex *indexPtr, int *canCachePtr);
-static int IndexCountBytesOrdered(CONST TkText *textPtr,
- CONST TkTextIndex *indexPtr1,
- CONST TkTextIndex *indexPtr2);
+static int IndexCountBytesOrdered(const TkText *textPtr,
+ const TkTextIndex *indexPtr1,
+ const TkTextIndex *indexPtr2);
/*
* The "textindex" Tcl_Obj definition:
@@ -1636,9 +1636,9 @@ TkTextIndexForwChars(
int
TkTextIndexCountBytes(
- CONST TkText *textPtr,
- CONST TkTextIndex *indexPtr1, /* Index describing one location. */
- CONST TkTextIndex *indexPtr2) /* Index describing second location. */
+ const TkText *textPtr,
+ const TkTextIndex *indexPtr1, /* Index describing one location. */
+ const TkTextIndex *indexPtr2) /* Index describing second location. */
{
int compare = TkTextIndexCmp(indexPtr1, indexPtr2);
@@ -1653,11 +1653,11 @@ TkTextIndexCountBytes(
static int
IndexCountBytesOrdered(
- CONST TkText *textPtr,
- CONST TkTextIndex *indexPtr1,
+ const TkText *textPtr,
+ const TkTextIndex *indexPtr1,
/* Index describing location of character from
* which to count. */
- CONST TkTextIndex *indexPtr2)
+ const TkTextIndex *indexPtr2)
/* Index describing location of last character
* at which to stop the count. */
{
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 56e6c71..a88ccb9 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -1446,9 +1446,6 @@ TkTextBindProc(
TkText *textPtr = clientData;
int repick = 0;
-# define AnyButtonMask \
- (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
-
textPtr->refCount++;
/*
@@ -1460,35 +1457,16 @@ TkTextBindProc(
if (eventPtr->type == ButtonPress) {
textPtr->flags |= BUTTON_DOWN;
} else if (eventPtr->type == ButtonRelease) {
- unsigned long mask;
+ unsigned int mask;
- switch (eventPtr->xbutton.button) {
- case Button1:
- mask = Button1Mask;
- break;
- case Button2:
- mask = Button2Mask;
- break;
- case Button3:
- mask = Button3Mask;
- break;
- case Button4:
- mask = Button4Mask;
- break;
- case Button5:
- mask = Button5Mask;
- break;
- default:
- mask = 0;
- break;
- }
- if ((eventPtr->xbutton.state & AnyButtonMask) == mask) {
+ mask = TkGetButtonMask(eventPtr->xbutton.button);
+ if ((eventPtr->xbutton.state & ALL_BUTTONS) == mask) {
textPtr->flags &= ~BUTTON_DOWN;
repick = 1;
}
} else if ((eventPtr->type == EnterNotify)
|| (eventPtr->type == LeaveNotify)) {
- if (eventPtr->xcrossing.state & AnyButtonMask) {
+ if (eventPtr->xcrossing.state & ALL_BUTTONS) {
textPtr->flags |= BUTTON_DOWN;
} else {
textPtr->flags &= ~BUTTON_DOWN;
@@ -1496,7 +1474,7 @@ TkTextBindProc(
TkTextPickCurrent(textPtr, eventPtr);
goto done;
} else if (eventPtr->type == MotionNotify) {
- if (eventPtr->xmotion.state & AnyButtonMask) {
+ if (eventPtr->xmotion.state & ALL_BUTTONS) {
textPtr->flags |= BUTTON_DOWN;
} else {
textPtr->flags &= ~BUTTON_DOWN;
@@ -1513,8 +1491,7 @@ TkTextBindProc(
unsigned int oldState;
oldState = eventPtr->xbutton.state;
- eventPtr->xbutton.state &= ~(Button1Mask|Button2Mask
- |Button3Mask|Button4Mask|Button5Mask);
+ eventPtr->xbutton.state &= ~ALL_BUTTONS;
if (!(textPtr->flags & DESTROYED)) {
TkTextPickCurrent(textPtr, eventPtr);
}
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 917d3bd..51cbaf3 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -37,7 +37,7 @@ typedef struct TkHalfdeadWindow {
struct TkHalfdeadWindow *nextPtr;
} TkHalfdeadWindow;
-typedef struct ThreadSpecificData {
+typedef struct {
int numMainWindows; /* Count of numver of main windows currently
* open in this thread. */
TkMainInfo *mainWindowList;
@@ -852,7 +852,7 @@ TkCreateMainWindow(
* Create the basic TkWindow structure.
*/
- tkwin = CreateTopLevelWindow(interp, (Tk_Window) NULL, baseName,
+ tkwin = CreateTopLevelWindow(interp, NULL, baseName,
screenName, /* flags */ 0);
if (tkwin == NULL) {
return NULL;
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index b1739b6..cda98a0 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -1066,7 +1066,7 @@ static void TreeviewCleanup(void *recordPtr)
TreeviewFreeColumns(tv);
if (tv->tree.displayColumns)
- Tcl_Free((ClientData)tv->tree.displayColumns);
+ ckfree((ClientData)tv->tree.displayColumns);
foreachHashEntry(&tv->tree.items, FreeItemCB);
Tcl_DeleteHashTable(&tv->tree.items);