Skip to content

Commit

Permalink
fixup! Use standard C attributes
Browse files Browse the repository at this point in the history
Signed-off-by: John Bowler <jbowler@acm.org>
  • Loading branch information
jbowler committed Oct 17, 2024
1 parent f4248ec commit c0007f6
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 48 deletions.
8 changes: 0 additions & 8 deletions contrib/arm-neon/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ png_have_neon(png_structp png_ptr)

counter=0;
state = Feature;
/* FALLTHROUGH */

case Feature:
/* Match 'FEATURE', ASCII case insensitive. */
if ((ch & ~0x20) == ch_feature[counter])
Expand All @@ -75,8 +73,6 @@ png_have_neon(png_structp png_ptr)

/* did not match 'feature' */
state = SkipLine;
/* FALLTHROUGH */

case SkipLine:
skipLine:
/* Skip everything until we see linefeed or carriage return */
Expand Down Expand Up @@ -110,8 +106,6 @@ png_have_neon(png_structp png_ptr)

state = Neon;
counter = 0;
/* FALLTHROUGH */

case Neon:
/* Look for 'neon' tag */
if ((ch & ~0x20) == ch_neon[counter])
Expand All @@ -122,8 +116,6 @@ png_have_neon(png_structp png_ptr)
}

state = SkipTag;
/* FALLTHROUGH */

