summaryrefslogtreecommitdiffstats
path: root/carbon
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-07-31 14:39:04 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-07-31 14:39:04 (GMT)
commit57697b5b22a5851bca41ba3ec058f1de355ba5dc (patch)
tree6faf126294b1235b3307dcc394cab895489ceef6 /carbon
parentd4a4017589dd52fa8e9667df9d754fd62abd6bed (diff)
downloadtk-57697b5b22a5851bca41ba3ec058f1de355ba5dc.zip
tk-57697b5b22a5851bca41ba3ec058f1de355ba5dc.tar.gz
tk-57697b5b22a5851bca41ba3ec058f1de355ba5dc.tar.bz2
minor improvements to flag handling
Diffstat (limited to 'carbon')
-rw-r--r--carbon/tkMacOSXButton.c4
-rw-r--r--carbon/tkMacOSXMenu.c4
-rw-r--r--carbon/tkMacOSXMenubutton.c6
-rw-r--r--carbon/tkMacOSXWm.c6
4 files changed, 10 insertions, 10 deletions
diff --git a/carbon/tkMacOSXButton.c b/carbon/tkMacOSXButton.c
index b39696d..a7ef5b8 100644
--- a/carbon/tkMacOSXButton.c
+++ b/carbon/tkMacOSXButton.c
@@ -978,7 +978,7 @@ TkMacOSXDrawControl(
SetControlValue(mbPtr->control, 0);
}
- active = ((mbPtr->flags & ACTIVE) != 0);
+ active = !!(mbPtr->flags & ACTIVE);
if (active != IsControlActive(mbPtr->control)) {
if (active) {
ChkErr(ActivateControl, mbPtr->control);
@@ -1395,7 +1395,7 @@ ButtonEventProc(
} else {
mbPtr->flags &= ~ACTIVE;
}
- if ((buttonPtr->flags & REDRAW_PENDING) == 0) {
+ if (!(buttonPtr->flags & REDRAW_PENDING)) {
Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) buttonPtr);
buttonPtr->flags |= REDRAW_PENDING;
}
diff --git a/carbon/tkMacOSXMenu.c b/carbon/tkMacOSXMenu.c
index dda4b7e..a467c56 100644
--- a/carbon/tkMacOSXMenu.c
+++ b/carbon/tkMacOSXMenu.c
@@ -2372,7 +2372,7 @@ GetMenuAccelGeometry (
CFRelease(cfStr);
}
}
- if ((mePtr->entryFlags & ENTRY_ACCEL_MASK) == 0) {
+ if (!(mePtr->entryFlags & ENTRY_ACCEL_MASK)) {
if (!geometryPtr->accelGlyph) {
width = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
}
@@ -2636,7 +2636,7 @@ DrawMenuEntryAccelerator(
drawState = kThemeStateActive;
break;
}
- if ((mePtr->entryFlags & ENTRY_ACCEL_MASK) == 0) {
+ if (!(mePtr->entryFlags & ENTRY_ACCEL_MASK)) {
leftEdge -= geometryPtr->modifierWidth;
}
if (geometryPtr->accelGlyph) {
diff --git a/carbon/tkMacOSXMenubutton.c b/carbon/tkMacOSXMenubutton.c
index 9846d13..58fc787 100644
--- a/carbon/tkMacOSXMenubutton.c
+++ b/carbon/tkMacOSXMenubutton.c
@@ -934,7 +934,7 @@ MenuButtonEventProc(
if (eventPtr->type == ActivateNotify
|| eventPtr->type == DeactivateNotify) {
- if ((buttonPtr->tkwin == NULL) || (!Tk_IsMapped(buttonPtr->tkwin))) {
+ if ((buttonPtr->tkwin == NULL) || !Tk_IsMapped(buttonPtr->tkwin)) {
return;
}
if (eventPtr->type == ActivateNotify) {
@@ -942,8 +942,8 @@ MenuButtonEventProc(
} else {
mbPtr->flags &= ~ACTIVE;
}
- if ((buttonPtr->flags & REDRAW_PENDING) == 0) {
- Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) buttonPtr);
+ if (!(buttonPtr->flags & REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(TkpDisplayMenuButton, buttonPtr);
buttonPtr->flags |= REDRAW_PENDING;
}
}
diff --git a/carbon/tkMacOSXWm.c b/carbon/tkMacOSXWm.c
index 508a5f8..d4b7665 100644
--- a/carbon/tkMacOSXWm.c
+++ b/carbon/tkMacOSXWm.c
@@ -3518,7 +3518,7 @@ UpdateGeometryInfo(
if (((width != winPtr->changes.width)
|| (height != winPtr->changes.height))
&& (wmPtr->gridWin == NULL)
- && ((wmPtr->sizeHintsFlags & (PMinSize|PMaxSize)) == 0)) {
+ && !(wmPtr->sizeHintsFlags & (PMinSize|PMaxSize))) {
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
}
if (wmPtr->flags & WM_UPDATE_SIZE_HINTS) {
@@ -3718,7 +3718,7 @@ ParseGeometry(
* them.
*/
- if ((wmPtr->sizeHintsFlags & (USPosition|PPosition)) == 0) {
+ if (!(wmPtr->sizeHintsFlags & (USPosition|PPosition))) {
wmPtr->sizeHintsFlags |= USPosition;
flags |= WM_UPDATE_SIZE_HINTS;
}
@@ -4227,7 +4227,7 @@ Tk_MoveToplevelWindow(
wmPtr->y = y;
wmPtr->flags |= WM_MOVE_PENDING;
wmPtr->flags &= ~(WM_NEGATIVE_X|WM_NEGATIVE_Y);
- if ((wmPtr->sizeHintsFlags & (USPosition|PPosition)) == 0) {
+ if (!(wmPtr->sizeHintsFlags & (USPosition|PPosition))) {
wmPtr->sizeHintsFlags |= USPosition;
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
}