Skip to content

Commit

Permalink
main: Remove empty switch case
Browse files Browse the repository at this point in the history
SDCC 4.4.0 now fails to compile if there are empty switch cases.

    src/board/system76/common/main.c:105: error 110: conditional flow changed by optimizer: so said EVELYN the modified DOG

Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd authored and jackpot51 committed Feb 25, 2024
1 parent ef4eeae commit 449bafd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/board/system76/common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void main(void) {
uint32_t last_time_fan = 0;

for (main_cycle = 0;; main_cycle++) {
// NOTE: Do note use modulo to avoid expensive call to SDCC library
// call. (Modulo is optimized for powers of 2, however.)
switch (main_cycle & 3U) {
case 0:
// Handle USB-C events immediately before power states
Expand All @@ -123,11 +125,6 @@ void main(void) {
// Handle lid close/open
lid_event();
break;

case 3:
// We previously used modulo to limit when the logic for other
// cases ran, so this case is unused.
break;
}

if (main_cycle == 0) {
Expand Down

0 comments on commit 449bafd

Please sign in to comment.