From 99c9118a58c5d13c74aaffb93858ebe7b29adcad Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Fri, 20 Nov 2015 13:54:17 +0000 Subject: Remove unnecessary malloc casts --- src/navigator.c | 2 +- src/texture.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/navigator.c b/src/navigator.c index 7ece6a0..c6dff06 100644 --- a/src/navigator.c +++ b/src/navigator.c @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. void imv_init_navigator(struct imv_navigator *nav) { nav->buf_size = 512; - nav->paths = (char **)malloc(sizeof(char*) * nav->buf_size); + nav->paths = malloc(sizeof(char*) * nav->buf_size); nav->num_paths = 0; nav->cur_path = 0; nav->last_move_direction = 1; diff --git a/src/texture.c b/src/texture.c index a882320..aa5a4f0 100644 --- a/src/texture.c +++ b/src/texture.c @@ -69,7 +69,7 @@ int imv_texture_set_image(struct imv_texture *tex, FIBITMAP *image) } tex->num_chunks = tex->num_chunks_wide * tex->num_chunks_tall; - tex->chunks = (SDL_Texture**)malloc(sizeof(SDL_Texture*) * tex->num_chunks); + tex->chunks = malloc(sizeof(SDL_Texture*) * tex->num_chunks); int failed_at = -1; for(int y = 0; y < tex->num_chunks_tall; ++y) { @@ -101,7 +101,7 @@ int imv_texture_set_image(struct imv_texture *tex, FIBITMAP *image) return 1; } - BYTE* pixels = (BYTE*)malloc(4 * tex->width * tex->height); + BYTE* pixels = malloc(4 * tex->width * tex->height); FreeImage_ConvertToRawBits(pixels, image, 4 * tex->width, 32, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK, TRUE); -- cgit v1.2.3