Skip to content

Commit

Permalink
Fix compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryzee119 committed Jan 22, 2024
1 parent ce49fe8 commit 17d4c8c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ck_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ bool CK_LoadGame(FS_File fp, bool fromMenu)
{
int i;
uint16_t cmplen, bufsize;
int16_t prevFuses;
int16_t prevFuses = 0;
CK_object *objprev, *objnext, *moreObj;
uint8_t *buf;

Expand Down
3 changes: 3 additions & 0 deletions src/ck_play.c
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,10 @@ void CK_NormalCamera(CK_object *obj)
int16_t dx, ax;

ax = ck6_smashScreenOfs[ck6_smashScreenDistance] + obj->clipRects.unitY2;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
deltaY += (dx - ax); // Undefined behaviour here
#pragma GCC diagnostic pop
}
else
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/ck_us_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ bool CK_US_JoyConfMenuProc(US_CardMsg msg, US_CardItem *item)
{
IN_JoyConfItem which_control;
int value;
char str[8], *spos;
char str[8+1], *spos;
int print_x, print_y;
static const int8_t deadzone_values[] = {
0, 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, -1};
Expand Down Expand Up @@ -1051,8 +1051,8 @@ void USL_PlayPaddleWar(void)
int16_t ball_y, keen_x, comp_x, bounce_point, ball_real_x, ball_real_y;
int16_t old_keen_x, old_comp_x, old_ball_x, old_ball_y;
int16_t keen_score = 0, comp_score = 0;
int16_t speedup_delay, ball_x_speed;
int32_t start_delay;
int16_t speedup_delay = 10, ball_x_speed;
int32_t start_delay = 70;
uint32_t lasttime, timediff;
IN_ControlFrame status;
int16_t ball_y_speed, ball_x;
Expand Down
2 changes: 1 addition & 1 deletion src/id_rf.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void RF_MarkTileGraphics()
// WARNING: As in the original codebase, the given variable is NOT initialized.
// This may lead to undefined behaviors in calls to RFL_MarkTileWithSound,
// although they aren't reproduced in vanilla Keen 6 in practice.
int i;
int i = 0;
for (int tileY = 0; tileY < rf_mapHeightTiles; ++tileY)
{
for (int tileX = 0; tileX < rf_mapWidthTiles; ++tileX)
Expand Down

0 comments on commit 17d4c8c

Please sign in to comment.