summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-13 07:32:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-13 07:32:07 (GMT)
commit6e359bd331f0d8c53f8c10cebc13784f866b6968 (patch)
tree72b9ad6e69c5a72c96f01a8ee8c5cd3dce55c835
parent4ebe61f87e43bc4477641121cdd51a52b70dd775 (diff)
downloadtk-6e359bd331f0d8c53f8c10cebc13784f866b6968.zip
tk-6e359bd331f0d8c53f8c10cebc13784f866b6968.tar.gz
tk-6e359bd331f0d8c53f8c10cebc13784f866b6968.tar.bz2
Use "unsigned long" as type for "mask" variables containing X11 button-masks consistantly. Code cleanup.
-rw-r--r--generic/tkCanvas.c4
-rw-r--r--generic/tkEvent.c2
-rw-r--r--generic/tkInt.h2
-rw-r--r--generic/tkTextTag.c2
-rw-r--r--generic/ttk/ttkTreeview.c2
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