case SkipTag:
/* Skip non-space characters */
if (ch == 10 || ch == 13)
Expand Down
6 changes: 0 additions & 6 deletions contrib/libtests/pngstest.c
Original file line number Diff line number Diff line change
Expand Up @@ -2897,13 +2897,10 @@ compare_two_images(Image *a, Image *b, int via_linear,
{
case 4:
if (pua[btoa[3]] != pub[3]) break;
FALLTHROUGH; /* FALLTHROUGH */
case 3:
if (pua[btoa[2]] != pub[2]) break;
FALLTHROUGH; /* FALLTHROUGH */
case 2:
if (pua[btoa[1]] != pub[1]) break;
FALLTHROUGH; /* FALLTHROUGH */
case 1:
if (pua[btoa[0]] != pub[0]) break;
if (alpha_added != 4 && pub[alpha_added] != 65535) break;
Expand All @@ -2919,13 +2916,10 @@ compare_two_images(Image *a, Image *b, int via_linear,
{
case 4:
if (psa[btoa[3]] != psb[3]) break;
FALLTHROUGH; /* FALLTHROUGH */
case 3:
if (psa[btoa[2]] != psb[2]) break;
FALLTHROUGH; /* FALLTHROUGH */
case 2:
if (psa[btoa[1]] != psb[1]) break;
FALLTHROUGH; /* FALLTHROUGH */
case 1:
if (psa[btoa[0]] != psb[0]) break;
if (alpha_added != 4 && psb[alpha_added] != 255) break;
Expand Down
1 change: 0 additions & 1 deletion contrib/libtests/pngunknown.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ get_unknown(display *d, png_infop info_ptr, int after_IDAT)
++(d->error_count);
break;
}
FALLTHROUGH; /* (safe) */ /* FALLTHROUGH */
case PNG_HANDLE_CHUNK_ALWAYS:
break;
}
Expand Down
4 changes: 0 additions & 4 deletions contrib/libtests/pngvalid.c
Original file line number Diff line number Diff line change
Expand Up @@ -6596,16 +6596,13 @@ transform_info_imp(transform_display *dp, png_structp pp, png_infop pi)
{
case PNG_COLOR_TYPE_PALETTE:
if (dp->output_bit_depth > 8) goto error;
FALLTHROUGH; /* FALLTHROUGH */
case PNG_COLOR_TYPE_GRAY:
if (dp->output_bit_depth == 1 || dp->output_bit_depth == 2 ||
dp->output_bit_depth == 4)
break;
FALLTHROUGH; /* FALLTHROUGH */
default:
if (dp->output_bit_depth == 8 || dp->output_bit_depth == 16)
break;
/* FALLTHROUGH */
error:
{
char message[128];
Expand Down Expand Up @@ -10008,7 +10005,6 @@ gamma_component_validate(const char *name, const validate_info *vi,
use_background = (alpha >= 0 && alpha < 1);
# endif
# ifdef PNG_READ_ALPHA_MODE_SUPPORTED
FALLTHROUGH; /* FALLTHROUGH */
case ALPHA_MODE_OFFSET + PNG_ALPHA_STANDARD:
case ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN:
case ALPHA_MODE_OFFSET + PNG_ALPHA_OPTIMIZED:
Expand Down
8 changes: 0 additions & 8 deletions contrib/tools/pngfix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2405,8 +2405,6 @@ zlib_advance(struct zlib *zlib, png_uint_32 nbytes)
endrc = ZLIB_TOO_FAR_BACK;
break;
}
FALLTHROUGH; /* FALLTHROUGH */

default:
zlib_message(zlib, 0/*stream error*/);
endrc = ZLIB_FATAL;
Expand Down Expand Up @@ -2559,8 +2557,6 @@ zlib_run(struct zlib *zlib)
list->lengths[i] -= zlib->extra_bytes;
list->count = i+1;
zlib->idat->idat_list_tail = list;
FALLTHROUGH; /* FALLTHROUGH */

default:
return rc;
}
Expand Down Expand Up @@ -2662,8 +2658,6 @@ zlib_check(struct file *file, png_uint_32 offset)
/* Truncated stream; unrecoverable, gets converted to ZLIB_FATAL */
zlib.z.msg = PNGZ_MSG_CAST("[truncated]");
zlib_message(&zlib, 0/*expected*/);
FALLTHROUGH; /* FALLTHROUGH */

default:
/* Unrecoverable error; skip the chunk; a zlib_message has already
* been output.
Expand Down Expand Up @@ -3330,8 +3324,6 @@ read_callback(png_structp png_ptr, png_bytep buffer, size_t count)
if (file->state != STATE_IDAT && length > 0)
setpos(chunk);
}
FALLTHROUGH; /* FALLTHROUGH */

default:
assert(chunk != NULL);

Expand Down
4 changes: 0 additions & 4 deletions pngerror.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_02u:
/* Expects at least 2 digits. */
mincount = 2;
PNG_FALLTHROUGH; /* FALLTHROUGH */

case PNG_NUMBER_FORMAT_u:
*--end = digits[number % 10];
number /= 10;
Expand All @@ -172,8 +170,6 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_02x:
/* This format expects at least two digits */
mincount = 2;
PNG_FALLTHROUGH; /* FALLTHROUGH */

case PNG_NUMBER_FORMAT_x:
*--end = digits[number & 0xf];
number >>= 4;
Expand Down
8 changes: 0 additions & 8 deletions pngread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1918,8 +1918,6 @@ png_create_colormap_entry(png_image_read_control *display,
{
case 4:
entry[afirst ? 0 : 3] = (png_uint_16)alpha;
PNG_FALLTHROUGH; /* FALLTHROUGH */

case 3:
if (alpha < 65535)
{
Expand All @@ -1940,8 +1938,6 @@ png_create_colormap_entry(png_image_read_control *display,

case 2:
entry[1 ^ afirst] = (png_uint_16)alpha;
PNG_FALLTHROUGH; /* FALLTHROUGH */

case 1:
if (alpha < 65535)
{
Expand Down Expand Up @@ -1969,7 +1965,6 @@ png_create_colormap_entry(png_image_read_control *display,
{
case 4:
entry[afirst ? 0 : 3] = (png_byte)alpha;
PNG_FALLTHROUGH; /* FALLTHROUGH */
case 3:
entry[afirst + (2 ^ bgr)] = (png_byte)blue;
entry[afirst + 1] = (png_byte)green;
Expand All @@ -1978,7 +1973,6 @@ png_create_colormap_entry(png_image_read_control *display,

case 2:
entry[1 ^ afirst] = (png_byte)alpha;
PNG_FALLTHROUGH; /* FALLTHROUGH */
case 1:
entry[afirst] = (png_byte)green;
break;
Expand Down Expand Up @@ -2898,8 +2892,6 @@ png_image_read_colormap(png_voidp argument)
case P_sRGB:
/* Change to 8-bit sRGB */
png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
PNG_FALLTHROUGH; /* FALLTHROUGH */

case P_FILE:
if (png_ptr->bit_depth > 8)
png_set_scale_16(png_ptr);
Expand Down
4 changes: 0 additions & 4 deletions pngrtran.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ png_set_crc_action(png_structrp png_ptr, int crit_action, int ancil_action)
case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */
png_warning(png_ptr,
"Can't discard critical data on CRC error");
PNG_FALLTHROUGH; /* FALLTHROUGH */
case PNG_CRC_ERROR_QUIT: /* Error/quit */

case PNG_CRC_DEFAULT:
default:
png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK;
Expand Down Expand Up @@ -1251,8 +1249,6 @@ png_init_rgb_transformations(png_structrp png_ptr)
default:

case 8:
PNG_FALLTHROUGH; /* (Already 8 bits) */ /* FALLTHROUGH */

case 16:
/* Already a full 16 bits */
break;
Expand Down
2 changes: 0 additions & 2 deletions pngrutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -3104,7 +3104,6 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
case 2:
png_ptr->user_chunk_cache_max = 1;
png_chunk_benign_error(png_ptr, "no space in chunk cache");
PNG_FALLTHROUGH; /* FALLTHROUGH */
case 1:
/* NOTE: prior to 1.6.0 this case resulted in an unknown critical
* chunk being skipped, now there will be a hard error below.
Expand All @@ -3113,7 +3112,6 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,

default: /* not at limit */
--(png_ptr->user_chunk_cache_max);
PNG_FALLTHROUGH; /* FALLTHROUGH */
case 0: /* no limit */
# endif /* USER_LIMITS */
/* Here when the limit isn't reached or when limits are compiled
Expand Down
3 changes: 0 additions & 3 deletions pngwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,6 @@ png_set_filter(png_structrp png_ptr, int method, int filters)
case 6:
case 7: png_app_error(png_ptr, "Unknown row filter for method 0");
#endif /* WRITE_FILTER */
PNG_FALLTHROUGH; /* FALLTHROUGH */
case PNG_FILTER_VALUE_NONE:
png_ptr->do_filter = PNG_FILTER_NONE; break;

Expand Down Expand Up @@ -1887,7 +1886,6 @@ png_image_set_PLTE(png_image_write_control *display)
tRNS[i] = entry[afirst ? 0 : 3];
if (tRNS[i] < 255)
num_trans = i+1;
PNG_FALLTHROUGH; /* FALLTHROUGH */
case 3:
palette[i].blue = entry[afirst + (2 ^ bgr)];
palette[i].green = entry[afirst + 1];
Expand All @@ -1898,7 +1896,6 @@ png_image_set_PLTE(png_image_write_control *display)
tRNS[i] = entry[1 ^ afirst];
if (tRNS[i] < 255)
num_trans = i+1;
PNG_FALLTHROUGH; /* FALLTHROUGH */
case 1:
palette[i].blue = palette[i].red = palette[i].green =
entry[afirst];
Expand Down

0 comments on commit c0007f6

Please sign in to comment.