Skip to content

Commit

Permalink
load_voc.c, music_flac.c: fix implicit-fallthrough warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Dec 18, 2019
1 parent 7775b66 commit 8851679
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/codecs/load_voc.c
Expand Up @@ -301,7 +301,7 @@ static int voc_get_block(SDL_RWops *src, vs_t *v, SDL_AudioSpec *spec)
if (SDL_RWread(src, trash, sizeof (Uint8), 2) != 2)
return 0;

/* Falling! Falling! */
/* fallthrough */

default: /* text block or other krapola. */
for(i = 0; i < sblen; i++)
Expand Down Expand Up @@ -351,12 +351,12 @@ static Uint32 voc_read(SDL_RWops *src, vs_t *v, Uint8 *buf, SDL_AudioSpec *spec)
if (v->size == ST_SIZE_WORD)
{
#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
Uint16 *samples = (Uint16 *)buf;
for (; v->rest > 0; v->rest -= 2)
{
*samples = SDL_SwapLE16(*samples);
samples++;
}
Uint16 *samples = (Uint16 *)buf;
for (; v->rest > 0; v->rest -= 2)
{
*samples = SDL_SwapLE16(*samples);
samples++;
}
#endif
done >>= 1;
}
Expand Down
5 changes: 2 additions & 3 deletions src/codecs/music_flac.c
Expand Up @@ -555,9 +555,9 @@ static void *FLAC_CreateFromRW(SDL_RWops *src, int freesrc)
if (was_error) {
switch (init_stage) {
case 2:
flac.FLAC__stream_decoder_finish(music->flac_decoder);
flac.FLAC__stream_decoder_finish(music->flac_decoder); /* fallthrough */
case 1:
flac.FLAC__stream_decoder_delete(music->flac_decoder);
flac.FLAC__stream_decoder_delete(music->flac_decoder); /* fallthrough */
case 0:
SDL_free(music);
break;
Expand All @@ -568,7 +568,6 @@ static void *FLAC_CreateFromRW(SDL_RWops *src, int freesrc)
/* loop_start, loop_end and loop_len get set by metadata callback if tags
* are present in metadata.
*/

full_length = flac.FLAC__stream_decoder_get_total_samples(music->flac_decoder);
if (((music->loop_start >= 0) || (music->loop_end > 0)) &&
((music->loop_start < music->loop_end) || (music->loop_end > 0)) &&
Expand Down

0 comments on commit 8851679

Please sign in to comment.