Skip to content

Commit

Permalink
Fix implicit fallthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Feb 29, 2024
1 parent 8e2ed3f commit b2e7c32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ else()
endif()
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER 7)
add_definitions(
-Wimplicit-fallthrough=0 # TODO: is everything caught by implicit-fallthrough intended?
-C
-Wno-error=format-overflow # TODO: should probably just make sure buffer sizes are appropriate
-Wno-error=stringop-overflow # TODO: update nuklear
)
Expand Down
5 changes: 3 additions & 2 deletions src/cdogs/yajl/yajl_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
yajl_bs_pop(hand->stateStack);
goto around_again;
}
/* intentional fall-through */
}
// fall through
case yajl_tok_colon:
case yajl_tok_comma:
case yajl_tok_right_bracket:
Expand Down Expand Up @@ -393,7 +393,7 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
buf = yajl_buf_data(hand->decodeBuf);
bufLen = yajl_buf_len(hand->decodeBuf);
}
/* intentional fall-through */
// fall through
case yajl_tok_string:
if (hand->callbacks && hand->callbacks->yajl_map_key) {
_CC_CHK(hand->callbacks->yajl_map_key(hand->ctx, buf,
Expand All @@ -411,6 +411,7 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
yajl_bs_pop(hand->stateStack);
goto around_again;
}
// fall through
default:
yajl_bs_set(hand->stateStack, yajl_state_parse_error);
hand->parseError =
Expand Down
3 changes: 2 additions & 1 deletion src/command_line.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
C-Dogs SDL
A port of the legendary (and fun) action/arcade cdogs.
Copyright (c) 2013-2016, 2019-2021 Cong Xu
Copyright (c) 2013-2016, 2019-2021, 2024 Cong Xu
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -234,6 +234,7 @@ bool ParseArgs(
return false;
}
}
break;
default:
PrintHelp();
// Ignore unknown arguments
Expand Down

0 comments on commit b2e7c32

Please sign in to comment.