diff --git a/src/interface/screenshot.c b/src/interface/screenshot.c index 68716966e8..55f2dd844e 100644 --- a/src/interface/screenshot.c +++ b/src/interface/screenshot.c @@ -179,7 +179,7 @@ void screenshot_giant() int centreX = (mapSize / 2) * 32 + 16; int centreY = (mapSize / 2) * 32 + 16; - int x, y; + int x = 0, y = 0; int z = map_element_height(centreX, centreY) & 0xFFFF; switch (rotation) { case 0: @@ -254,7 +254,7 @@ int cmdline_for_screenshot(const char **argv, int argc) bool customLocation = false; bool centreMapX = false; bool centreMapY = false; - int resolutionWidth, resolutionHeight, customX, customY, customZoom, customRotation; + int resolutionWidth, resolutionHeight, customX = 0, customY = 0, customZoom, customRotation; const char *inputPath = argv[0]; const char *outputPath = argv[1]; @@ -320,7 +320,7 @@ int cmdline_for_screenshot(const char **argv, int argc) if (centreMapY) customY = (mapSize / 2) * 32 + 16; - int x, y; + int x = 0, y = 0; int z = map_element_height(customX, customY) & 0xFFFF; switch (customRotation) { case 0: diff --git a/src/paint/map_element/fence.c b/src/paint/map_element/fence.c index 3953db4c07..3adc1c36dd 100644 --- a/src/paint/map_element/fence.c +++ b/src/paint/map_element/fence.c @@ -251,8 +251,8 @@ void fence_paint(uint8 direction, int height, rct_map_element * map_element) } - uint32 imageOffset; - rct_xyz16 offset, bounds, boundsOffset; + uint32 imageOffset = 0; + rct_xyz16 offset = { 0, 0, 0 }, bounds = { 0, 0, 0 }, boundsOffset; switch (direction) { case 0: diff --git a/src/paint/map_element/map_element.c b/src/paint/map_element/map_element.c index 83173c6ee3..ec1cfd940b 100644 --- a/src/paint/map_element/map_element.c +++ b/src/paint/map_element/map_element.c @@ -104,7 +104,7 @@ static void blank_tiles_paint(int x, int y) { rct_drawpixelinfo *dpi = unk_140E9A8; - int dx; + int dx = 0; switch (get_current_rotation()) { case 0: dx = x + y; diff --git a/src/paint/paint.c b/src/paint/paint.c index b0652e590d..b81f47b15a 100644 --- a/src/paint/paint.c +++ b/src/paint/paint.c @@ -295,7 +295,7 @@ paint_struct * sub_98196C( g_ps_F1AD28 = ps; - sint32 edi; + sint32 edi = 0; switch (rotation) { case 0: edi = coord_3d.y + coord_3d.x; diff --git a/src/peep/peep.c b/src/peep/peep.c index 91e9524269..4e65c2d13a 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -9204,7 +9204,7 @@ static int guest_path_find_park_entrance(rct_peep* peep, rct_map_element *map_el * param dist is not used. */ static void get_ride_queue_end(sint16 *x, sint16 *y, sint16 *z){ - rct_xy16 result; + rct_xy16 result = { 0, 0 }; rct_map_element *mapElement = map_get_first_element_at(*x / 32, *y / 32); bool found = false; @@ -9461,7 +9461,7 @@ static int guest_path_finding(rct_peep* peep) * At the same time, count how many entrance stations there are and * which stations are entrance stations. */ uint16 closestDist = 0xFFFF; - uint8 closestStationNum; + uint8 closestStationNum = 0; int numEntranceStations = 0; uint8 entranceStations = 0; diff --git a/src/ride/coaster/junior_roller_coaster.c b/src/ride/coaster/junior_roller_coaster.c index daa6d10aeb..42e4a50d3a 100644 --- a/src/ride/coaster/junior_roller_coaster.c +++ b/src/ride/coaster/junior_roller_coaster.c @@ -3267,7 +3267,7 @@ static void junior_rc_left_eighth_to_diag_paint_setup(uint8 rideIndex, uint8 tra paint_util_push_tunnel_right(height, TUNNEL_0); } - int blockedSegments; + int blockedSegments = 0; switch (trackSequence) { case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break; case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; break; @@ -3304,7 +3304,7 @@ static void junior_rc_right_eighth_to_diag_paint_setup(uint8 rideIndex, uint8 tr paint_util_push_tunnel_right(height, TUNNEL_0); } - int blockedSegments; + int blockedSegments = 0; switch (trackSequence) { case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break; case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break; @@ -3438,7 +3438,7 @@ static void junior_rc_left_eighth_to_diag_bank_paint_setup(uint8 rideIndex, uint paint_util_push_tunnel_right(height, TUNNEL_0); } - int blockedSegments; + int blockedSegments = 0; switch (trackSequence) { case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break; case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; break; @@ -3556,7 +3556,7 @@ static void junior_rc_right_eighth_to_diag_bank_paint_setup(uint8 rideIndex, uin paint_util_push_tunnel_right(height, TUNNEL_0); } - int blockedSegments; + int blockedSegments = 0; switch (trackSequence) { case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break; case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break; diff --git a/src/ride/gentle/maze.c b/src/ride/gentle/maze.c index cefe4ee6b2..47042e541e 100644 --- a/src/ride/gentle/maze.c +++ b/src/ride/gentle/maze.c @@ -62,7 +62,7 @@ static void maze_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi paint_util_set_segment_support_height(SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); - int base_image_id; + int base_image_id = 0; switch (get_ride(rideIndex)->track_colour_supports[0]) { case 0: base_image_id = SPR_MAZE_BASE_BRICK; break; case 1: base_image_id = SPR_MAZE_BASE_HEDGE; break; diff --git a/src/ride/gentle/spiral_slide.c b/src/ride/gentle/spiral_slide.c index e6d950fb2f..efe2240185 100644 --- a/src/ride/gentle/spiral_slide.c +++ b/src/ride/gentle/spiral_slide.c @@ -52,7 +52,7 @@ enum { }; static void spiral_slide_paint_tile_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { - uint32 image_id; + uint32 image_id = 0; if (direction == 0) image_id = SPIRAL_SLIDE_RIGHT_R0 | gTrackColours[SCHEME_TRACK]; if (direction == 1) image_id = SPIRAL_SLIDE_RIGHT_R1 | gTrackColours[SCHEME_TRACK]; @@ -64,7 +64,7 @@ static void spiral_slide_paint_tile_right(uint8 rideIndex, uint8 trackSequence, } static void spiral_slide_paint_tile_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { - uint32 image_id; + uint32 image_id = 0; if (direction == 0) image_id = SPIRAL_SLIDE_LEFT_R0 | gTrackColours[SCHEME_TRACK]; if (direction == 1) image_id = SPIRAL_SLIDE_LEFT_R1 | gTrackColours[SCHEME_TRACK]; @@ -75,9 +75,7 @@ static void spiral_slide_paint_tile_left(uint8 rideIndex, uint8 trackSequence, u } static void spiral_slide_paint_tile_front(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { - uint32 image_id; - - + uint32 image_id = 0; rct_ride *ride = get_ride(rideIndex); diff --git a/src/ride/ride.c b/src/ride/ride.c index 0ec9c7fa3f..b55ece56d2 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -3434,7 +3434,7 @@ void ride_set_map_tooltip(rct_map_element *mapElement) int ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint16 sampleRate, uint32 position, uint8 *tuneId) { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gGameSoundsOff && g_music_tracking_viewport != (rct_viewport*)-1) { - rct_xy16 rotatedCoords; + rct_xy16 rotatedCoords = { 0, 0 }; switch (get_current_rotation()) { case 0: diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index b55ef762dd..2e4bef1efb 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -209,7 +209,7 @@ bool gUseOriginalRidePaint = false; bool track_paint_util_has_fence(enum edge edge, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint8 rotation) { - rct_xy16 offset; + rct_xy16 offset = { 0, 0 }; switch (edge) { case EDGE_NE: offset = loc_7667AC[rotation]; @@ -427,8 +427,8 @@ bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const r uint32 imageId; uint32 baseImageId = entranceStyle->base_image_id; - int imageOffset; - rct_xyz16 offset, bounds, boundsOffset; + int imageOffset = 0; + rct_xyz16 offset, bounds = { 0, 0, 0 }, boundsOffset = { 0, 0, 0 }; offset = (rct_xyz16) {0, 0, height}; switch (edge) { diff --git a/src/ride/transport/monorail.c b/src/ride/transport/monorail.c index 5999832f5a..d211debda9 100644 --- a/src/ride/transport/monorail.c +++ b/src/ride/transport/monorail.c @@ -850,7 +850,7 @@ static void paint_monorail_track_left_eighth_to_diag(uint8 rideIndex, uint8 trac paint_util_push_tunnel_right(height, TUNNEL_0); } - int blockedSegments; + int blockedSegments = 0; switch (trackSequence) { case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break; case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; break; @@ -894,7 +894,7 @@ static void paint_monorail_track_right_eighth_to_diag(uint8 rideIndex, uint8 tra paint_util_push_tunnel_right(height, TUNNEL_0); } - int blockedSegments; + int blockedSegments = 0; switch (trackSequence) { case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; break; case 1: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break; diff --git a/src/windows/loadsave.c b/src/windows/loadsave.c index 14654908e3..5c2c371c91 100644 --- a/src/windows/loadsave.c +++ b/src/windows/loadsave.c @@ -244,7 +244,7 @@ static bool browse(bool isSave, char *path) desc.type = isSave ? FD_SAVE : FD_OPEN; desc.default_filename = isSave ? path : NULL; - rct_string_id title; + rct_string_id title = STR_NONE; switch (_type & 0x0E) { case LOADSAVETYPE_GAME: title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_GAME : STR_FILE_DIALOG_TITLE_LOAD_GAME;