From 2166db91e262570459a5876c229cdf06abe4165c Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 19 May 2011 22:51:23 +0200 Subject: [PATCH] Fix awkward compiler warning. --- gfx/image.c | 6 ++++-- screenshot.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gfx/image.c b/gfx/image.c index d688760271..c25ca37869 100644 --- a/gfx/image.c +++ b/gfx/image.c @@ -67,11 +67,13 @@ bool texture_image_load(const char *path, struct texture_image *out_img) if (!strstr(path, ".tga")) return false; - uint8_t *buf = NULL; - ssize_t len = read_file(path, (void**)&buf); + void *raw_buf = NULL; + ssize_t len = read_file(path, &raw_buf); if (len < 0) return false; + uint8_t *buf = raw_buf; + if (buf[2] != 2) // Uncompressed RGB { free(buf); diff --git a/screenshot.c b/screenshot.c index 9b988f32b9..e867691312 100644 --- a/screenshot.c +++ b/screenshot.c @@ -64,8 +64,8 @@ static void dump_content(FILE *file, const uint16_t *frame, unsigned width, unsi // BMP likes reverse ordering for some reason :v for (int j = height - 1; j >= 0; j--) { - uint8_t * restrict dst = line; - const uint16_t * restrict src = frame + j * pitch; + uint8_t *dst = line; + const uint16_t *src = frame + j * pitch; for (unsigned i = 0; i < width; i++) { uint16_t pixel = *src++; @@ -87,7 +87,7 @@ bool screenshot_dump(const char *folder, const uint16_t *frame, time_t cur_time; time(&cur_time); - char timefmt[64]; + char timefmt[128]; strftime(timefmt, sizeof(timefmt), "SSNES-%m%d-%H%M%S.bmp", localtime(&cur_time)); char filename[256];