From 043977474e61ac2899f12428b95a735ef49ef884 Mon Sep 17 00:00:00 2001 From: orbea Date: Mon, 22 Jul 2019 12:24:41 -0700 Subject: [PATCH] Silence -Wstring-plus-int with clang. cores/libretro-imageviewer/image_core.c:75:59: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] static const char* IMAGE_CORE_PREFIX(valid_extensions) = 1+ /* to remove the first |, the alternative is 25 extra lines of ifdef/etc */ ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cores/libretro-imageviewer/image_core.c:75:59: note: use array indexing to silence this warning 1 warning generated. --- cores/libretro-imageviewer/image_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cores/libretro-imageviewer/image_core.c b/cores/libretro-imageviewer/image_core.c index 831c120af0..7109b3c5ca 100644 --- a/cores/libretro-imageviewer/image_core.c +++ b/cores/libretro-imageviewer/image_core.c @@ -72,7 +72,7 @@ static struct string_list *image_file_list; static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|psd|tga|gif|hdr|pic|ppm|pgm"; #else -static const char* IMAGE_CORE_PREFIX(valid_extensions) = 1+ /* to remove the first |, the alternative is 25 extra lines of ifdef/etc */ +static const char image_formats[] = #ifdef HAVE_RJPEG "|jpg|jpeg" @@ -95,6 +95,9 @@ static const char* IMAGE_CORE_PREFIX(valid_extensions) = 1+ /* to remove the fir #endif ; +/* to remove the first |, the alternative is 25 extra lines of ifdef/etc */ +static const char* IMAGE_CORE_PREFIX(valid_extensions) = image_formats + 1; + #endif void IMAGE_CORE_PREFIX(retro_get_system_info)(struct retro_system_info *info)