[beast: 13/43] BST: only use Bse::assert_return{_unreached} and Bse::warning everywhere
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 13/43] BST: only use Bse::assert_return{_unreached} and Bse::warning everywhere
- Date: Mon, 26 Jun 2017 23:28:23 +0000 (UTC)
commit 58feb15d12f7ad3cfdb89117d4c61cc44a4317a3
Author: Tim Janik <timj gnu org>
Date: Sun Jun 25 16:01:50 2017 +0200
BST: only use Bse::assert_return{_unreached} and Bse::warning everywhere
Signed-off-by: Tim Janik <timj gnu org>
beast-gtk/bstapp.cc | 2 +-
beast-gtk/bstbuseditor.cc | 2 +-
beast-gtk/bstdbmeter.cc | 2 +-
beast-gtk/bstgconfig.cc | 2 +-
beast-gtk/bstkeybindings.cc | 4 ++--
beast-gtk/bstknob.cc | 2 +-
beast-gtk/bstmenus.cc | 2 +-
beast-gtk/bstmsgabsorb.cc | 2 +-
beast-gtk/bstparam.cc | 6 +++---
beast-gtk/bstpatterncolumns.cc | 4 ++--
beast-gtk/bstpianorollctrl.cc | 2 +-
beast-gtk/bstplayback.cc | 2 +-
beast-gtk/bstqsampler.cc | 4 ++--
beast-gtk/bstscrollgraph.cc | 2 +-
beast-gtk/bstskinconfig.cc | 2 +-
beast-gtk/bstsnetrouter.cc | 6 +++---
beast-gtk/bstusermessage.cc | 2 +-
beast-gtk/bstutils.cc | 6 +++---
beast-gtk/bstwaveeditor.cc | 2 +-
19 files changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/beast-gtk/bstapp.cc b/beast-gtk/bstapp.cc
index 8e44848..985ad2a 100644
--- a/beast-gtk/bstapp.cc
+++ b/beast-gtk/bstapp.cc
@@ -1077,7 +1077,7 @@ app_action_exec (gpointer data,
Rapicorn::Aida::enum_info<Bse::UserMessageType>().find_value
(demo_type).ident));
break;
default:
- assert_unreached ();
+ assert_return_unreached ();
break;
}
diff --git a/beast-gtk/bstbuseditor.cc b/beast-gtk/bstbuseditor.cc
index b8bd33b..213797f 100644
--- a/beast-gtk/bstbuseditor.cc
+++ b/beast-gtk/bstbuseditor.cc
@@ -70,7 +70,7 @@ static void
bus_editor_release_item (SfiProxy item,
BstBusEditor *self)
{
- assert (self->item == item);
+ assert_return (self->item == item);
bst_bus_editor_set_bus (self, 0);
}
diff --git a/beast-gtk/bstdbmeter.cc b/beast-gtk/bstdbmeter.cc
index 9d74bc7..0326f2d 100644
--- a/beast-gtk/bstdbmeter.cc
+++ b/beast-gtk/bstdbmeter.cc
@@ -131,7 +131,7 @@ bst_db_setup_get_color (BstDBSetup *dbsetup,
else
offset = i;
}
- assert (offset == 0 || pixel >= dbsetup->colors[offset].pixel);
+ assert_return (offset == 0 || pixel >= dbsetup->colors[offset].pixel, 0);
if (pixel >= dbsetup->colors[offset].pixel && offset + 1 < dbsetup->n_colors)
{ /* linear interpolation */
guint c1 = dbsetup->colors[offset].rgb;
diff --git a/beast-gtk/bstgconfig.cc b/beast-gtk/bstgconfig.cc
index e57c0ef..7c31bab 100644
--- a/beast-gtk/bstgconfig.cc
+++ b/beast-gtk/bstgconfig.cc
@@ -187,7 +187,7 @@ rc_file_try_statement (gpointer context_data,
GScanner *scanner,
gpointer user_data)
{
- assert (scanner->next_token == G_TOKEN_IDENTIFIER);
+ assert_return (scanner->next_token == G_TOKEN_IDENTIFIER, G_TOKEN_ERROR);
if (strcmp (bst_gconfig_pspec ()->name, scanner->next_value.v_identifier) == 0)
{
GValue *value = sfi_value_rec (NULL);
diff --git a/beast-gtk/bstkeybindings.cc b/beast-gtk/bstkeybindings.cc
index 16277c0..f333de3 100644
--- a/beast-gtk/bstkeybindings.cc
+++ b/beast-gtk/bstkeybindings.cc
@@ -222,7 +222,7 @@ key_bindings_exec_action (gpointer data,
}
break;
default:
- assert_unreached ();
+ assert_return_unreached ();
break;
}
gxk_status_window_pop ();
@@ -645,7 +645,7 @@ key_binding_try_statement (gpointer context_data,
gpointer user_data)
{
GSList *slist, *kbindings = (GSList*) context_data;
- assert (scanner->next_token == G_TOKEN_IDENTIFIER);
+ assert_return (scanner->next_token == G_TOKEN_IDENTIFIER, G_TOKEN_ERROR);
for (slist = kbindings; slist; slist = slist->next)
{
BstKeyBinding *kbinding = (BstKeyBinding*) slist->data;
diff --git a/beast-gtk/bstknob.cc b/beast-gtk/bstknob.cc
index 8516f84..324b883 100644
--- a/beast-gtk/bstknob.cc
+++ b/beast-gtk/bstknob.cc
@@ -598,7 +598,7 @@ bst_knob_init (BstKnob *knob)
knob->old_page_size = 0.0;
knob->adjustment = NULL;
knob->pixbuf = (GdkPixbuf*) g_object_ref (bst_pixbuf_knob ());
- assert (knob->pixbuf);
+ assert_return (knob->pixbuf);
gtk_image_set_from_pixbuf (GTK_IMAGE (knob), knob->pixbuf);
w = gdk_pixbuf_get_width (knob->pixbuf);
diff --git a/beast-gtk/bstmenus.cc b/beast-gtk/bstmenus.cc
index 1fdb0b5..e0bf638 100644
--- a/beast-gtk/bstmenus.cc
+++ b/beast-gtk/bstmenus.cc
@@ -64,7 +64,7 @@ menu_choice_activate (GtkWidget *item,
if (GTK_IS_MENU_ITEM (tmp))
item = tmp;
}
- assert (GTK_IS_MENU (item));
+ assert_return (GTK_IS_MENU (item));
gtk_object_set_data (GTK_OBJECT (item), "BstChoice", udata);
}
diff --git a/beast-gtk/bstmsgabsorb.cc b/beast-gtk/bstmsgabsorb.cc
index 10d7722..6c4efb7 100644
--- a/beast-gtk/bstmsgabsorb.cc
+++ b/beast-gtk/bstmsgabsorb.cc
@@ -278,7 +278,7 @@ msg_absorb_config_try_statement (gpointer context_data,
GScanner *scanner,
gpointer user_data)
{
- assert (scanner->next_token == G_TOKEN_IDENTIFIER);
+ assert_return (scanner->next_token == G_TOKEN_IDENTIFIER, G_TOKEN_ERROR);
if (strcmp (bst_msg_absorb_config_pspec()->name, scanner->next_value.v_identifier) == 0)
{
GValue *value = sfi_value_seq (NULL);
diff --git a/beast-gtk/bstparam.cc b/beast-gtk/bstparam.cc
index 12affe4..d3eefc5 100644
--- a/beast-gtk/bstparam.cc
+++ b/beast-gtk/bstparam.cc
@@ -411,7 +411,7 @@ aida_parameter_binding_set_value (GxkParam *param, const GValue *value)
any.set (g_value_get_string (value));
break;
default:
- critical ("%s: unsupported type: %s", __func__, g_type_name (G_PARAM_SPEC_VALUE_TYPE (param->pspec)));
+ Bse::warning ("%s: unsupported type: %s", __func__, g_type_name (G_PARAM_SPEC_VALUE_TYPE
(param->pspec)));
return;
}
apa->set (any);
@@ -452,7 +452,7 @@ aida_parameter_binding_get_value (GxkParam *param, GValue *param_value)
}
break;
default:
- critical ("%s: unsupported type: %s", __func__, g_type_name (G_PARAM_SPEC_VALUE_TYPE (param->pspec)));
+ Bse::warning ("%s: unsupported type: %s", __func__, g_type_name (G_PARAM_SPEC_VALUE_TYPE
(param->pspec)));
return;
}
if (G_VALUE_TYPE (&value))
@@ -554,7 +554,7 @@ bst_param_xframe_check_button (GxkParam *param,
void
_bst_init_params (void)
{
- assert (quark_null_group == 0);
+ assert_return (quark_null_group == 0);
quark_null_group = g_quark_from_static_string ("bst-param-null-group");
quark_param_choice_values = g_quark_from_static_string ("bst-param-choice-values");
diff --git a/beast-gtk/bstpatterncolumns.cc b/beast-gtk/bstpatterncolumns.cc
index 75a4f8c..977ca03 100644
--- a/beast-gtk/bstpatterncolumns.cc
+++ b/beast-gtk/bstpatterncolumns.cc
@@ -284,7 +284,7 @@ static guint
control_get_digit_increment (guint num_type,
guint nth_digits)
{
- assert (nth_digits > 0);
+ assert_return (nth_digits > 0, 0);
if (num_type == BST_PATTERN_LFLAG_DEC)
return pow (10, nth_digits - 1);
else /* if (num_type == BST_PATTERN_LFLAG_HEX) */
@@ -868,7 +868,7 @@ bst_pattern_column_create (BstPatternLType ltype,
klass = &pattern_column_event_class;
break;
}
- assert (klass->instance_size >= sizeof (BstPatternColumn));
+ assert_return (klass->instance_size >= sizeof (BstPatternColumn), NULL);
column = (BstPatternColumn*) g_malloc0 (klass->instance_size);
column->klass = klass;
column->num = num;
diff --git a/beast-gtk/bstpianorollctrl.cc b/beast-gtk/bstpianorollctrl.cc
index 92417e9..3e7f5d3 100644
--- a/beast-gtk/bstpianorollctrl.cc
+++ b/beast-gtk/bstpianorollctrl.cc
@@ -909,7 +909,7 @@ controller_piano_drag (BstPianoRollController *self,
if (projectid && track)
{
Bse::ProjectH project = Bse::ProjectH::down_cast (bse_server.from_proxy (projectid));
- assert (project);
+ assert_return (project);
if (drag->type == GXK_DRAG_START ||
(drag->type == GXK_DRAG_MOTION &&
self->obj_note != drag->current_note))
diff --git a/beast-gtk/bstplayback.cc b/beast-gtk/bstplayback.cc
index 0e8a410..9c54710 100644
--- a/beast-gtk/bstplayback.cc
+++ b/beast-gtk/bstplayback.cc
@@ -107,7 +107,7 @@ wave_oscillator_pcm_notify (BstPlayBackHandle *handle,
{
gboolean discard_next_notify = handle->discard_next_notify;
- assert (handle->wosc1 == wosc);
+ assert_return (handle->wosc1 == wosc);
handle->waiting_for_notify = FALSE;
handle->discard_next_notify = FALSE;
diff --git a/beast-gtk/bstqsampler.cc b/beast-gtk/bstqsampler.cc
index c309a5e..335486d 100644
--- a/beast-gtk/bstqsampler.cc
+++ b/beast-gtk/bstqsampler.cc
@@ -452,7 +452,7 @@ bst_qsampler_update_types (BstQSampler *qsampler,
guint rstart = r->offset / qsampler->zoom_factor;
guint rend = last_peek_from_pcm_region (qsampler, r->offset, r->length);
- assert (rstart <= rend);
+ assert_return (rstart <= rend);
/* intersect */
s = MAX (start, rstart);
@@ -470,7 +470,7 @@ bst_qsampler_update_types (BstQSampler *qsampler,
guint mstart = m->offset / qsampler->zoom_factor;
guint mend = last_peek_from_pcm_region (qsampler, m->offset, 1);
- assert (mstart <= mend);
+ assert_return (mstart <= mend);
/* intersect */
s = MAX (start, mstart);
diff --git a/beast-gtk/bstscrollgraph.cc b/beast-gtk/bstscrollgraph.cc
index f5b8a21..cc5bd5e 100644
--- a/beast-gtk/bstscrollgraph.cc
+++ b/beast-gtk/bstscrollgraph.cc
@@ -443,7 +443,7 @@ static void
bst_scrollgraph_release_item (SfiProxy item,
BstScrollgraph *self)
{
- assert (self->source == item);
+ assert_return (self->source == item);
bst_scrollgraph_set_source (self, 0, 0);
if (self->delete_toplevel)
gxk_toplevel_delete (GTK_WIDGET (self));
diff --git a/beast-gtk/bstskinconfig.cc b/beast-gtk/bstskinconfig.cc
index 727dd6a..7b60e66 100644
--- a/beast-gtk/bstskinconfig.cc
+++ b/beast-gtk/bstskinconfig.cc
@@ -238,7 +238,7 @@ skin_file_try_statement (gpointer context_data,
gpointer user_data)
{
const char *absname = (const char*) user_data;
- assert (scanner->next_token == G_TOKEN_IDENTIFIER);
+ assert_return (scanner->next_token == G_TOKEN_IDENTIFIER, G_TOKEN_ERROR);
if (strcmp (bst_skin_config_pspec()->name, scanner->next_value.v_identifier) == 0)
{
GValue *value = sfi_value_rec (NULL);
diff --git a/beast-gtk/bstsnetrouter.cc b/beast-gtk/bstsnetrouter.cc
index d15fc96..957ec09 100644
--- a/beast-gtk/bstsnetrouter.cc
+++ b/beast-gtk/bstsnetrouter.cc
@@ -162,9 +162,9 @@ bst_snet_router_update_links (BstSNetRouter *self,
for (j = 0; j < n_joints; j++)
{
Bse::ObjectH obj = bse_server.from_proxy (csource->source);
- assert (obj != NULL);
+ assert_return (obj != NULL);
Bse::SourceH isource = Bse::SourceH::down_cast (bse_server.from_proxy (csource->source));
- assert (isource != NULL);
+ assert_return (isource != NULL);
SfiProxy osource = isource.ichannel_get_osource (i, j).proxy_id();
if (!osource)
continue;
@@ -1085,7 +1085,7 @@ bst_snet_router_init (BstSNetRouter *self)
const char *stock_id;
if (icon.width && icon.height)
{
- assert (icon.width * icon.height == int (icon.pixels.size()));
+ assert_return (icon.width * icon.height == int (icon.pixels.size()));
bst_stock_register_icon (ad.entity.c_str(), 4, icon.width, icon.height, icon.width * 4, (const
uint8*) icon.pixels.data());
stock_id = ad.entity.c_str();
}
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index 3992b12..97f4a2e 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -23,7 +23,7 @@ bst_msg_type_ident (BstMsgType bmt)
case BST_MSG_SCRIPT: return "script";
default: ;
}
- assert_unreached();
+ assert_return_unreached (NULL);
}
static void
diff --git a/beast-gtk/bstutils.cc b/beast-gtk/bstutils.cc
index 8e38244..d7b71ce 100644
--- a/beast-gtk/bstutils.cc
+++ b/beast-gtk/bstutils.cc
@@ -63,7 +63,7 @@ Bse::ServerH bse_server;
void
_bst_init_utils (void)
{
- assert (stock_icon_factory == NULL);
+ assert_return (stock_icon_factory == NULL);
stock_icon_factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (stock_icon_factory);
@@ -482,7 +482,7 @@ bst_action_list_add_cat (GxkActionList *alist, const Bse::Category &cat, uint sk
if (cat.icon.pixels.size())
{
const Bse::Icon &icon = cat.icon;
- assert (icon.width * size_t (icon.height) == icon.pixels.size());
+ assert_return (icon.width * size_t (icon.height) == icon.pixels.size());
bst_stock_register_icon (cat.category, 4,
icon.width, icon.height,
icon.width * 4,
@@ -512,7 +512,7 @@ bst_action_list_add_module (GxkActionList *alist, const Bse::AuxData &ad, const
const char *stock_id;
if (icon.width && icon.height)
{
- assert (icon.width * icon.height == int (icon.pixels.size()));
+ assert_return (icon.width * icon.height == int (icon.pixels.size()));
bst_stock_register_icon (ad.entity.c_str(), 4, icon.width, icon.height, icon.width * 4, (const uint8*)
icon.pixels.data());
stock_id = ad.entity.c_str();
}
diff --git a/beast-gtk/bstwaveeditor.cc b/beast-gtk/bstwaveeditor.cc
index 9766958..fb8aa3c 100644
--- a/beast-gtk/bstwaveeditor.cc
+++ b/beast-gtk/bstwaveeditor.cc
@@ -572,7 +572,7 @@ tree_selection_changed (BstWaveEditor *self,
{
gchar *osc_str, *mix_str;
- assert (self->chunk_wrapper == (GxkListWrapper*) model);
+ assert_return (self->chunk_wrapper == (GxkListWrapper*) model);
gtk_tree_model_get (model, &iter,
COL_OSC_FREQ, &osc_str,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]