From 9c4b927b17f327fb57e797f7ede8f1e0d884b076 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 26 Jan 2016 05:48:31 +0100 Subject: [PATCH] Style nits --- content.c | 21 ++++++++++++++------- file_ops.c | 30 +++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/content.c b/content.c index 987a27d5ce..2e865b93d8 100644 --- a/content.c +++ b/content.c @@ -99,7 +99,8 @@ static bool read_content_file(unsigned i, const char *path, void **buf, #ifdef HAVE_ZLIB content_ctl(CONTENT_CTL_GET_CRC, &content_crc_ptr); - *content_crc_ptr = stream_backend->stream_crc_calculate(0, ret_buf, *length); + *content_crc_ptr = stream_backend->stream_crc_calculate( + 0, ret_buf, *length); RARCH_LOG("CRC32: 0x%x .\n", (unsigned)*content_crc_ptr); #endif @@ -313,7 +314,8 @@ static bool load_ram_file(ram_type_t *ram) { if (rc > (ssize_t)size) { - RARCH_WARN("SRAM is larger than implementation expects, doing partial load (truncating %u %s %s %u).\n", + RARCH_WARN("SRAM is larger than implementation expects, " + "doing partial load (truncating %u %s %s %u).\n", (unsigned)rc, msg_hash_to_str(MSG_BYTES), msg_hash_to_str(MSG_TO), @@ -490,7 +492,8 @@ static bool load_content( if (require_content && string_is_empty(path)) { - RARCH_LOG("libretro core requires content, but nothing was provided.\n"); + RARCH_LOG("libretro core requires content, " + "but nothing was provided.\n"); return false; } @@ -557,13 +560,15 @@ static bool init_content_file_subsystem( if (special->num_roms && !global->subsystem_fullpaths) { - RARCH_ERR("libretro core requires special content, but none were provided.\n"); + RARCH_ERR("libretro core requires special content, " + "but none were provided.\n"); return false; } else if (special->num_roms && special->num_roms != global->subsystem_fullpaths->size) { - RARCH_ERR("libretro core requires %u content files for subsystem \"%s\", but %u content files were provided.\n", + RARCH_ERR("libretro core requires %u content files for " + "subsystem \"%s\", but %u content files were provided.\n", special->num_roms, special->desc, (unsigned)global->subsystem_fullpaths->size); return false; @@ -571,7 +576,8 @@ static bool init_content_file_subsystem( else if (!special->num_roms && global->subsystem_fullpaths && global->subsystem_fullpaths->size) { - RARCH_ERR("libretro core takes no content for subsystem \"%s\", but %u content files were provided.\n", + RARCH_ERR("libretro core takes no content for subsystem \"%s\", " + "but %u content files were provided.\n", special->desc, (unsigned)global->subsystem_fullpaths->size); return false; @@ -686,7 +692,8 @@ static bool init_content_file_set_attribs( #ifdef HAVE_ZLIB /* Try to extract all content we're going to load if appropriate. */ - if (!init_content_file_extract(temporary_content, content, system, special, &attr)) + if (!init_content_file_extract(temporary_content, + content, system, special, &attr)) return false; #endif return true; diff --git a/file_ops.c b/file_ops.c index 3b867ff369..3a050f16d9 100644 --- a/file_ops.c +++ b/file_ops.c @@ -161,7 +161,8 @@ static int read_7zip_file( } SzArEx_GetFileNameUtf16(&db, i, temp); - res = utf16_to_char_string(temp, infile, sizeof(infile)) ? SZ_OK : SZ_ERROR_FAIL; + res = utf16_to_char_string(temp, infile, sizeof(infile)) + ? SZ_OK : SZ_ERROR_FAIL; if (string_is_equal(infile, needle)) { @@ -307,7 +308,8 @@ static struct string_list *compressed_7zip_file_list_new( } SzArEx_GetFileNameUtf16(&db, i, temp); - res = utf16_to_char_string(temp, infile, sizeof(infile)) ? SZ_OK : SZ_ERROR_FAIL; + res = utf16_to_char_string(temp, infile, sizeof(infile)) + ? SZ_OK : SZ_ERROR_FAIL; file_ext = path_get_extension(infile); if (string_list_find_elem_prefix(ext_list, ".", file_ext)) @@ -395,14 +397,17 @@ static int zip_file_decompressed(const char *name, const char *valid_exts, int ret = 0; file_archive_file_handle_t handle = {0}; handle.backend = file_archive_get_default_file_backend(); - if (!handle.backend->stream_decompress_data_to_file_init(&handle, cdata, csize, size)) + if (!handle.backend->stream_decompress_data_to_file_init( + &handle, cdata, csize, size)) return false; do{ - ret = handle.backend->stream_decompress_data_to_file_iterate(handle.stream); + ret = handle.backend->stream_decompress_data_to_file_iterate( + handle.stream); }while(ret == 0); - handle.real_checksum = handle.backend->stream_crc_calculate(0, handle.data, size); + handle.real_checksum = handle.backend->stream_crc_calculate(0, + handle.data, size); if (handle.real_checksum != crc32) { @@ -440,11 +445,16 @@ static int read_zip_file(const char *path, zlib.type = ZLIB_TRANSFER_INIT; - st.needle = needle ? strdup(needle) : NULL; - st.opt_file = optional_outfile ? strdup(optional_outfile) : NULL; + st.needle = NULL; + st.opt_file = NULL; st.found = false; st.buf = buf; + if (needle) + st.needle = strdup(needle); + if (optional_outfile) + st.opt_file = strdup(optional_outfile); + do { ret = file_archive_parse_file_iterate(&zlib, &returnerr, path, @@ -509,7 +519,8 @@ int read_compressed_file(const char * path, void **buf, #ifdef HAVE_7ZIP if (string_is_equal_noncase(file_ext, "7z")) { - *length = read_7zip_file(str_list->elems[0].data, str_list->elems[1].data, buf, optional_filename); + *length = read_7zip_file(str_list->elems[0].data, + str_list->elems[1].data, buf, optional_filename); if (*length != -1) ret = 1; } @@ -518,7 +529,8 @@ int read_compressed_file(const char * path, void **buf, if (string_is_equal_noncase(file_ext, "zip")) { stream_backend = file_archive_get_default_file_backend(); - *length = read_zip_file(str_list->elems[0].data, str_list->elems[1].data, buf, optional_filename); + *length = read_zip_file(str_list->elems[0].data, + str_list->elems[1].data, buf, optional_filename); if (*length != -1) ret = 1; }