From 6e359bd331f0d8c53f8c10cebc13784f866b6968 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 13 Aug 2019 07:32:07 +0000 Subject: Use "unsigned long" as type for "mask" variables containing X11 button-masks consistantly. Code cleanup. --- generic/tkCanvas.c | 4 ++-- generic/tkEvent.c | 2 +- generic/tkInt.h | 2 +- generic/tkTextTag.c | 2 +- generic/ttk/ttkTreeview.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index ab648a1..5b4d19b 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -1027,7 +1027,7 @@ CanvasWidgetCmd( result = TCL_ERROR; goto done; } - if (mask & (unsigned) ~(ButtonMotionMask|Button1MotionMask + if (mask & ~(unsigned long)(ButtonMotionMask|Button1MotionMask |Button2MotionMask|Button3MotionMask|Button4MotionMask |Button5MotionMask|ButtonPressMask|ButtonReleaseMask |EnterWindowMask|LeaveWindowMask|KeyPressMask @@ -4747,7 +4747,7 @@ CanvasBindProc( XEvent *eventPtr) /* Pointer to X event that just happened. */ { TkCanvas *canvasPtr = clientData; - int mask; + unsigned long mask; Tcl_Preserve(canvasPtr); diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 753a31b..f5ef1f8 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -540,7 +540,7 @@ static const int buttonMasks[] = { 0, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask }; -int +unsigned long TkGetButtonMask( unsigned int button) { diff --git a/generic/tkInt.h b/generic/tkInt.h index 124a8f5..a4f2be4 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -940,7 +940,7 @@ typedef struct TkpClipMask { (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask) -MODULE_SCOPE int TkGetButtonMask(unsigned int); +MODULE_SCOPE unsigned long TkGetButtonMask(unsigned int); /* * Object types not declared in tkObj.c need to be mentioned here so they can diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 5cb08ec..6fa115d 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -292,7 +292,7 @@ TkTextTagCmd( if (mask == 0) { return TCL_ERROR; } - if (mask & (unsigned) ~(ButtonMotionMask|Button1MotionMask + if (mask & ~(unsigned long)(ButtonMotionMask|Button1MotionMask |Button2MotionMask|Button3MotionMask|Button4MotionMask |Button5MotionMask|ButtonPressMask|ButtonReleaseMask |EnterWindowMask|LeaveWindowMask|KeyPressMask diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index cda98a0..3674ae5 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -923,7 +923,7 @@ static void DragColumn(Treeview *tv, int i, int delta) static TreeItem *IdentifyItem(Treeview *tv, int y); /*forward*/ -static const unsigned int TreeviewBindEventMask = +static const unsigned long TreeviewBindEventMask = KeyPressMask|KeyReleaseMask | ButtonPressMask|ButtonReleaseMask | PointerMotionMask|ButtonMotionMask -- cgit v0.12