From 31ab7c8b98df38e201e277bf6e407442ba01b8b1 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Fri, 6 Nov 2015 18:50:37 +0000 Subject: [PATCH] fix several warnings --- src/interface/viewport.c | 6 +++--- src/interface/viewport.h | 2 +- src/util/sawyercoding.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/interface/viewport.c b/src/interface/viewport.c index 8ca614981f..2460b4f9b1 100644 --- a/src/interface/viewport.c +++ b/src/interface/viewport.c @@ -337,7 +337,7 @@ void sub_6E7FF3(rct_window *window, rct_viewport *viewport, int x, int y) viewport->x >= window->x + window->width || viewport->y + viewport->height <= window->y || viewport->y >= window->y + window->height) - return sub_6E7FF3(window + 1, viewport, x, y); + sub_6E7FF3(window + 1, viewport, x, y); // save viewport rct_viewport view_copy; @@ -2908,7 +2908,7 @@ void screen_get_map_xy_side_with_z(sint16 screenX, sint16 screenY, sint16 z, sin * * @returns rotation in range 0-3 (inclusive) */ -uint32 get_current_rotation() +uint8 get_current_rotation() { uint32 rotation = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32); uint32 rotation_masked = rotation & 3; @@ -2917,5 +2917,5 @@ uint32 get_current_rotation() log_error("Found wrong rotation %d! Will return %d instead.", rotation, rotation_masked); } #endif // DEBUG_LEVEL_1 - return rotation_masked; + return (uint8)rotation_masked; } diff --git a/src/interface/viewport.h b/src/interface/viewport.h index af722d3885..d475b00481 100644 --- a/src/interface/viewport.h +++ b/src/interface/viewport.h @@ -144,6 +144,6 @@ void screen_get_map_xy_quadrant_with_z(sint16 screenX, sint16 screenY, sint16 z, void screen_get_map_xy_side(sint16 screenX, sint16 screenY, sint16 *mapX, sint16 *mapY, uint8 *side); void screen_get_map_xy_side_with_z(sint16 screenX, sint16 screenY, sint16 z, sint16 *mapX, sint16 *mapY, uint8 *side); -uint32 get_current_rotation(); +uint8 get_current_rotation(); #endif diff --git a/src/util/sawyercoding.c b/src/util/sawyercoding.c index 90abde0744..d73bda1fda 100644 --- a/src/util/sawyercoding.c +++ b/src/util/sawyercoding.c @@ -408,7 +408,7 @@ static size_t encode_chunk_repeat(const uint8 *src_buffer, uint8 *dst_buffer, si *dst_buffer++ = src_buffer[0]; outLength += 2; - // Itereate through remainder of the source buffer + // Iterate through remainder of the source buffer for (i = 1; i < length; ) { searchIndex = max(0, i - 32); searchEnd = i - 1; @@ -440,7 +440,7 @@ static size_t encode_chunk_repeat(const uint8 *src_buffer, uint8 *dst_buffer, si outLength += 2; i++; } else { - *dst_buffer++ = (bestRepeatCount - 1) | ((32 - (i - bestRepeatIndex)) << 3); + *dst_buffer++ = (uint8)((bestRepeatCount - 1) | ((32 - (i - bestRepeatIndex)) << 3)); outLength++; i += bestRepeatCount; }