[PATCH] Use fully namespaced assertion macros in headers.



For instance assert_return is replaced by RAPICORN_ASSERT_RETURN.

Signed-off-by: Stefan Westerfeld <stefan space twc de>
---
 bse/bsecxxplugin.hh     |  2 +-
 bse/bsecxxutils.hh      |  2 +-
 bse/bseitem.hh          |  8 ++++----
 bse/bseresampler.hh     |  2 +-
 bse/bseresamplerimpl.hh |  8 ++++----
 bse/gsldatautils.hh     | 12 ++++++------
 sfi/gbsearcharray.hh    | 10 +++++-----
 sfi/glib-extra.hh       |  2 +-
 sfi/sficxx.hh           | 10 +++++-----
 sfi/sfivisitors.hh      |  2 +-
 10 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/bse/bsecxxplugin.hh b/bse/bsecxxplugin.hh
index 60636bb..d59c3cd 100644
--- a/bse/bsecxxplugin.hh
+++ b/bse/bsecxxplugin.hh
@@ -121,7 +121,7 @@ extern ::BseExportIdentity bse_builtin_export_identity; /* sync with bseplugin.h
         if (!values[0].value_name) {                                    \
           GEnumValue *v = values;                                       \
           ICode; /* initializes values via *v++ = ...; */               \
-          assert (v == values + N);                                   \
+          RAPICORN_ASSERT (v == values + N);                            \
           *v++ = ::Bse::EnumValue (0, 0, 0); /* NULL termination */     \
         }                                                               \
         return values;                                                  \
diff --git a/bse/bsecxxutils.hh b/bse/bsecxxutils.hh
index b455750..1830d77 100644
--- a/bse/bsecxxutils.hh
+++ b/bse/bsecxxutils.hh
@@ -158,7 +158,7 @@ bse_type_id_wrapper (const char *type_name)
   if (!type)
     {
       type = g_type_from_name (type_name);
-      assert (type);
+      RAPICORN_ASSERT (type);
     }
   return type;
 }
