Skip to content

Commit

Permalink
Variable name changes and coding style.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcode committed Sep 4, 2024
1 parent c814b32 commit 1993b6d
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions sources/test-Z80.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,19 +438,19 @@ static zboolean load_test(char const *search_path, Test const *test, void *buffe

if (gz != Z_NULL)
{
union {zuint8 data[Z_TAR_BLOCK_SIZE]; Z_TARPOSIXHeader fields;} header;
union {zuint8 data[Z_TAR_BLOCK_SIZE]; Z_TARPOSIXHeader header;} block;

while (!gzeof(gz))
{
char *end;
zulong file_size, block_tail_size;

if (gzread(gz, header.data, Z_TAR_BLOCK_SIZE) != Z_TAR_BLOCK_SIZE) break;
header.fields.size[Z_ARRAY_SIZE(header.fields.size) - 1] = 0;
file_size = strtoul((char const *)header.fields.size, &end, 8);
if ((zuint8 *)end == header.fields.size || *end) break;
if (gzread(gz, block.data, Z_TAR_BLOCK_SIZE) != Z_TAR_BLOCK_SIZE) break;
block.header.size[Z_ARRAY_SIZE(block.header.size) - 1] = 0;
file_size = strtoul((char const *)block.header.size, &end, 8);
if ((zuint8 *)end == block.header.size || *end) break;

if (!strcmp(test->file_path, (char const *)header.fields.name))
if (!strcmp(test->file_path, (char const *)block.header.name))
{
success =
file_size == test->file_size &&
Expand All @@ -460,9 +460,12 @@ static zboolean load_test(char const *search_path, Test const *test, void *buffe
break;
}

if (-1 == gzseek(gz, (block_tail_size = (file_size % Z_TAR_BLOCK_SIZE))
? file_size + (Z_TAR_BLOCK_SIZE - block_tail_size)
: file_size, SEEK_CUR)
if (-1 == gzseek(
gz,
(block_tail_size = (file_size % Z_TAR_BLOCK_SIZE))
? file_size + (Z_TAR_BLOCK_SIZE - block_tail_size)
: file_size,
SEEK_CUR)
)
break;
}
Expand Down

0 comments on commit 1993b6d

Please sign in to comment.