Skip to content

Commit

Permalink
Workaround compiler warning
Browse files Browse the repository at this point in the history
Some compilers warns on uninitialized value in impossible case:

    warning: variable 'result' is used uninitialized whenever switch
    default is taken [-Wsometimes-uninitialized]
  • Loading branch information
rom1v committed Apr 13, 2020
1 parent ea46d3a commit 95fa1a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/input_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,11 @@ rotate_position(struct screen *screen, int32_t x, int32_t y) {
result.x = w - x;
result.y = h - y;
break;
case 3:
default:
assert(rotation == 3);
result.x = y;
result.y = w - x;
break;
default:
assert(!"Unreachable");
}
return result;
}
Expand Down

0 comments on commit 95fa1a6

Please sign in to comment.