From d9034ea609c1a43c737911b47f1ee74dc7cdf3eb Mon Sep 17 00:00:00 2001 From: Kp Date: Mon, 15 Oct 2018 00:51:53 +0000 Subject: [PATCH] Remove explicit `=nullptr` in ADL function pointers Global data will default to nullptr, so the initialization is unnecessary. Some compilers may store the pointer in `.data` when it is initialized to any value. --- common/music/adlmidi_dynamic.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/common/music/adlmidi_dynamic.cpp b/common/music/adlmidi_dynamic.cpp index ce9d283d8..29ffeaa1d 100644 --- a/common/music/adlmidi_dynamic.cpp +++ b/common/music/adlmidi_dynamic.cpp @@ -87,12 +87,12 @@ static ADL_MIDIPlayer *adl_init_first_call(long sample_rate) } ADL_MIDIPlayer *(*adl_init)(long sample_rate) = &adl_init_first_call; -void (*adl_close)(ADL_MIDIPlayer *device) = nullptr; -int (*adl_switchEmulator)(ADL_MIDIPlayer *device, int emulator) = nullptr; -int (*adl_setNumChips)(ADL_MIDIPlayer *device, int numChips) = nullptr; -int (*adl_setBank)(ADL_MIDIPlayer *device, int bank) = nullptr; -void (*adl_setSoftPanEnabled)(ADL_MIDIPlayer *device, int softPanEn) = nullptr; -void (*adl_setLoopEnabled)(ADL_MIDIPlayer *device, int loopEn) = nullptr; -int (*adl_openData)(ADL_MIDIPlayer *device, const void *mem, unsigned long size) = nullptr; -int (*adl_openFile)(ADL_MIDIPlayer *device, const char *filePath) = nullptr; -int (*adl_playFormat)(ADL_MIDIPlayer *device, int sampleCount, uint8_t *left, uint8_t *right, const ADLMIDI_AudioFormat *format) = nullptr; +void (*adl_close)(ADL_MIDIPlayer *device); +int (*adl_switchEmulator)(ADL_MIDIPlayer *device, int emulator); +int (*adl_setNumChips)(ADL_MIDIPlayer *device, int numChips); +int (*adl_setBank)(ADL_MIDIPlayer *device, int bank); +void (*adl_setSoftPanEnabled)(ADL_MIDIPlayer *device, int softPanEn); +void (*adl_setLoopEnabled)(ADL_MIDIPlayer *device, int loopEn); +int (*adl_openData)(ADL_MIDIPlayer *device, const void *mem, unsigned long size); +int (*adl_openFile)(ADL_MIDIPlayer *device, const char *filePath); +int (*adl_playFormat)(ADL_MIDIPlayer *device, int sampleCount, uint8_t *left, uint8_t *right, const ADLMIDI_AudioFormat *format);