From d70cd3775e4eb859baeb170f9268cb3d1d08d4f4 Mon Sep 17 00:00:00 2001 From: Ted John Date: Thu, 12 Jan 2017 18:40:49 +0000 Subject: [PATCH] Fix silent warnings --- src/openrct2/paint/map_element/fence.c | 2 +- src/openrct2/paint/map_element/surface.c | 1 + src/openrct2/platform/windows.c | 4 ++-- .../ride/transport/miniature_railway.c | 20 +++++++++++-------- src/openrct2/world/map_helpers.c | 1 + 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/openrct2/paint/map_element/fence.c b/src/openrct2/paint/map_element/fence.c index 0f9fdfb2b3..17ae19551d 100644 --- a/src/openrct2/paint/map_element/fence.c +++ b/src/openrct2/paint/map_element/fence.c @@ -252,7 +252,7 @@ void fence_paint(uint8 direction, int height, rct_map_element * map_element) uint32 imageOffset = 0; - rct_xyz16 offset = { 0, 0, 0 }, bounds = { 0, 0, 0 }, boundsOffset; + rct_xyz16 offset = { 0, 0, 0 }, bounds = { 0, 0, 0 }, boundsOffset = { 0, 0, 0 }; switch (direction) { case 0: diff --git a/src/openrct2/paint/map_element/surface.c b/src/openrct2/paint/map_element/surface.c index ef71e0811e..77ccd3f276 100644 --- a/src/openrct2/paint/map_element/surface.c +++ b/src/openrct2/paint/map_element/surface.c @@ -1407,6 +1407,7 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement) rct_xy16 box_offset, box_size; uint32 image_1, image_2, image_3; switch (i) { + default: case 0: // Bottom right bit_1 = 1; diff --git a/src/openrct2/platform/windows.c b/src/openrct2/platform/windows.c index 4c3728bda5..4a0443ebdb 100644 --- a/src/openrct2/platform/windows.c +++ b/src/openrct2/platform/windows.c @@ -1076,9 +1076,10 @@ static bool windows_setup_file_association( get_progIdName(progIdNameW, extension); bool result = false; + HKEY hKey = NULL; + HKEY hRootKey = NULL; // [HKEY_CURRENT_USER\Software\Classes] - HKEY hRootKey = NULL; if (RegOpenKeyW(HKEY_CURRENT_USER, SOFTWARE_CLASSES, &hRootKey) != ERROR_SUCCESS) { goto fail; } @@ -1088,7 +1089,6 @@ static bool windows_setup_file_association( goto fail; } - HKEY hKey = NULL; if (RegCreateKeyW(hRootKey, progIdNameW, &hKey) != ERROR_SUCCESS) { goto fail; } diff --git a/src/openrct2/ride/transport/miniature_railway.c b/src/openrct2/ride/transport/miniature_railway.c index 7b67e94558..45d43dcd6b 100644 --- a/src/openrct2/ride/transport/miniature_railway.c +++ b/src/openrct2/ride/transport/miniature_railway.c @@ -1581,8 +1581,9 @@ static void miniature_railway_track_diag_25_deg_up(uint8 rideIndex, uint8 trackS bool hasSupports = false; - uint32 floorImage; - rct_xy16 floorBoundSize, floorBoundOffset = {0, 0}; + uint32 floorImage = 0; + rct_xy16 floorBoundSize = { 0 }; + rct_xy16 floorBoundOffset = { 0 }; if (supportType != -1) { floorImage = floors[supportType].image_id; @@ -1687,8 +1688,9 @@ static void miniature_railway_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint bool hasSupports = false; sint16 supportType = monorail_diag_support_types[direction][trackSequence]; - uint32 floorImage; - rct_xy16 floorBoundSize, floorBoundOffset = {0, 0}; + uint32 floorImage = 0; + rct_xy16 floorBoundSize = { 0 }; + rct_xy16 floorBoundOffset = { 0 }; if (supportType != -1) { floorImage = floors[supportType].image_id; @@ -1750,8 +1752,9 @@ static void miniature_railway_track_diag_25_deg_down(uint8 rideIndex, uint8 trac bool hasSupports = false; - uint32 floorImage; - rct_xy16 floorBoundSize, floorBoundOffset = {0, 0}; + uint32 floorImage = 0; + rct_xy16 floorBoundSize = { 0 }; + rct_xy16 floorBoundOffset = { 0 }; sint16 supportType = monorail_diag_support_types[direction][trackSequence]; if (supportType != -1) { @@ -1812,8 +1815,9 @@ static void miniature_railway_track_diag_flat_to_25_deg_down(uint8 rideIndex, ui } bool hasSupports = false; - uint32 floorImage; - rct_xy16 floorBoundSize, floorBoundOffset = {0, 0}; + uint32 floorImage = 0; + rct_xy16 floorBoundSize = { 0 }; + rct_xy16 floorBoundOffset = { 0 }; sint16 supportType = monorail_diag_support_types[direction][trackSequence]; if (supportType != -1) { diff --git a/src/openrct2/world/map_helpers.c b/src/openrct2/world/map_helpers.c index ed7056e45a..d2bede622c 100644 --- a/src/openrct2/world/map_helpers.c +++ b/src/openrct2/world/map_helpers.c @@ -62,6 +62,7 @@ int map_smooth(int l, int t, int r, int b) // the extra height slope. int highestOnLowestSide; switch (i){ + default: case 0: highestOnLowestSide = max( map_get_surface_element_at(x + 1, y)->base_height,