[beast/wip/soundfont: 831/832] BSE: SF2: Fix a few signedness warnings in sound font code



commit cce2530b0c9297a45412ecee3e62d9c820463eb1
Author: Stefan Westerfeld <stefan space twc de>
Date:   Tue Oct 18 15:29:26 2016 +0200

    BSE: SF2: Fix a few signedness warnings in sound font code
    
    Signed-off-by: Stefan Westerfeld <stefan space twc de>

 bse/bsesoundfontosc.cc  |    7 +++----
 bse/bsesoundfontrepo.cc |   13 ++++++-------
 bse/bsesoundfontrepo.hh |    4 ++--
 3 files changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/bse/bsesoundfontosc.cc b/bse/bsesoundfontosc.cc
index 8e23fb2..09464c1 100644
--- a/bse/bsesoundfontosc.cc
+++ b/bse/bsesoundfontosc.cc
@@ -360,7 +360,6 @@ process_fluid_L (BseSoundFontRepo   *sfrepo,
   float **channel_values_right = (float **) g_alloca (sfrepo->n_fluid_channels * sizeof (float *));
   float null_fx[BSE_STREAM_MAX_VALUES];
   float *channel_fx_null[2] = { null_fx, null_fx };
-  int i;
 
   g_return_if_fail (now_tick_stamp > sfrepo->channel_values_tick_stamp);
   sfrepo->channel_values_tick_stamp = now_tick_stamp;
@@ -368,7 +367,7 @@ process_fluid_L (BseSoundFontRepo   *sfrepo,
   /* Sample precise timing: If events don't occur at block boundary, the block
      is partially calculated, then the event is executed, and then the rest of
      the block (until the next event) is calculated, and so on */
-  for (i = 0; i < sfrepo->n_fluid_channels; i++)
+  for (guint i = 0; i < sfrepo->n_fluid_channels; i++)
     {
       channel_values_left[i] = sfrepo->channel_values_left[i];
       channel_values_right[i] = sfrepo->channel_values_right[i];
@@ -421,7 +420,7 @@ process_fluid_L (BseSoundFontRepo   *sfrepo,
                                    channel_fx_null, channel_fx_null);
          values_remaining -= values_todo;
          now_tick_stamp += values_todo;
-         for (i = 0; i < sfrepo->n_fluid_channels; i++)          /* increment fluid synth output buffer 
pointers */
+         for (guint i = 0; i < sfrepo->n_fluid_channels; i++)          /* increment fluid synth output 
buffer pointers */
            {
              channel_values_left[i] += values_todo;
              channel_values_right[i] += values_todo;
@@ -444,7 +443,7 @@ sound_font_osc_process (BseModule *module,
                                                flmod->config.sfont_id, flmod->config.bank, 
flmod->config.program);
       flmod->last_update_preset = flmod->config.update_preset;
     }
-  gint64 now_tick_stamp = Bse::TickStamp::current();
+  guint64 now_tick_stamp = Bse::TickStamp::current();
   if (sfrepo->channel_values_tick_stamp != now_tick_stamp)
     process_fluid_L (sfrepo, fluid_synth, now_tick_stamp);
 
diff --git a/bse/bsesoundfontrepo.cc b/bse/bsesoundfontrepo.cc
index dd7d6f3..694dfec 100644
--- a/bse/bsesoundfontrepo.cc
+++ b/bse/bsesoundfontrepo.cc
@@ -143,13 +143,13 @@ static void
 bse_sound_font_repo_prepare (BseSource *source)
 {
   BseSoundFontRepo *sfrepo = BSE_SOUND_FONT_REPO (source);
-  int i, channels_required = 0;
+  guint i, channels_required = 0;
   for (i = 0; i < sfrepo->n_oscs; i++)
     {
       if (sfrepo->oscs[i])
        sfrepo->channel_map[i] = channels_required++;
     }
-  int mix_freq = bse_engine_sample_freq();
+  guint mix_freq = bse_engine_sample_freq();
   if (sfrepo->n_fluid_channels != channels_required || sfrepo->fluid_mix_freq != mix_freq)
     {
       for (i = channels_required; i < sfrepo->n_fluid_channels; i++) // n_fluid_channels > channels_required
@@ -206,7 +206,6 @@ static void
 bse_sound_font_repo_dispose (GObject *object)
 {
   BseSoundFontRepo *sfrepo = BSE_SOUND_FONT_REPO (object);
-  int i;
 
   bse_sound_font_repo_forall_items (BSE_CONTAINER (sfrepo), unload_sound_font, sfrepo);
 
@@ -224,7 +223,7 @@ bse_sound_font_repo_dispose (GObject *object)
   sfrepo->channel_map = NULL;
   g_free (sfrepo->oscs);
   sfrepo->oscs = NULL;
-  for (i = 0; i < sfrepo->n_fluid_channels; i++)
+  for (guint i = 0; i < sfrepo->n_fluid_channels; i++)
     {
       g_free (sfrepo->channel_values_left[i]);
       g_free (sfrepo->channel_values_right[i]);
@@ -364,7 +363,7 @@ int
 bse_sound_font_repo_add_osc (BseSoundFontRepo *sfrepo,
                              BseSoundFontOsc  *osc)
 {
-  int i;
+  guint i;
   for (i = 0; i < sfrepo->n_oscs; i++)
     {
       if (sfrepo->oscs[i] == 0)
@@ -381,9 +380,9 @@ bse_sound_font_repo_add_osc (BseSoundFontRepo *sfrepo,
 
 void
 bse_sound_font_repo_remove_osc (BseSoundFontRepo *sfrepo,
-                                int               osc_id)
+                                guint             osc_id)
 {
-  g_return_if_fail (osc_id >= 0 && osc_id < sfrepo->n_oscs);
+  g_return_if_fail (osc_id < sfrepo->n_oscs);
 
   sfrepo->oscs[osc_id] = 0;
 }
diff --git a/bse/bsesoundfontrepo.hh b/bse/bsesoundfontrepo.hh
index 2588758..7275308 100644
--- a/bse/bsesoundfontrepo.hh
+++ b/bse/bsesoundfontrepo.hh
@@ -20,7 +20,7 @@ G_BEGIN_DECLS
 
 struct BseFluidEvent {
   guint64            tick_stamp;
-  int                channel;
+  guint              channel;
   int               command;
   int               arg1;
   int               arg2;
@@ -61,7 +61,7 @@ void           bse_sound_font_repo_unlock_fluid_synth (BseSoundFontRepo *sfrepo)
 int           bse_sound_font_repo_add_osc            (BseSoundFontRepo *sfrepo,
                                                       BseSoundFontOsc  *osc);
 void           bse_sound_font_repo_remove_osc         (BseSoundFontRepo *sfrepo,
-                                                      int               osc_id);
+                                                      guint             osc_id);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]