diff --git a/bse/bseitem.hh b/bse/bseitem.hh
index 8a2f38a..dd449ce 100644
--- a/bse/bseitem.hh
+++ b/bse/bseitem.hh
@@ -172,7 +172,7 @@ public:
   template<typename ItemT, typename... FuncArgs, typename... CallArgs> void
   push_undo (const String &blurb, ItemT &self, ErrorType (ItemT::*function) (FuncArgs...), CallArgs... args)
   {
-    assert_return (this == &self);
+    RAPICORN_ASSERT_RETURN (this == &self);
     UndoLambda lambda = [function, args...] (ItemImpl &item, BseUndoStack *ustack) {
       ItemT &self = dynamic_cast<ItemT&> (item);
       return (self.*function) (args...);
@@ -182,7 +182,7 @@ public:
   template<typename ItemT, typename R, typename... FuncArgs, typename... CallArgs> void
   push_undo (const String &blurb, ItemT &self, R (ItemT::*function) (FuncArgs...), CallArgs... args)
   {
-    assert_return (this == &self);
+    RAPICORN_ASSERT_RETURN (this == &self);
     UndoLambda lambda = [function, args...] (ItemImpl &item, BseUndoStack *ustack) {
       ItemT &self = dynamic_cast<ItemT&> (item);
       (self.*function) (args...); // ignoring return type R
@@ -194,7 +194,7 @@ public:
   push_undo (const String &blurb, ItemT &self, const ItemTLambda &itemt_lambda)
   {
     const std::function<ErrorType (ItemT &item, BseUndoStack *ustack)> &undo_lambda = itemt_lambda;
-    assert_return (this == &self);
+    RAPICORN_ASSERT_RETURN (this == &self);
     UndoLambda lambda = [undo_lambda] (ItemImpl &item, BseUndoStack *ustack) {
       ItemT &self = dynamic_cast<ItemT&> (item);
       return undo_lambda (self, ustack);
@@ -205,7 +205,7 @@ public:
   push_undo_to_redo (const String &blurb, ItemT &self, const ItemTLambda &itemt_lambda)
   { // push itemt_lambda as undo step when this undo step is executed (i.e. itemt_lambda is for redo)
     const std::function<ErrorType (ItemT &item, BseUndoStack *ustack)> &undo_lambda = itemt_lambda;
-    assert_return (this == &self);
+    RAPICORN_ASSERT_RETURN (this == &self);
     auto lambda = [blurb, undo_lambda] (ItemT &self, BseUndoStack *ustack) -> ErrorType {
       self.push_undo (blurb, self, undo_lambda);
       return ERROR_NONE;
diff --git a/bse/bseresampler.hh b/bse/bseresampler.hh
index 516e4e3..fac1b9c 100644
--- a/bse/bseresampler.hh
+++ b/bse/bseresampler.hh
@@ -109,7 +109,7 @@ protected:
       taps[i] = d[i] * scaling;
 
     Resampler2 *filter = new Filter (taps);
-    assert (order == filter->order());
+    RAPICORN_ASSERT (order == filter->order());
     return filter;
   }
   /* creates the actual implementation; specifying USE_SSE=true will use
diff --git a/bse/bseresamplerimpl.hh b/bse/bseresamplerimpl.hh
index 12f2d12..094c575 100644
--- a/bse/bseresamplerimpl.hh
+++ b/bse/bseresamplerimpl.hh
@@ -98,7 +98,7 @@ fir_process_4samples_sse (const float *input,
   *out2 = out2_v.f[0] + out2_v.f[1] + out2_v.f[2] + out2_v.f[3];
   *out3 = out3_v.f[0] + out3_v.f[1] + out3_v.f[2] + out3_v.f[3];
 #else
-  assert_unreached();
+  RAPICORN_ASSERT_UNREACHED();
 #endif
 }
 
@@ -289,7 +289,7 @@ public:
     history (2 * ORDER),
     sse_taps (fir_compute_sse_taps (taps))
   {
-    assert ((ORDER & 1) == 0);    /* even order filter */
+    RAPICORN_ASSERT ((ORDER & 1) == 0);    /* even order filter */
   }
   /**
    * The function process_block() takes a block of input samples and produces a
@@ -428,7 +428,7 @@ public:
     history_odd (2 * ORDER),
     sse_taps (fir_compute_sse_taps (taps))
   {
-    assert ((ORDER & 1) == 0);    /* even order filter */
+    RAPICORN_ASSERT ((ORDER & 1) == 0);    /* even order filter */
   }
   /**
    * The function process_block() takes a block of input samples and produces
@@ -439,7 +439,7 @@ public:
                  guint        n_input_samples,
                 float       *output)
   {
-    assert ((n_input_samples & 1) == 0);
+    RAPICORN_ASSERT ((n_input_samples & 1) == 0);
 
     const uint BLOCKSIZE = 1024;
 
diff --git a/bse/gsldatautils.hh b/bse/gsldatautils.hh
index af0691a..5884558 100644
--- a/bse/gsldatautils.hh
+++ b/bse/gsldatautils.hh
@@ -373,7 +373,7 @@ gsl_conv_from_float (GslWaveFormatType format,
       while (u32src < u32bound);
       return n_values * 4;
     default:
-      assert_unreached ();
+      RAPICORN_ASSERT_UNREACHED();
       return 0;
     }
 }
@@ -604,7 +604,7 @@ gsl_conv_from_float_clip (GslWaveFormatType format,
       while (u32src < u32bound);
       return n_values << 2;
     default:
-      assert_unreached ();
+      RAPICORN_ASSERT_UNREACHED();
       return 0;
     }
 }
@@ -823,7 +823,7 @@ gsl_conv_to_float (GslWaveFormatType format,
       while (u32dest < u32bound);
       break;
     default:
-      assert_unreached ();
+      RAPICORN_ASSERT_UNREACHED();
     }
 }
 
@@ -1030,7 +1030,7 @@ gsl_conv_from_double (GslWaveFormatType format,
       while (u32src < u32bound);
       return n_values << 2;
     default:
-      assert_unreached ();
+      RAPICORN_ASSERT_UNREACHED();
       return 0;
     }
 }
@@ -1261,7 +1261,7 @@ gsl_conv_from_double_clip (GslWaveFormatType format,
       while (u32src < u32bound);
       return n_values << 2;
     default:
-      assert_unreached ();
+      RAPICORN_ASSERT_UNREACHED();
       return 0;
     }
 }
@@ -1430,7 +1430,7 @@ gsl_conv_to_double (GslWaveFormatType format,
       while (u32dest < u32bound);
       break;
     default:
-      assert_unreached ();
+      RAPICORN_ASSERT_UNREACHED();
     }
 }
 
diff --git a/sfi/gbsearcharray.hh b/sfi/gbsearcharray.hh
index 5912f86..920bf08 100644
--- a/sfi/gbsearcharray.hh
+++ b/sfi/gbsearcharray.hh
@@ -114,7 +114,7 @@ g_bsearch_array_create (const GBSearchConfig *bconfig)
   GBSearchArray *barray;
   guint size;
 
-  assert_return (bconfig != NULL, NULL);
+  RAPICORN_ASSERT_RETURN (bconfig != NULL, NULL);
 
   size = sizeof (GBSearchArray) + bconfig->sizeof_node;
   if (bconfig->flags & G_BSEARCH_ARRAY_ALIGN_POWER2)
@@ -172,7 +172,7 @@ g_bsearch_array_get_index (GBSearchArray        *barray,
 {
   guint distance = ((guint8*) node_in_array) - G_BSEARCH_ARRAY_NODES (barray);
 
-  assert_return (node_in_array != NULL, barray->n_nodes);
+  RAPICORN_ASSERT_RETURN (node_in_array != NULL, barray->n_nodes);
 
   distance /= bconfig->sizeof_node;
 
@@ -187,7 +187,7 @@ g_bsearch_array_grow (GBSearchArray        *barray,
   guint new_size = old_size + bconfig->sizeof_node;
   guint8 *node;
 
-  assert_return (index <= barray->n_nodes, NULL);
+  RAPICORN_ASSERT_RETURN (index <= barray->n_nodes, NULL);
 
   if (G_UNLIKELY (bconfig->flags & G_BSEARCH_ARRAY_ALIGN_POWER2))
     {
@@ -251,7 +251,7 @@ g_bsearch_array_remove (GBSearchArray        *barray,
 {
   guint8 *node;
 
-  assert_return (index < barray->n_nodes, NULL);
+  RAPICORN_ASSERT_RETURN (index < barray->n_nodes, NULL);
 
   barray->n_nodes -= 1;
   node = G_BSEARCH_ARRAY_NODES (barray) + index * bconfig->sizeof_node;
@@ -284,7 +284,7 @@ static inline void
 g_bsearch_array_free (GBSearchArray        *barray,
                       const GBSearchConfig *bconfig)
 {
-  assert_return (barray != NULL);
+  RAPICORN_ASSERT_RETURN (barray != NULL);
 
   g_free (barray);
 }
diff --git a/sfi/glib-extra.hh b/sfi/glib-extra.hh
index b1d4f42..eac069d 100644
--- a/sfi/glib-extra.hh
+++ b/sfi/glib-extra.hh
@@ -171,7 +171,7 @@ g_bit_matrix_change (GBitMatrix     *matrix,
                      gboolean        bit_set)
 {
   guint32 cons, index, shift;
-  assert_return (matrix && x < matrix->width && y < matrix->height);
+  RAPICORN_ASSERT_RETURN (matrix && x < matrix->width && y < matrix->height);
   cons = y * matrix->width + x;
   index = cons >> 5; /* / 32 */
   shift = cons & 0x1f;  /* % 32 */
diff --git a/sfi/sficxx.hh b/sfi/sficxx.hh
index b40101a..13f3cef 100644
--- a/sfi/sficxx.hh
+++ b/sfi/sficxx.hh
@@ -611,7 +611,7 @@ public:
   void
   unref ()
   {
-    assert_return (block != NULL && block->ref_count > 1);
+    RAPICORN_ASSERT_RETURN (block != NULL && block->ref_count > 1);
     sfi_fblock_unref (block);
   }
   void
@@ -752,7 +752,7 @@ public:
   void
   unref ()
   {
-    assert_return (block != NULL && block->ref_count > 1);
+    RAPICORN_ASSERT_RETURN (block != NULL && block->ref_count > 1);
     sfi_bblock_unref (block);
   }
   void resize (unsigned int length)
@@ -883,7 +883,7 @@ public:
   void
   unref ()
   {
-    assert_return (crec != NULL && crec->ref_count > 1);
+    RAPICORN_ASSERT_RETURN (crec != NULL && crec->ref_count > 1);
     sfi_rec_unref (crec);
   }
   void
@@ -989,13 +989,13 @@ public:
   void
   ref ()
   {
-    assert_return (cobj != NULL && cobj->ref_count > 0);
+    RAPICORN_ASSERT_RETURN (cobj != NULL && cobj->ref_count > 0);
     g_object_ref (cobj);
   }
   void
   unref ()
   {
-    assert_return (cobj != NULL && cobj->ref_count > 1);
+    RAPICORN_ASSERT_RETURN (cobj != NULL && cobj->ref_count > 1);
     g_object_unref (cobj);
   }
   void
diff --git a/sfi/sfivisitors.hh b/sfi/sfivisitors.hh
index 016687d..41f6a56 100644
--- a/sfi/sfivisitors.hh
+++ b/sfi/sfivisitors.hh
@@ -356,7 +356,7 @@ sfi_pspecs_fields_from_accessor_visitable (Visitable &visitable)
   sfi_pspecs_acs_fields_cache (typeid (Visitable), &pspecsp, true);
   pspecsp = NULL;
   bool success = sfi_pspecs_acs_fields_cache (typeid (Visitable), &pspecsp);
-  assert (success && pspecsp);
+  RAPICORN_ASSERT (success && pspecsp);
   return *pspecsp;
 }
 
-- 
2.1.4



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