libgme / game-music-emu

Blargg's video game music emulation library, which allows audio applications to easily add playback support for the music of many classic video game consoles.
GNU Lesser General Public License v2.1
59 stars 12 forks source link

fix -Wcalloc-transposed-args warning from gcc14 #93

Closed sezero closed 1 month ago

sezero commented 1 month ago

Fixes this warning from new gcc-14:

/tmp/libgme/gme/ext/emu2413.c: In function 'OPLL_new':
/tmp/libgme/gme/ext/emu2413.c:1003:35: warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
 1003 |   opll = (OPLL *) calloc (sizeof (OPLL), 1);
      |                                   ^~~~
/tmp/libgme/gme/ext/emu2413.c:1003:35: note: earlier argument should specify number of elements, later size of each element
Wohlstand commented 1 month ago

Good catch! Thanks!