diff --git a/libretro-common/formats/png/rpng_common.h b/libretro-common/formats/png/rpng_common.h index d808fb8eab..902c49057c 100644 --- a/libretro-common/formats/png/rpng_common.h +++ b/libretro-common/formats/png/rpng_common.h @@ -78,27 +78,5 @@ static INLINE uint32_t dword_be(const uint8_t *buf) return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3] << 0); } -static INLINE enum png_chunk_type png_chunk_type(const struct png_chunk *chunk) -{ - unsigned i; - struct - { - const char *id; - enum png_chunk_type type; - } static const chunk_map[] = { - { "IHDR", PNG_CHUNK_IHDR }, - { "IDAT", PNG_CHUNK_IDAT }, - { "IEND", PNG_CHUNK_IEND }, - { "PLTE", PNG_CHUNK_PLTE }, - }; - - for (i = 0; i < ARRAY_SIZE(chunk_map); i++) - { - if (memcmp(chunk->type, chunk_map[i].id, 4) == 0) - return chunk_map[i].type; - } - - return PNG_CHUNK_NOOP; -} #endif diff --git a/libretro-common/formats/png/rpng_decode_common.h b/libretro-common/formats/png/rpng_decode_common.h index 0fa82527f9..a791a389fe 100644 --- a/libretro-common/formats/png/rpng_decode_common.h +++ b/libretro-common/formats/png/rpng_decode_common.h @@ -23,6 +23,29 @@ #ifndef _RPNG_DECODE_COMMON_H #define _RPNG_DECODE_COMMON_H +static enum png_chunk_type png_chunk_type(const struct png_chunk *chunk) +{ + unsigned i; + struct + { + const char *id; + enum png_chunk_type type; + } static const chunk_map[] = { + { "IHDR", PNG_CHUNK_IHDR }, + { "IDAT", PNG_CHUNK_IDAT }, + { "IEND", PNG_CHUNK_IEND }, + { "PLTE", PNG_CHUNK_PLTE }, + }; + + for (i = 0; i < ARRAY_SIZE(chunk_map); i++) + { + if (memcmp(chunk->type, chunk_map[i].id, 4) == 0) + return chunk_map[i].type; + } + + return PNG_CHUNK_NOOP; +} + static void copy_line_rgb(uint32_t *data, const uint8_t *decoded, unsigned width, unsigned bpp) {