0
0
Fork 0
mirror of https://github.com/ZDoom/fluidsynth.git synced 2025-03-02 07:21:58 +00:00

fix tautological comparision

on platforms where `char` is implemented as `unsigned char`, addresses 
This commit is contained in:
derselbst 2018-05-05 20:55:26 +02:00
parent bad3102251
commit d47de30f16
2 changed files with 13 additions and 13 deletions

View file

@ -65,8 +65,8 @@
struct mononote struct mononote
{ {
unsigned char next; /* next note */ unsigned char next; /* next note */
char note; /* note */ unsigned char note; /* note */
char vel; /* velocity */ unsigned char vel; /* velocity */
}; };
/* /*
@ -87,25 +87,25 @@ struct _fluid_channel_t
/* monophonic list - legato detector */ /* monophonic list - legato detector */
unsigned char i_first; /**< First note index */ unsigned char i_first; /**< First note index */
unsigned char i_last; /**< most recent note index since the most recent add */ unsigned char i_last; /**< most recent note index since the most recent add */
char prev_note; /**< previous note of the most recent add/remove */ unsigned char prev_note; /**< previous note of the most recent add/remove */
unsigned char n_notes; /**< actual number of notes in the list */ unsigned char n_notes; /**< actual number of notes in the list */
struct mononote monolist[FLUID_CHANNEL_SIZE_MONOLIST]; /**< monophonic list */ struct mononote monolist[FLUID_CHANNEL_SIZE_MONOLIST]; /**< monophonic list */
char key_mono_sustained; /**< previous sustained monophonic note */ unsigned char key_mono_sustained; /**< previous sustained monophonic note */
char previous_cc_breath; /**< Previous Breath */ unsigned char previous_cc_breath; /**< Previous Breath */
enum fluid_channel_legato_mode legatomode; /**< legato mode */ enum fluid_channel_legato_mode legatomode; /**< legato mode */
enum fluid_channel_portamento_mode portamentomode; /**< portamento mode */ enum fluid_channel_portamento_mode portamentomode; /**< portamento mode */
/*- End of Poly/mono variables description */ /*- End of Poly/mono variables description */
char cc[128]; /**< MIDI controller values */ unsigned char cc[128]; /**< MIDI controller values from [0;127] */
char key_pressure[128]; /**< MIDI polyphonic key pressure */ unsigned char key_pressure[128]; /**< MIDI polyphonic key pressure from [0;127] */
/* Drum channel flag, CHANNEL_TYPE_MELODIC, or CHANNEL_TYPE_DRUM. */ /* Drum channel flag, CHANNEL_TYPE_MELODIC, or CHANNEL_TYPE_DRUM. */
enum fluid_midi_channel_type channel_type; enum fluid_midi_channel_type channel_type;
enum fluid_interp interp_method; /**< Interpolation method (enum fluid_interp) */ enum fluid_interp interp_method; /**< Interpolation method (enum fluid_interp) */
char channel_pressure; /**< MIDI channel pressure */ unsigned char channel_pressure; /**< MIDI channel pressure from [0;127] */
char pitch_wheel_sensitivity; /**< Current pitch wheel sensitivity */ unsigned char pitch_wheel_sensitivity; /**< Current pitch wheel sensitivity */
short pitch_bend; /**< Current pitch bend value */ short pitch_bend; /**< Current pitch bend value */
/* Sostenuto order id gives the order of SostenutoOn event. /* Sostenuto order id gives the order of SostenutoOn event.
* This value is useful to known when the sostenuto pedal is depressed * This value is useful to known when the sostenuto pedal is depressed
@ -231,7 +231,7 @@ int fluid_channel_get_interp_method(fluid_channel_t* chan);
fluid_channel_legato(chan)) fluid_channel_legato(chan))
/* Macros interface to monophonic list variables */ /* Macros interface to monophonic list variables */
#define INVALID_NOTE (-1) #define INVALID_NOTE (255)
/* Returns true when a note is a valid note */ /* Returns true when a note is a valid note */
#define fluid_channel_is_valid_note(n) (n != INVALID_NOTE) #define fluid_channel_is_valid_note(n) (n != INVALID_NOTE)
/* Marks prev_note as invalid. */ /* Marks prev_note as invalid. */

View file

@ -163,9 +163,9 @@
* - In mono legato playing,default_fromkey must be valid. * - In mono legato playing,default_fromkey must be valid.
*/ */
static char fluid_synth_get_fromkey_portamento_legato(fluid_channel_t* chan, static char fluid_synth_get_fromkey_portamento_legato(fluid_channel_t* chan,
char default_fromkey) int default_fromkey)
{ {
char ptc = fluid_channel_get_cc(chan, PORTAMENTO_CTRL); unsigned char ptc = fluid_channel_get_cc(chan, PORTAMENTO_CTRL);
if(fluid_channel_is_valid_note(ptc)) if(fluid_channel_is_valid_note(ptc))
{ /* CC PTC has been received */ { /* CC PTC has been received */
fluid_channel_clear_portamento(chan); /* clears the CC PTC receive */ fluid_channel_clear_portamento(chan); /* clears the CC PTC receive */
@ -178,7 +178,7 @@ static char fluid_synth_get_fromkey_portamento_legato(fluid_channel_t* chan,
} }
else else
{ /* determines and returns fromkey portamento */ { /* determines and returns fromkey portamento */
char fromkey_portamento = INVALID_NOTE; unsigned char fromkey_portamento = INVALID_NOTE;
if(fluid_channel_portamento(chan)) if(fluid_channel_portamento(chan))
{ /* Portamento when Portamento pedal is On */ { /* Portamento when Portamento pedal is On */
/* 'fromkey portamento'is determined from the portamento mode /* 'fromkey portamento'is determined from the portamento mode