Skip to content

Commit

Permalink
music: use curly braces in GME magic detection
Browse files Browse the repository at this point in the history
Backport from b1d7121
  • Loading branch information
madebr committed Dec 28, 2024
1 parent 8d38408 commit f49c898
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions src/music.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,30 +606,20 @@ Mix_MusicType detect_music_type(SDL_RWops *src)
}

/* GME Specific files */
if (SDL_memcmp(magic, "ZXAY", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "GBS\x01", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "GYMX", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "HESM", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "KSCC", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "KSSX", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "NESM", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "NSFE", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "SAP\x0D", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "SNES", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "Vgm ", 4) == 0)
return MUS_GME;
if (SDL_memcmp(magic, "\x1f\x8b", 2) == 0)
if (SDL_memcmp(magic, "ZXAY", 4) == 0 ||
SDL_memcmp(magic, "GBS\x01", 4) == 0 ||
SDL_memcmp(magic, "GYMX", 4) == 0 ||
SDL_memcmp(magic, "HESM", 4) == 0 ||
SDL_memcmp(magic, "KSCC", 4) == 0 ||
SDL_memcmp(magic, "KSSX", 4) == 0 ||
SDL_memcmp(magic, "NESM", 4) == 0 ||
SDL_memcmp(magic, "NSFE", 4) == 0 ||
SDL_memcmp(magic, "SAP\x0D", 4) == 0 ||
SDL_memcmp(magic, "SNES", 4) == 0 ||
SDL_memcmp(magic, "Vgm ", 4) == 0 ||
SDL_memcmp(magic, "\x1f\x8b", 2) == 0) {
return MUS_GME;
}

/* Assume MOD format.
*
Expand Down

0 comments on commit f49c898

Please sign in to comment.