Skip to content

Commit

Permalink
Style nits
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Feb 9, 2025
1 parent 376e4b3 commit 0be8fe8
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 142 deletions.
21 changes: 10 additions & 11 deletions libretro-common/lists/nested_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ bool nested_list_add_item(nested_list_t *list,
else
{
string_list_initialize(&id_list);
if (!string_split_noalloc(&id_list, address, delim) ||
(id_list.size < 1))
if ( !string_split_noalloc(&id_list, address, delim)
|| (id_list.size < 1))
goto end;

if (id_list.size == 1)
Expand Down Expand Up @@ -357,8 +357,8 @@ nested_list_item_t *nested_list_get_item(nested_list_t *list,
else
{
string_list_initialize(&id_list);
if (!string_split_noalloc(&id_list, address, delim) ||
(id_list.size < 1))
if ( !string_split_noalloc(&id_list, address, delim)
|| (id_list.size < 1))
goto end;

if (id_list.size == 1)
Expand Down Expand Up @@ -536,10 +536,10 @@ bool nested_list_item_get_address(nested_list_item_t *list_item,
union string_list_elem_attr attr;
size_t i;

if (!list_item ||
string_is_empty(delim) ||
!address ||
(len < 1))
if ( !list_item
|| string_is_empty(delim)
|| !address
|| (len < 1))
goto end;

address[0] = '\0';
Expand All @@ -562,9 +562,8 @@ bool nested_list_item_get_address(nested_list_item_t *list_item,
do
{
const char *id = current_item->id;

if (string_is_empty(id) ||
!string_list_append(&id_list, id, attr))
if ( string_is_empty(id)
|| !string_list_append(&id_list, id, attr))
goto end;

current_item = current_item->parent_item;
Expand Down
34 changes: 17 additions & 17 deletions libretro-common/streams/rzip_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ static bool rzipstream_read_file_header(rzipstream_t *stream)
/* Check 'magic numbers' - first 8 bytes
* of header */
if (
(length < RZIP_HEADER_SIZE) ||
(header_bytes[0] != 35) || /* # */
(header_bytes[1] != 82) || /* R */
(header_bytes[2] != 90) || /* Z */
(header_bytes[3] != 73) || /* I */
(header_bytes[4] != 80) || /* P */
(header_bytes[5] != 118) || /* v */
(header_bytes[6] != RZIP_VERSION) || /* file format version number */
(header_bytes[7] != 35)) /* # */
(length < RZIP_HEADER_SIZE)
|| (header_bytes[0] != 35) /* # */
|| (header_bytes[1] != 82) /* R */
|| (header_bytes[2] != 90) /* Z */
|| (header_bytes[3] != 73) /* I */
|| (header_bytes[4] != 80) /* P */
|| (header_bytes[5] != 118) /* v */
|| (header_bytes[6] != RZIP_VERSION) /* file format version number */
|| (header_bytes[7] != 35)) /* # */
{
/* Reset file to start */
filestream_seek(stream->file, 0, SEEK_SET);
Expand Down Expand Up @@ -270,7 +270,7 @@ static bool rzipstream_init_stream(
stream->in_buf_size = stream->chunk_size;
stream->out_buf_size = stream->chunk_size * 2;
/* > Account for minimum zlib overhead
* of 11 bytes... */
* of 11 bytes... */
stream->out_buf_size =
(stream->out_buf_size < (stream->in_buf_size + 11)) ?
stream->out_buf_size + 11 :
Expand Down Expand Up @@ -385,9 +385,9 @@ rzipstream_t* rzipstream_open(const char *path, unsigned mode)
/* Sanity check
* > Only RETRO_VFS_FILE_ACCESS_READ and
* RETRO_VFS_FILE_ACCESS_WRITE are supported */
if (string_is_empty(path) ||
((mode != RETRO_VFS_FILE_ACCESS_READ) &&
(mode != RETRO_VFS_FILE_ACCESS_WRITE)))
if (string_is_empty(path)
|| ( (mode != RETRO_VFS_FILE_ACCESS_READ)
&& (mode != RETRO_VFS_FILE_ACCESS_WRITE)))
return NULL;

/* If opening in read mode, ensure file exists */
Expand Down Expand Up @@ -506,8 +506,8 @@ static bool rzipstream_read_chunk(rzipstream_t *stream)
if (inflate_read != compressed_chunk_size)
return false;

if ((inflate_written == 0) ||
(inflate_written > stream->out_buf_size))
if ( (inflate_written == 0)
|| (inflate_written > stream->out_buf_size))
return false;

/* Record current output buffer occupancy
Expand Down Expand Up @@ -753,8 +753,8 @@ static bool rzipstream_write_chunk(rzipstream_t *stream)
if (deflate_read != stream->in_buf_ptr)
return false;

if ((deflate_written == 0) ||
(deflate_written > stream->out_buf_size))
if ( (deflate_written == 0)
|| (deflate_written > stream->out_buf_size))
return false;

/* Write compressed chunk size to file */
Expand Down
Loading

0 comments on commit 0be8fe8

Please sign in to comment.