summaryrefslogtreecommitdiffstats
path: root/movement/watch_faces
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-04-10 14:45:21 -0400
committerJoey Castillo <joeycastillo@utexas.edu>2022-04-10 14:45:21 -0400
commit5cb68923b9cf27e72a55f5533b9f4045c75eda72 (patch)
tree808f4206d457b5581a1862f778354aa62a555aee /movement/watch_faces
parentd502a030e1f17b7f805c4e0144dcde5aaec79a66 (diff)
downloadSensor-Watch-5cb68923b9cf27e72a55f5533b9f4045c75eda72.tar.gz
Sensor-Watch-5cb68923b9cf27e72a55f5533b9f4045c75eda72.tar.bz2
Sensor-Watch-5cb68923b9cf27e72a55f5533b9f4045c75eda72.zip
static analysis: use parentheses around binary operators
Diffstat (limited to 'movement/watch_faces')
-rw-r--r--movement/watch_faces/clock/simple_clock_face.c4
-rw-r--r--movement/watch_faces/clock/world_clock_face.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/movement/watch_faces/clock/simple_clock_face.c b/movement/watch_faces/clock/simple_clock_face.c
index ac9e2a1f..23f36672 100644
--- a/movement/watch_faces/clock/simple_clock_face.c
+++ b/movement/watch_faces/clock/simple_clock_face.c
@@ -82,11 +82,11 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
// ...and set the LAP indicator if low.
if (state->battery_low) watch_set_indicator(WATCH_INDICATOR_LAP);
- if (date_time.reg >> 6 == previous_date_time >> 6 && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
+ if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
// everything before seconds is the same, don't waste cycles setting those segments.
pos = 8;
sprintf(buf, "%02d", date_time.unit.second);
- } else if (date_time.reg >> 12 == previous_date_time >> 12 && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
+ } else if ((date_time.reg >> 12) == (previous_date_time >> 12) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
// everything before minutes is the same.
pos = 6;
sprintf(buf, "%02d%02d", date_time.unit.minute, date_time.unit.second);
diff --git a/movement/watch_faces/clock/world_clock_face.c b/movement/watch_faces/clock/world_clock_face.c
index f0f7e954..1d09a4c0 100644
--- a/movement/watch_faces/clock/world_clock_face.c
+++ b/movement/watch_faces/clock/world_clock_face.c
@@ -71,11 +71,11 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se
previous_date_time = state->previous_date_time;
state->previous_date_time = date_time.reg;
- if (date_time.reg >> 6 == previous_date_time >> 6 && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
+ if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
// everything before seconds is the same, don't waste cycles setting those segments.
pos = 8;
sprintf(buf, "%02d", date_time.unit.second);
- } else if (date_time.reg >> 12 == previous_date_time >> 12 && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
+ } else if ((date_time.reg >> 12) == (previous_date_time >> 12) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
// everything before minutes is the same.
pos = 6;
sprintf(buf, "%02d%02d", date_time.unit.minute, date_time.unit.second);