summaryrefslogtreecommitdiffstats
path: root/AffinityPanel.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-09-23 17:58:11 +0200
committercgzones <cgzones@googlemail.com>2020-09-23 19:09:11 +0200
commit6b11738744d03889fc7654c17d6c605d54f847dd (patch)
treeab0727bf8b37f79872750911d0c54a045e15c2d0 /AffinityPanel.c
parentf9966b5be3add7eae8e94cf6a55f53414fdf3cdb (diff)
Avoid arithmetic on booleans
Diffstat (limited to 'AffinityPanel.c')
-rw-r--r--AffinityPanel.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/AffinityPanel.c b/AffinityPanel.c
index d0a9e6dc..aea0c98a 100644
--- a/AffinityPanel.c
+++ b/AffinityPanel.c
@@ -100,11 +100,10 @@ static MaskItem* MaskItem_newSingleton(const char* text, int cpu, bool isSet) {
this->ownCpuset = true;
this->cpuset = hwloc_bitmap_alloc();
hwloc_bitmap_set(this->cpuset, cpu);
- (void)isSet;
#else
this->cpu = cpu;
#endif
- this->value = 2 * isSet;
+ this->value = isSet ? 2 : 0;
return this;
}
@@ -206,7 +205,7 @@ static HandlerResult AffinityPanel_eventHandler(Panel* super, int ch) {
selected->value = 2;
}
#else
- selected->value = 2 * !selected->value; /* toggle between 0 and 2 */
+ selected->value = selected->value ? 0 : 2; /* toggle between 0 and 2 */
#endif
result = HANDLED;

© 2014-2024 Faster IT GmbH | imprint | privacy policy