diff --git a/src/config.c b/src/config.c index 647f59e4f7..cd6057d65b 100644 --- a/src/config.c +++ b/src/config.c @@ -1493,7 +1493,7 @@ static void title_sequence_open(const char *path, const char *customName) token = &parts[0 * 128]; part1 = &parts[1 * 128]; part2 = &parts[2 * 128]; - title_command command; + title_command command = { 0 }; command.command = 0xFF; if (token[0] != 0) { diff --git a/src/peep/staff.c b/src/peep/staff.c index 3d44d0cb53..b187d632b3 100644 --- a/src/peep/staff.c +++ b/src/peep/staff.c @@ -389,6 +389,7 @@ uint16 hire_new_staff_member(uint8 staffType) RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = STR_CANT_HIRE_NEW_STAFF; int eax, ebx, ecx, edx, esi, edi, ebp; + ecx = edx = esi = edi = ebp = 0; eax = 0x8000; ebx = staffType << 8 | GAME_COMMAND_FLAG_APPLY; diff --git a/src/ride/ride.c b/src/ride/ride.c index bb7261ad5b..573251d0d1 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -850,6 +850,7 @@ int ride_create_ride(ride_list_item listItem) ebx = GAME_COMMAND_FLAG_APPLY; edi = 0; esi = 0; + ebp = 0; RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = 0x3DC; @@ -1194,7 +1195,7 @@ int sub_6C683D(int* x, int* y, int* z, int direction, int type, uint16 extra_par mapElement->properties.track.colour &= 0x0F; mapElement->properties.track.colour |= (extra_params & 0xFF) << 4; } - + if (flags & (1 << 3)) { track_element_set_cable_lift(mapElement); } @@ -5562,7 +5563,7 @@ void game_command_callback_ride_remove_track_piece(int eax, int ebx, int ecx, in z = gRideRemoveTrackPieceCallbackZ; direction = gRideRemoveTrackPieceCallbackDirection; type = gRideRemoveTrackPieceCallbackType; - + window_ride_construction_mouseup_demolish_next_piece(x, y, z, direction, type); } @@ -6412,9 +6413,9 @@ static void ride_update_vehicle_colours(int rideIndex) { rct_ride *ride; rct_vehicle *vehicle; - rct_vehicle_colour colours; + rct_vehicle_colour colours = { 0 }; uint16 spriteIndex; - uint8 coloursExtended; + uint8 coloursExtended = 0; ride = GET_RIDE(rideIndex); if (ride->type == RIDE_TYPE_SPACE_RINGS || ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_16)) { diff --git a/src/scenario.c b/src/scenario.c index 4d94b7be70..6975421c80 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -497,7 +497,7 @@ void scenario_success_submit_name(const char *name) **/ void scenario_entrance_fee_too_high_check() { - uint16 x, y; + uint16 x = 0, y = 0; uint16 totalRideValue = RCT2_GLOBAL(RCT2_TOTAL_RIDE_VALUE, uint16); uint16 park_entrance_fee = RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, uint16); int max_fee = totalRideValue + (totalRideValue / 2); diff --git a/src/windows/map.c b/src/windows/map.c index 163604d879..7c46d62645 100644 --- a/src/windows/map.c +++ b/src/windows/map.c @@ -1597,7 +1597,7 @@ static uint16 map_window_get_pixel_colour_ride(int x, int y) static void map_window_set_pixels(rct_window *w) { - uint16 colour, *destination; + uint16 colour = 0, *destination; int x, y, dx, dy; destination = (uint16*)((RCT2_GLOBAL(0x00F1AD6C, uint32) * 511) + RCT2_GLOBAL(RCT2_ADDRESS_MAP_IMAGE_DATA, uint32) + 255); diff --git a/src/windows/park.c b/src/windows/park.c index 6b32b71bed..91be02ae90 100644 --- a/src/windows/park.c +++ b/src/windows/park.c @@ -1053,6 +1053,7 @@ static void window_park_entrance_paint(rct_window *w, rct_drawpixelinfo *dpi) static void window_park_init_viewport(rct_window *w) { int i, x, y, z, r, xy, zr, viewportFlags; + x = y = z = r = xy = zr = 0; rct_viewport *viewport; rct_widget *viewportWidget; diff --git a/src/windows/ride.c b/src/windows/ride.c index b04e0f2cb7..b6f44dde0b 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -5341,6 +5341,9 @@ static void window_ride_graphs_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi top = measurement->lateral[x] + 52; bottom = measurement->lateral[x + 1] + 52; break; + default: + log_error("Wrong graph type %d", listType); + top = bottom = 0; } top = widget->bottom - widget->top - top - 13; diff --git a/src/windows/ride_construction.c b/src/windows/ride_construction.c index 02de05c631..b3dae4b8de 100644 --- a/src/windows/ride_construction.c +++ b/src/windows/ride_construction.c @@ -2273,7 +2273,7 @@ static void sub_6CBCE2( offsetX = -trackBlock->y; offsetY = trackBlock->x; bl = rol8(bl, 3); - bh |= bl; + bh = bl; bh = ror8(bh, 4); bl &= 0x88; bh &= 0x77; diff --git a/src/windows/title_editor.c b/src/windows/title_editor.c index eb82afe2a8..41c2974acd 100644 --- a/src/windows/title_editor.c +++ b/src/windows/title_editor.c @@ -943,7 +943,7 @@ void window_title_editor_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int gfx_fill_rect(dpi, x, y, x + SCROLL_WIDTH + 100, y + ROW_HEIGHT - 1, ColourMapA[w->colours[1]].lighter | 0x1000000); } - rct_string_id commandName; + rct_string_id commandName = STR_NONE; switch (command->command) { case TITLE_SCRIPT_LOAD: commandName = 5415; @@ -984,6 +984,8 @@ void window_title_editor_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int case TITLE_SCRIPT_END: commandName = 5426; break; + default: + log_warning("Unknown command %d", command->command); } if ((selected || hover) && !error) { diff --git a/src/windows/track_place.c b/src/windows/track_place.c index c879b4907a..85365c9dc9 100644 --- a/src/windows/track_place.c +++ b/src/windows/track_place.c @@ -352,6 +352,7 @@ static void window_track_place_attempt_placement(int x, int y, int z, int bl, mo int eax, ebx, ecx, edx, esi, edi, ebp; money32 result; + edx = esi = ebp = 0; eax = x; ebx = bl; ecx = y;