[beast: 2/16] BSE: use BSE_ASSERT_RETURN instead of a Rapicorn macro
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 2/16] BSE: use BSE_ASSERT_RETURN instead of a Rapicorn macro
- Date: Sat, 30 Sep 2017 01:02:52 +0000 (UTC)
commit b0d09cbc5bf6c562d3c584cb3adabd022af4efc1
Author: Tim Janik <timj gnu org>
Date: Mon Sep 18 21:33:40 2017 +0200
BSE: use BSE_ASSERT_RETURN instead of a Rapicorn macro
Signed-off-by: Tim Janik <timj gnu org>
bse/bsecxxplugin.hh | 2 +-
bse/bsecxxutils.hh | 2 +-
bse/bseitem.hh | 8 ++++----
bse/bseloader-guspatch.cc | 2 +-
bse/bseresampler.hh | 2 +-
bse/bseresamplerimpl.hh | 8 ++++----
bse/gsldatautils.hh | 12 ++++++------
7 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/bse/bsecxxplugin.hh b/bse/bsecxxplugin.hh
index 70eb8d4..70e89cc 100644
--- a/bse/bsecxxplugin.hh
+++ b/bse/bsecxxplugin.hh
@@ -118,7 +118,7 @@ const SfiInt MAX_FINE_TUNE = BSE_MAX_FINE_TUNE;
if (!values[0].value_name) { \
GEnumValue *v = values; \
ICode; /* initializes values via *v++ = ...; */ \
- RAPICORN_ASSERT (v == values + N); \
+ BSE_ASSERT_RETURN (v == values + N, NULL); \
*v++ = ::Bse::EnumValue (0, 0, 0); /* NULL termination */ \
} \
return values; \
diff --git a/bse/bsecxxutils.hh b/bse/bsecxxutils.hh
index fd000a1..2b99b85 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);
- RAPICORN_ASSERT (type);
+ BSE_ASSERT_RETURN (type, 0);
}
return type;
}
diff --git a/bse/bseitem.hh b/bse/bseitem.hh
index 822619a..e425702 100644
--- a/bse/bseitem.hh
+++ b/bse/bseitem.hh
@@ -170,7 +170,7 @@ public:
template<typename ItemT, typename... FuncArgs, typename... CallArgs> void
push_undo (const String &blurb, ItemT &self, Error (ItemT::*function) (FuncArgs...), CallArgs... args)
{
- RAPICORN_ASSERT_RETURN (this == &self);
+ BSE_ASSERT_RETURN (this == &self);
UndoLambda lambda = [function, args...] (ItemImpl &item, BseUndoStack *ustack) {
ItemT &self = dynamic_cast<ItemT&> (item);
return (self.*function) (args...);
@@ -181,7 +181,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)
{
- RAPICORN_ASSERT_RETURN (this == &self);
+ BSE_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<Error (ItemT &item, BseUndoStack *ustack)> &undo_lambda = itemt_lambda;
- RAPICORN_ASSERT_RETURN (this == &self);
+ BSE_ASSERT_RETURN (this == &self);
UndoLambda lambda = [undo_lambda] (ItemImpl &item, BseUndoStack *ustack) {
ItemT &self = dynamic_cast<ItemT&> (item);
return undo_lambda (self, ustack);
@@ -206,7 +206,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<Error (ItemT &item, BseUndoStack *ustack)> &undo_lambda = itemt_lambda;
- RAPICORN_ASSERT_RETURN (this == &self);
+ BSE_ASSERT_RETURN (this == &self);
auto lambda = [blurb, undo_lambda] (ItemT &self, BseUndoStack *ustack) -> Error {
self.push_undo (blurb, self, undo_lambda);
return Error::NONE;
diff --git a/bse/bseloader-guspatch.cc b/bse/bseloader-guspatch.cc
index a23075e..d5607cd 100644
--- a/bse/bseloader-guspatch.cc
+++ b/bse/bseloader-guspatch.cc
@@ -342,7 +342,7 @@ struct FileInfo
case PAT_FORMAT_16BIT: return GSL_WAVE_FORMAT_SIGNED_16;
case PAT_FORMAT_UNSIGNED | PAT_FORMAT_16BIT: return GSL_WAVE_FORMAT_UNSIGNED_16;
}
- RAPICORN_ASSERT_UNREACHED();
+ BSE_ASSERT_RETURN_UNREACHED (GSL_WAVE_FORMAT_NONE);
}
int
diff --git a/bse/bseresampler.hh b/bse/bseresampler.hh
index 40b41fb..22c3ae4 100644
--- a/bse/bseresampler.hh
+++ b/bse/bseresampler.hh
@@ -106,7 +106,7 @@ protected:
taps[i] = d[i] * scaling;
Resampler2 *filter = new Filter (taps);
- RAPICORN_ASSERT (order == filter->order());
+ BSE_ASSERT_RETURN (order == filter->order(), NULL);
return filter;
}
/* creates the actual implementation; specifying USE_SSE=true will use
diff --git a/bse/bseresamplerimpl.hh b/bse/bseresamplerimpl.hh
index 094c575..5f3006e 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
- RAPICORN_ASSERT_UNREACHED();
+ BSE_ASSERT_RETURN_UNREACHED();
#endif
}
@@ -289,7 +289,7 @@ public:
history (2 * ORDER),
sse_taps (fir_compute_sse_taps (taps))
{
- RAPICORN_ASSERT ((ORDER & 1) == 0); /* even order filter */
+ BSE_ASSERT_RETURN ((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))
{
- RAPICORN_ASSERT ((ORDER & 1) == 0); /* even order filter */
+ BSE_ASSERT_RETURN ((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)
{
- RAPICORN_ASSERT ((n_input_samples & 1) == 0);
+ BSE_ASSERT_RETURN ((n_input_samples & 1) == 0);
const uint BLOCKSIZE = 1024;
diff --git a/bse/gsldatautils.hh b/bse/gsldatautils.hh
index 73758e9..05773ef 100644
--- a/bse/gsldatautils.hh
+++ b/bse/gsldatautils.hh
@@ -371,7 +371,7 @@ gsl_conv_from_float (GslWaveFormatType format,
while (u32src < u32bound);
return n_values * 4;
default:
- RAPICORN_ASSERT_UNREACHED();
+ BSE_ASSERT_RETURN_UNREACHED (0);
return 0;
}
}
@@ -602,7 +602,7 @@ gsl_conv_from_float_clip (GslWaveFormatType format,
while (u32src < u32bound);
return n_values << 2;
default:
- RAPICORN_ASSERT_UNREACHED();
+ BSE_ASSERT_RETURN_UNREACHED (0);
return 0;
}
}
@@ -821,7 +821,7 @@ gsl_conv_to_float (GslWaveFormatType format,
while (u32dest < u32bound);
break;
default:
- RAPICORN_ASSERT_UNREACHED();
+ BSE_ASSERT_RETURN_UNREACHED();
}
}
@@ -1028,7 +1028,7 @@ gsl_conv_from_double (GslWaveFormatType format,
while (u32src < u32bound);
return n_values << 2;
default:
- RAPICORN_ASSERT_UNREACHED();
+ BSE_ASSERT_RETURN_UNREACHED (0);
return 0;
}
}
@@ -1259,7 +1259,7 @@ gsl_conv_from_double_clip (GslWaveFormatType format,
while (u32src < u32bound);
return n_values << 2;
default:
- RAPICORN_ASSERT_UNREACHED();
+ BSE_ASSERT_RETURN_UNREACHED (0);
return 0;
}
}
@@ -1428,7 +1428,7 @@ gsl_conv_to_double (GslWaveFormatType format,
while (u32dest < u32bound);
break;
default:
- RAPICORN_ASSERT_UNREACHED();
+ BSE_ASSERT_RETURN_UNREACHED();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]