[beast: 11/43] PLUGINS: only use Bse::assert_return{_unreached}



commit 5af05aaef63ce3805a40c5e052e1c0ef1eb8c72b
Author: Tim Janik <timj gnu org>
Date:   Sun Jun 25 15:54:33 2017 +0200

    PLUGINS: only use Bse::assert_return{_unreached}
    
    Signed-off-by: Tim Janik <timj gnu org>

 plugins/bseadder.cc       |    6 +++---
 plugins/bseatandistort.cc |    4 ++--
 plugins/bseblockutils.cc  |   24 ++++++++++++------------
 plugins/bseiirfilter.cc   |    6 +++---
 plugins/bsemixer.cc       |    4 ++--
 plugins/bsemult.cc        |   10 +++++-----
 plugins/bsesequencer.cc   |    4 ++--
 plugins/bsesimpleadsr.cc  |    8 ++++----
 plugins/davcanyondelay.cc |    8 ++++----
 plugins/davsyndrum.cc     |    8 ++++----
 plugins/davxtalstrings.cc |    6 +++---
 11 files changed, 44 insertions(+), 44 deletions(-)
---
diff --git a/plugins/bseadder.cc b/plugins/bseadder.cc
index f9905be..eabc04b 100644
--- a/plugins/bseadder.cc
+++ b/plugins/bseadder.cc
@@ -75,11 +75,11 @@ bse_adder_class_init (BseAdderClass *klass)
                                                   SFI_PARAM_STANDARD ":skip-default"));
 
   channel = bse_source_class_add_jchannel (source_class, "audio-in1", _("Audio In1"), _("Audio Input 1"));
-  assert (channel == BSE_ADDER_JCHANNEL_AUDIO1);
+  assert_return (channel == BSE_ADDER_JCHANNEL_AUDIO1);
   channel = bse_source_class_add_jchannel (source_class, "audio-in2", _("Audio In2"), _("Audio Input 2"));
-  assert (channel == BSE_ADDER_JCHANNEL_AUDIO2);
+  assert_return (channel == BSE_ADDER_JCHANNEL_AUDIO2);
   channel = bse_source_class_add_ochannel (source_class, "audio-out", _("Audio Out"), _("Audio Output"));
-  assert (channel == BSE_ADDER_OCHANNEL_AUDIO_OUT);
+  assert_return (channel == BSE_ADDER_OCHANNEL_AUDIO_OUT);
 }
 
 static void
