Skip to content

Commit

Permalink
native_midi: fixed warnings
Browse files Browse the repository at this point in the history
- Non-C90 comments
- Unused arguments
- "Reserved identifier" warning on the `_NATIVE_MIDI_H_` macro name
  • Loading branch information
Wohlstand committed Nov 26, 2019
1 parent 5f7c973 commit b3d8a35
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/codecs/native_midi/native_midi.h
Expand Up @@ -19,8 +19,8 @@
3. This notice may not be removed or altered from any source distribution.
*/

#ifndef _NATIVE_MIDI_H_
#define _NATIVE_MIDI_H_
#ifndef NATIVE_MIDI_H_
#define NATIVE_MIDI_H_

#include "SDL_rwops.h"

Expand All @@ -37,4 +37,4 @@ int native_midi_active(void);
void native_midi_setvolume(int volume);
const char *native_midi_error(void);

#endif /* _NATIVE_MIDI_H_ */
#endif /* NATIVE_MIDI_H_ */
2 changes: 1 addition & 1 deletion src/codecs/native_midi/native_midi_macosx.c
Expand Up @@ -251,7 +251,7 @@ void native_midi_freesong(NativeMidiSong *song)
currentsong = NULL;
MusicPlayerStop(song->player);

// needed to prevent error and memory leak when disposing sequence
/* needed to prevent error and memory leak when disposing sequence */
MusicPlayerSetSequence(song->player, NULL);

DisposeMusicSequence(song->sequence);
Expand Down
10 changes: 7 additions & 3 deletions src/codecs/native_midi/native_midi_win32.c
Expand Up @@ -57,7 +57,7 @@ static int BlockOut(NativeMidiSong *song)

if ((song->MusicLoaded) && (song->NewEvents))
{
// proff 12/8/98: Added for safety
/* proff 12/8/98: Added for safety*/
song->CurrentHdr = !song->CurrentHdr;
hdr = &song->MidiStreamHdr[song->CurrentHdr];
midiOutUnprepareHeader((HMIDIOUT)hMidiStream,hdr,sizeof(MIDIHDR));
Expand Down Expand Up @@ -166,6 +166,10 @@ static void MIDItoStream(NativeMidiSong *song, MIDIEvent *evntlist)
void CALLBACK MidiProc( HMIDIIN hMidi, UINT uMsg, DWORD_PTR dwInstance,
DWORD_PTR dwParam1, DWORD_PTR dwParam2 )
{
(void)hMidi;
(void)dwInstance;
(void)dwParam2;

switch( uMsg )
{
case MOM_DONE:
Expand Down Expand Up @@ -256,10 +260,10 @@ void native_midi_start(NativeMidiSong *song, int loops)
merr=midiStreamOpen(&hMidiStream,&MidiDevice,(DWORD)1,(DWORD_PTR)MidiProc,(DWORD_PTR)0,CALLBACK_FUNCTION);
if (merr!=MMSYSERR_NOERROR)
{
hMidiStream = NULL; // should I do midiStreamClose(hMidiStream) before?
hMidiStream = NULL; /* should I do midiStreamClose(hMidiStream) before? */
return;
}
//midiStreamStop(hMidiStream);
/* midiStreamStop(hMidiStream); */
currentsong=song;
currentsong->NewPos=0;
currentsong->MusicPlaying=1;
Expand Down

0 comments on commit b3d8a35

Please sign in to comment.