Rename z variable to status, in C code

This commit is contained in:
Nigel Tao committed 2018-12-28 16:14:03 +11:00
1 parent ce96837b40
commit dd94ad3821
15 files changed
+504 -488

No files matched your search

+14 -14
View File
@@ -55,17 +55,17 @@ const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) {
// variable initialization" warnings.
{
wuffs_gif__decoder dec = ((wuffs_gif__decoder){});
wuffs_base__status z = wuffs_gif__decoder__check_wuffs_version(
const char* status = wuffs_gif__decoder__check_wuffs_version(
&dec, sizeof dec, WUFFS_VERSION);
if (z) {
ret = z;
if (status) {
ret = status;
goto exit;
}
wuffs_base__image_config ic = ((wuffs_base__image_config){});
z = wuffs_gif__decoder__decode_image_config(&dec, &ic, src_reader);
if (z) {
ret = z;
status = wuffs_gif__decoder__decode_image_config(&dec, &ic, src_reader);
if (status) {
ret = status;
goto exit;
}
if (!wuffs_base__image_config__is_valid(&ic)) {
@@ -96,19 +96,19 @@ const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) {
}
wuffs_base__pixel_buffer pb = ((wuffs_base__pixel_buffer){});
z = wuffs_base__pixel_buffer__set_from_slice(&pb, &ic.pixcfg, pixbuf);
if (z) {
ret = z;
status = wuffs_base__pixel_buffer__set_from_slice(&pb, &ic.pixcfg, pixbuf);
if (status) {
ret = status;
goto exit;
}
bool seen_ok = false;
while (true) {
z = wuffs_gif__decoder__decode_frame(&dec, &pb, src_reader, workbuf,
NULL);
if (z) {
if ((z != wuffs_base__warning__end_of_data) || !seen_ok) {
ret = z;
status = wuffs_gif__decoder__decode_frame(&dec, &pb, src_reader, workbuf,
NULL);
if (status) {
if ((status != wuffs_base__warning__end_of_data) || !seen_ok) {
ret = status;
}
goto exit;
}
+6 -6
View File
@@ -48,10 +48,10 @@ It should print "PASS", amongst other information, and exit(0).
const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) {
wuffs_zlib__decoder dec = ((wuffs_zlib__decoder){});
wuffs_base__status z =
const char* status =
wuffs_zlib__decoder__check_wuffs_version(&dec, sizeof dec, WUFFS_VERSION);
if (z) {
return z;
if (status) {
return status;
}
// Ignore the checksum for 99.99%-ish of all input. When fuzzers generate
@@ -71,8 +71,8 @@ const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) {
while (true) {
dst.meta.wi = 0;
z = wuffs_zlib__decoder__decode(&dec, dst_writer, src_reader);
if (z != wuffs_base__suspension__short_write) {
status = wuffs_zlib__decoder__decode(&dec, dst_writer, src_reader);
if (status != wuffs_base__suspension__short_write) {
break;
}
if (dst.meta.wi == 0) {
@@ -80,5 +80,5 @@ const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) {
intentional_segfault();
}
}
return z;
return status;
}