From e66fe65f8b32bb86770c6ef3a473c7e10869b263 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Mon, 10 Feb 2014 16:48:50 +0200 Subject: [PATCH] Fix compiler warnings for VS2010 /W4 in picture.c. - Working towards issue #11. --- src/picture.c | 11 ++++------- src/picture.h | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/picture.c b/src/picture.c index 4e64d41a..c2c6ddbe 100644 --- a/src/picture.c +++ b/src/picture.c @@ -101,9 +101,6 @@ void picture_blit_pixels(const pixel *orig, pixel *dst, { unsigned y, x; - const pixel *borig = orig; - const pixel *bdst = dst; - for (y = 0; y < height; ++y) { for (x = 0; x < width; ++x) { dst[x] = orig[x]; @@ -163,7 +160,7 @@ picture_list * picture_list_init(int size) * \param size new array size * \return 1 on success, 0 on failure */ -int picture_list_resize(picture_list *list, int size) +int picture_list_resize(picture_list *list, unsigned size) { unsigned int i; picture** old_pics = NULL; @@ -243,12 +240,12 @@ int picture_list_add(picture_list *list,picture* pic) * \param picture_list list to use * \return 1 on success */ -int picture_list_rem(picture_list *list, int n, int8_t destroy) +int picture_list_rem(picture_list *list, unsigned n, int8_t destroy) { int i; // Must be within list boundaries - if ((unsigned)n >= list->used_size) + if (n >= list->used_size) { return 0; } @@ -264,7 +261,7 @@ int picture_list_rem(picture_list *list, int n, int8_t destroy) list->used_size--; } else { // Shift all following pics one backward in the list - for (i = n; (unsigned)n < list->used_size - 1; ++n) { + for (i = n; n < list->used_size - 1; ++n) { list->pics[n] = list->pics[n + 1]; } list->pics[list->used_size - 1] = NULL; diff --git a/src/picture.h b/src/picture.h index f386c295..bc8e3d2c 100644 --- a/src/picture.h +++ b/src/picture.h @@ -165,10 +165,10 @@ void picture_blit_pixels(const pixel* orig, pixel *dst, unsigned orig_stride, unsigned dst_stride); picture_list * picture_list_init(int size); -int picture_list_resize(picture_list *list, int size); +int picture_list_resize(picture_list *list, unsigned size); int picture_list_destroy(picture_list *list); int picture_list_add(picture_list *list, picture *pic); -int picture_list_rem(picture_list *list, int n, int8_t destroy); +int picture_list_rem(picture_list *list, unsigned n, int8_t destroy); typedef unsigned (*cost_16bit_nxn_func)(pixel *block1, pixel *block2);