mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
Skip whitespace when writing compressed core info cache files
This commit is contained in:
parent
6a21eca5df
commit
dec1fd097c
15
core_info.c
15
core_info.c
@ -50,6 +50,11 @@
|
|||||||
|
|
||||||
#define CORE_INFO_CACHE_DEFAULT_CAPACITY 8
|
#define CORE_INFO_CACHE_DEFAULT_CAPACITY 8
|
||||||
|
|
||||||
|
/* TODO/FIXME: Apparently rzip compression is an issue on UWP */
|
||||||
|
#if defined(HAVE_ZLIB) && !(defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
|
||||||
|
#define CORE_INFO_CACHE_COMPRESS
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
core_info_t *items;
|
core_info_t *items;
|
||||||
@ -746,8 +751,7 @@ static void core_info_cache_write(core_info_cache_list_t *list, const char *info
|
|||||||
fill_pathname_join(file_path, info_dir, FILE_PATH_CORE_INFO_CACHE,
|
fill_pathname_join(file_path, info_dir, FILE_PATH_CORE_INFO_CACHE,
|
||||||
sizeof(file_path));
|
sizeof(file_path));
|
||||||
|
|
||||||
/* TODO/FIXME: Apparently rzip compression is an issue on UWP */
|
#if defined(CORE_INFO_CACHE_COMPRESS)
|
||||||
#if defined(HAVE_ZLIB) && !(defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
|
|
||||||
file = intfstream_open_rzip_file(file_path,
|
file = intfstream_open_rzip_file(file_path,
|
||||||
RETRO_VFS_FILE_ACCESS_WRITE);
|
RETRO_VFS_FILE_ACCESS_WRITE);
|
||||||
#else
|
#else
|
||||||
@ -770,6 +774,13 @@ static void core_info_cache_write(core_info_cache_list_t *list, const char *info
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CORE_INFO_CACHE_COMPRESS)
|
||||||
|
/* When compressing info cache, human readability
|
||||||
|
* is not a factor - can skip all indentation
|
||||||
|
* and new line characters */
|
||||||
|
rjsonwriter_set_options(writer, RJSONWRITER_OPTION_SKIP_WHITESPACE);
|
||||||
|
#endif
|
||||||
|
|
||||||
rjsonwriter_add_start_object(writer);
|
rjsonwriter_add_start_object(writer);
|
||||||
rjsonwriter_add_newline(writer);
|
rjsonwriter_add_newline(writer);
|
||||||
rjsonwriter_add_spaces(writer, 2);
|
rjsonwriter_add_spaces(writer, 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user