timidity/readmidi.c (dumpstring): SNDDBG() is an empty macro: skip the text.
authorOzkan Sezer
Sun, 08 Dec 2019 20:10:40 +0300
changeset 10698d8ebc200fd4
parent 1066 9dfb8a7986ea
child 1070 db2d266f592e
timidity/readmidi.c (dumpstring): SNDDBG() is an empty macro: skip the text.
src/codecs/timidity/readmidi.c
     1.1 --- a/src/codecs/timidity/readmidi.c	Sun Dec 08 14:28:02 2019 +0300
     1.2 +++ b/src/codecs/timidity/readmidi.c	Sun Dec 08 20:10:40 2019 +0300
     1.3 @@ -52,10 +52,14 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +#if 0 /* SNDDBG() is just an empty macro */
     1.8  /* Print a string from the file, followed by a newline. Any non-ASCII
     1.9     or unprintable characters will be converted to periods. */
    1.10 -static int dumpstring(SDL_RWops *rw, Sint32 len, char *label)
    1.11 +static int dumpstring(SDL_RWops *rw, Sint32 len, Uint8 type)
    1.12  {
    1.13 +  static char *label[]={
    1.14 +    "Text event: ", "Text: ", "Copyright: ", "Track name: ",
    1.15 +    "Instrument: ", "Lyric: ", "Marker: ", "Cue point: "};
    1.16    signed char *s=safe_malloc(len+1);
    1.17    if (len != (Sint32) SDL_RWread(rw, s, 1, len))
    1.18      {
    1.19 @@ -68,10 +72,15 @@
    1.20        if (s[len]<32)
    1.21  	s[len]='.';
    1.22      }
    1.23 -  SNDDBG(("%s%s", label, s));
    1.24 +  SNDDBG(("%s%s", label[(type>7) ? 0 : type], s));
    1.25    free(s);
    1.26    return 0;
    1.27  }
    1.28 +#else
    1.29 +static SDL_INLINE int dumpstring(SDL_RWops *rw, Sint32 len, Uint8 type) {
    1.30 +  return SDL_RWseek(rw, len, RW_SEEK_CUR);
    1.31 +}
    1.32 +#endif
    1.33  
    1.34  #define MIDIEVENT(at,t,ch,pa,pb) \
    1.35    new=safe_malloc(sizeof(MidiEventList)); \
    1.36 @@ -111,10 +120,7 @@
    1.37  	  len=getvl(song->rw);
    1.38  	  if (type>0 && type<16)
    1.39  	    {
    1.40 -	      static char *label[]={
    1.41 -		"Text event: ", "Text: ", "Copyright: ", "Track name: ",
    1.42 -		"Instrument: ", "Lyric: ", "Marker: ", "Cue point: "};
    1.43 -	      dumpstring(song->rw, len, label[(type>7) ? 0 : type]);
    1.44 +	      dumpstring(song->rw, len, type);
    1.45  	    }
    1.46  	  else
    1.47  	    switch(type)