diff --git a/plugins/bseatandistort.cc b/plugins/bseatandistort.cc
index 3083eb7..e02549e 100644
--- a/plugins/bseatandistort.cc
+++ b/plugins/bseatandistort.cc
@@ -67,9 +67,9 @@ bse_atan_distort_class_init (BseAtanDistortClass *klass)
                                              SFI_PARAM_STANDARD ":f:scale"));
 
   channel_id = bse_source_class_add_ichannel (source_class, "audio-in", _("Audio In"), _("Audio Input 
Signal"));
-  assert (channel_id == BSE_ATAN_DISTORT_ICHANNEL_MONO1);
+  assert_return (channel_id == BSE_ATAN_DISTORT_ICHANNEL_MONO1);
   channel_id = bse_source_class_add_ochannel (source_class, "audio-out", _("Audio Out"), _("Distorted Audio 
Output"));
-  assert (channel_id == BSE_ATAN_DISTORT_OCHANNEL_MONO1);
+  assert_return (channel_id == BSE_ATAN_DISTORT_OCHANNEL_MONO1);
 }
 
 static void
diff --git a/plugins/bseblockutils.cc b/plugins/bseblockutils.cc
index 3d50b98..a04f9c6 100644
--- a/plugins/bseblockutils.cc
+++ b/plugins/bseblockutils.cc
@@ -31,7 +31,7 @@ class BlockImpl : virtual public Bse::Block::Impl {
        const float *ivalues)
   {
     guint upos = 0, n_vectors = 0;
-    if (ALIGNMENT16 (ovalues) == ALIGNMENT16 (ivalues) && LIKELY (n_values > 8))
+    if (ALIGNMENT16 (ovalues) == ALIGNMENT16 (ivalues) && ISLIKELY (n_values > 8))
       {
         /* loop until ivalues and ovalues aligned */
        for (upos = 0; upos < n_values && !ALIGNED16 (&ivalues[upos]); upos++) // ensures ovalues alignment, 
too
@@ -53,7 +53,7 @@ class BlockImpl : virtual public Bse::Block::Impl {
        const float *ivalues)
   {
     guint upos = 0, n_vectors = 0;
-    if (ALIGNMENT16 (ovalues) == ALIGNMENT16 (ivalues) && LIKELY (n_values > 8))
+    if (ALIGNMENT16 (ovalues) == ALIGNMENT16 (ivalues) && ISLIKELY (n_values > 8))
       {
         /* loop until ivalues and ovalues aligned */
        for (upos = 0; upos < n_values && !ALIGNED16 (&ivalues[upos]); upos++) // ensures ovalues alignment, 
too
@@ -75,7 +75,7 @@ class BlockImpl : virtual public Bse::Block::Impl {
        const float *ivalues)
   {
     guint upos = 0, n_vectors = 0;
-    if (ALIGNMENT16 (ovalues) == ALIGNMENT16 (ivalues) && LIKELY (n_values > 8))
+    if (ALIGNMENT16 (ovalues) == ALIGNMENT16 (ivalues) && ISLIKELY (n_values > 8))
       {
         /* loop until ivalues and ovalues aligned */
        for (upos = 0; upos < n_values && !ALIGNED16 (&ivalues[upos]); upos++) // ensures ovalues alignment, 
too
@@ -98,7 +98,7 @@ class BlockImpl : virtual public Bse::Block::Impl {
          const float  level)
   {
     guint upos = 0, n_vectors = 0;
-    if (ALIGNMENT16 (ovalues) == ALIGNMENT16 (ivalues) && LIKELY (n_values > 8))
+    if (ALIGNMENT16 (ovalues) == ALIGNMENT16 (ivalues) && ISLIKELY (n_values > 8))
       {
         /* loop until ivalues and ovalues aligned */
        for (upos = 0; upos < n_values && !ALIGNED16 (&ivalues[upos]); upos++) // ensures ovalues alignment, 
too
@@ -144,12 +144,12 @@ class BlockImpl : virtual public Bse::Block::Impl {
         float&       max_value)
   {
     float minv, maxv;
-    if (LIKELY (n_values))
+    if (ISLIKELY (n_values))
       {
        minv = maxv = ivalues[0];
 
        guint upos = 0, n_vectors = 0;
-       if (LIKELY (n_values > 8))
+       if (ISLIKELY (n_values > 8))
          {
            /* loop until ivalues aligned */
            for (upos = 0; upos < n_values && !ALIGNED16 (&ivalues[upos]); upos++)
@@ -161,7 +161,7 @@ class BlockImpl : virtual public Bse::Block::Impl {
              }
            /* n_vectors must be >= 1 if n_values was > 8 */
            n_vectors = (n_values - upos) / 4;
-           assert (n_vectors > 0);
+           assert_return (n_vectors > 0);
            /* loop while ivalues aligned */
            const __m128 *ivalues_m = (const __m128*) &ivalues[upos];
            __m128 min_m = ivalues_m[0];
@@ -206,14 +206,14 @@ class BlockImpl : virtual public Bse::Block::Impl {
   {
     float square_sum = 0.0;
     guint upos = 0, n_vectors = 0;
-    if (LIKELY (n_values > 8))
+    if (ISLIKELY (n_values > 8))
       {
         /* loop until ivalues aligned */
         for (upos = 0; upos < n_values && !ALIGNED16 (&ivalues[upos]); upos++)
           square_sum += ivalues[upos] * ivalues[upos];
        /* n_vectors must be >= 1 if n_values was > 8 */
         n_vectors = (n_values - upos) / 4;
-       assert (n_vectors > 0);
+       assert_return (n_vectors > 0, 0);
         /* loop while ivalues aligned */
         const __m128 *ivalues_m = (const __m128*) &ivalues[upos];
        __m128 square_sum_m = _mm_mul_ps (ivalues_m[0], ivalues_m[0]);
@@ -238,12 +238,12 @@ class BlockImpl : virtual public Bse::Block::Impl {
                        float&       max_value)
   {
     float minv, maxv, square_sum = 0;
-    if (LIKELY (n_values))
+    if (ISLIKELY (n_values))
       {
        minv = maxv = ivalues[0];
 
        guint upos = 0, n_vectors = 0;
-       if (LIKELY (n_values > 8))
+       if (ISLIKELY (n_values > 8))
          {
            /* loop until ivalues aligned */
            for (upos = 0; upos < n_values && !ALIGNED16 (&ivalues[upos]); upos++)
@@ -256,7 +256,7 @@ class BlockImpl : virtual public Bse::Block::Impl {
              }
            /* n_vectors must be >= 1 if n_values was > 8 */
            n_vectors = (n_values - upos) / 4;
-           assert (n_vectors > 0);
+           assert_return (n_vectors > 0, 0);
            /* loop while ivalues aligned */
            const __m128 *ivalues_m = (const __m128*) &ivalues[upos];
            n_vectors = (n_values - upos) / 4;
diff --git a/plugins/bseiirfilter.cc b/plugins/bseiirfilter.cc
index c230b06..0708151 100644
--- a/plugins/bseiirfilter.cc
+++ b/plugins/bseiirfilter.cc
@@ -114,9 +114,9 @@ bse_iir_filter_class_init (BseIIRFilterClass *klass)
                                              SFI_PARAM_GUI));
 
   ichannel_id = bse_source_class_add_ichannel (source_class, "audio-in", _("Audio In"), _("Unfiltered 
Input"));
-  assert (ichannel_id == BSE_IIR_FILTER_ICHANNEL_MONO);
+  assert_return (ichannel_id == BSE_IIR_FILTER_ICHANNEL_MONO);
   ochannel_id = bse_source_class_add_ochannel (source_class, "audio-out", _("Audio Out"), _("Filtered 
Output"));
-  assert (ochannel_id == BSE_IIR_FILTER_OCHANNEL_MONO);
+  assert_return (ochannel_id == BSE_IIR_FILTER_OCHANNEL_MONO);
 }
 
 static void
@@ -335,7 +335,7 @@ bse_iir_filter_update_modules (BseIIRFilter *filt)
          gsl_filter_tscheb2_bs (filt->order & ~1, freq1, freq2, steepness, filt->epsilon, filt->a, filt->b);
          break;
        default:
-         assert_unreached ();
+         assert_return_unreached ();
        }
 
       fmod->iir.order = filt->order;
diff --git a/plugins/bsemixer.cc b/plugins/bsemixer.cc
index 616744c..b033bb9 100644
--- a/plugins/bsemixer.cc
+++ b/plugins/bsemixer.cc
@@ -89,7 +89,7 @@ bse_mixer_class_init (BseMixerClass *klass)
                                             0, bse_db_to_factor (BSE_MAX_VOLUME_dB) * 100, 1,
                                             SFI_PARAM_GUI ":dial"));
   ochannel = bse_source_class_add_ochannel (source_class, "audio-out", _("Audio Out"), _("Sole Output"));
-  assert (ochannel == BSE_MIXER_OCHANNEL_MONO);
+  assert_return (ochannel == BSE_MIXER_OCHANNEL_MONO);
   for (i = 1; i <= BSE_MIXER_N_INPUTS; i++)
     {
       gchar *group, *ident, *label, *blurb;
@@ -131,7 +131,7 @@ bse_mixer_class_init (BseMixerClass *klass)
       label = g_strdup_format (_("Audio In%u"), i);
       blurb = g_strdup_format (_("Input Channel %u"), i);
       ichannel = bse_source_class_add_ichannel (source_class, ident, label, blurb);
-      assert (ichannel == i - 1);
+      assert_return (ichannel == i - 1);
       g_free (blurb);
       g_free (label);
       g_free (ident);
diff --git a/plugins/bsemult.cc b/plugins/bsemult.cc
index 27258f7..2d202a7 100644
--- a/plugins/bsemult.cc
+++ b/plugins/bsemult.cc
@@ -35,15 +35,15 @@ bse_mult_class_init (BseMultClass *klass)
   source_class->context_create = bse_mult_context_create;
 
   ichannel = bse_source_class_add_ichannel (source_class, "audio-in1", _("Audio In1"), _("Audio Input 1"));
-  assert (ichannel == BSE_MULT_ICHANNEL_MONO1);
+  assert_return (ichannel == BSE_MULT_ICHANNEL_MONO1);
   ichannel = bse_source_class_add_ichannel (source_class, "audio-in2", _("Audio In2"), _("Audio Input 2"));
-  assert (ichannel == BSE_MULT_ICHANNEL_MONO2);
+  assert_return (ichannel == BSE_MULT_ICHANNEL_MONO2);
   ichannel = bse_source_class_add_ichannel (source_class, "audio-in3", _("Audio In3"), _("Audio Input 3"));
-  assert (ichannel == BSE_MULT_ICHANNEL_MONO3);
+  assert_return (ichannel == BSE_MULT_ICHANNEL_MONO3);
   ichannel = bse_source_class_add_ichannel (source_class, "audio-in4", _("Audio In4"), _("Audio Input 4"));
-  assert (ichannel == BSE_MULT_ICHANNEL_MONO4);
+  assert_return (ichannel == BSE_MULT_ICHANNEL_MONO4);
   ochannel = bse_source_class_add_ochannel (source_class, "audio-out", _("Audio Out"), _("Audio Output"));
-  assert (ochannel == BSE_MULT_OCHANNEL_MONO);
+  assert_return (ochannel == BSE_MULT_OCHANNEL_MONO);
 }
 
 static void
diff --git a/plugins/bsesequencer.cc b/plugins/bsesequencer.cc
index ddf695e..5d332a3 100644
--- a/plugins/bsesequencer.cc
+++ b/plugins/bsesequencer.cc
@@ -84,9 +84,9 @@ bse_sequencer_class_init (BseSequencerClass *klass)
                                              SFI_PARAM_STANDARD ":f:scale"));
 
   ochannel = bse_source_class_add_ochannel (source_class, "freq-out", _("Freq Out"), _("Frequency Signal"));
-  assert (ochannel == BSE_SEQUENCER_OCHANNEL_FREQ);
+  assert_return (ochannel == BSE_SEQUENCER_OCHANNEL_FREQ);
   ochannel = bse_source_class_add_ochannel (source_class, "note-sync", _("Note Sync"), _("Note Sync 
Signal"));
-  assert (ochannel == BSE_SEQUENCER_OCHANNEL_NOTE_SYNC);
+  assert_return (ochannel == BSE_SEQUENCER_OCHANNEL_NOTE_SYNC);
 }
 
 static void
diff --git a/plugins/bsesimpleadsr.cc b/plugins/bsesimpleadsr.cc
index 183f0ef..fc4cd0a 100644
--- a/plugins/bsesimpleadsr.cc
+++ b/plugins/bsesimpleadsr.cc
@@ -94,13 +94,13 @@ bse_simple_adsr_class_init (BseSimpleADSRClass *klass)
   g_free (desc);
 
   ichannel = bse_source_class_add_ichannel (source_class, "gate-in", _("Gate In"), _("Gate input 
(activates/deactivates envelope)"));
-  assert (ichannel == BSE_SIMPLE_ADSR_ICHANNEL_GATE);
+  assert_return (ichannel == BSE_SIMPLE_ADSR_ICHANNEL_GATE);
   ichannel = bse_source_class_add_ichannel (source_class, "retrigger-in", _("Retrigger In"), _("Retrigger 
input (raising edge retriggers envelope)"));
-  assert (ichannel == BSE_SIMPLE_ADSR_ICHANNEL_RETRIGGER);
+  assert_return (ichannel == BSE_SIMPLE_ADSR_ICHANNEL_RETRIGGER);
   ochannel = bse_source_class_add_ochannel (source_class, "ctrl-out", _("Ctrl Out"), 
_("Attack-Decay-Sustain-Release envelope output"));
-  assert (ochannel == BSE_SIMPLE_ADSR_OCHANNEL_OUT);
+  assert_return (ochannel == BSE_SIMPLE_ADSR_OCHANNEL_OUT);
   ochannel = bse_source_class_add_ochannel (source_class, "done-out", _("Done Out"), _("This signal goes 
high after the release phase has completed"));
-  assert (ochannel == BSE_SIMPLE_ADSR_OCHANNEL_DONE);
+  assert_return (ochannel == BSE_SIMPLE_ADSR_OCHANNEL_DONE);
 }
 
 static void
diff --git a/plugins/davcanyondelay.cc b/plugins/davcanyondelay.cc
index 6888993..f7245b1 100644
--- a/plugins/davcanyondelay.cc
+++ b/plugins/davcanyondelay.cc
@@ -97,13 +97,13 @@ dav_canyon_delay_class_init (DavCanyonDelayClass *klass)
                                                      SFI_PARAM_GUI));
 
   channel = bse_source_class_add_ichannel (source_class, "left-in", _("Left In"), _("Left Audio Input"));
-  assert (channel == DAV_CANYON_DELAY_ICHANNEL_LEFT);
+  assert_return (channel == DAV_CANYON_DELAY_ICHANNEL_LEFT);
   channel = bse_source_class_add_ichannel (source_class, "right-in", _("Right In"), _("Right Audio Input"));
-  assert (channel == DAV_CANYON_DELAY_ICHANNEL_RIGHT);
+  assert_return (channel == DAV_CANYON_DELAY_ICHANNEL_RIGHT);
   channel = bse_source_class_add_ochannel (source_class, "left-out", _("Left Out"), _("Left Audio Output"));
-  assert (channel == DAV_CANYON_DELAY_OCHANNEL_LEFT);
+  assert_return (channel == DAV_CANYON_DELAY_OCHANNEL_LEFT);
   channel = bse_source_class_add_ochannel (source_class, "right-out", _("Right Out"), _("Right Audio 
Output"));
-  assert (channel == DAV_CANYON_DELAY_OCHANNEL_RIGHT);
+  assert_return (channel == DAV_CANYON_DELAY_OCHANNEL_RIGHT);
 }
 
 static void
diff --git a/plugins/davsyndrum.cc b/plugins/davsyndrum.cc
index c9e1f3f..7ba1990 100644
--- a/plugins/davsyndrum.cc
+++ b/plugins/davsyndrum.cc
@@ -97,13 +97,13 @@ dav_syn_drum_class_init (DavSynDrumClass *klass)
                                               SFI_PARAM_STANDARD ":scale"));
 
   ichannel_id = bse_source_class_add_ichannel (source_class, "freq-in", _("Freq In"), _("Drum Frequency 
Input"));
-  assert (ichannel_id == DAV_SYN_DRUM_ICHANNEL_FREQ);
+  assert_return (ichannel_id == DAV_SYN_DRUM_ICHANNEL_FREQ);
   ichannel_id = bse_source_class_add_ichannel (source_class, "ratio-in", _("Ratio In"), _("Frequency shift 
ratio (assumed 1.0 if not connected)"));
-  assert (ichannel_id == DAV_SYN_DRUM_ICHANNEL_RATIO);
+  assert_return (ichannel_id == DAV_SYN_DRUM_ICHANNEL_RATIO);
   ichannel_id = bse_source_class_add_ichannel (source_class, "trigger-in", _("Trigger In"), _("Hit the drum 
on raising edges"));
-  assert (ichannel_id == DAV_SYN_DRUM_ICHANNEL_TRIGGER);
+  assert_return (ichannel_id == DAV_SYN_DRUM_ICHANNEL_TRIGGER);
   ochannel_id = bse_source_class_add_ochannel (source_class, "audio-out", _("Audio Out"), _("SynDrum 
Output"));
-  assert (ochannel_id == DAV_SYN_DRUM_OCHANNEL_MONO);
+  assert_return (ochannel_id == DAV_SYN_DRUM_OCHANNEL_MONO);
 }
 
 static void
diff --git a/plugins/davxtalstrings.cc b/plugins/davxtalstrings.cc
index a8515b5..e270035 100644
--- a/plugins/davxtalstrings.cc
+++ b/plugins/davxtalstrings.cc
@@ -129,11 +129,11 @@ dav_xtal_strings_class_init (DavXtalStringsClass *klass)
                                               SFI_PARAM_STANDARD ":scale"));
 
   channel_id = bse_source_class_add_ichannel (source_class, "freq-in", _("Freq In"), _("Pluck frequency 
input"));
-  assert (channel_id == DAV_XTAL_STRINGS_ICHANNEL_FREQ);
+  assert_return (channel_id == DAV_XTAL_STRINGS_ICHANNEL_FREQ);
   channel_id = bse_source_class_add_ichannel (source_class, "trigger-in", _("Trigger In"), _("Pluck strings 
on raising edge"));
-  assert (channel_id == DAV_XTAL_STRINGS_ICHANNEL_TRIGGER);
+  assert_return (channel_id == DAV_XTAL_STRINGS_ICHANNEL_TRIGGER);
   channel_id = bse_source_class_add_ochannel (source_class, "audio-out", _("Audio Out"), _("XtalStrings 
Output"));
-  assert (channel_id == DAV_XTAL_STRINGS_OCHANNEL_MONO);
+  assert_return (channel_id == DAV_XTAL_STRINGS_OCHANNEL_MONO);
 }
 
 static void


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