[beast: 6/22] BEAST: use Rapicorn's assert_return()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 6/22] BEAST: use Rapicorn's assert_return()
- Date: Thu, 24 Sep 2015 20:09:28 +0000 (UTC)
commit 917b99419ef0ac61ef8f4a1c1a11cfbc457494da
Author: Tim Janik <timj gnu org>
Date: Mon Sep 21 19:46:43 2015 +0200
BEAST: use Rapicorn's assert_return()
beast-gtk/bstapp.cc | 10 ++--
beast-gtk/bstasciipixbuf.cc | 6 +-
beast-gtk/bstbuseditor.cc | 4 +-
beast-gtk/bstbusmixer.cc | 2 +-
beast-gtk/bstbusview.cc | 2 +-
beast-gtk/bstcanvaslink.cc | 18 +++---
beast-gtk/bstcanvassource.cc | 34 ++++++------
beast-gtk/bstcluehunter.cc | 44 ++++++++--------
beast-gtk/bstdbmeter.cc | 26 +++++-----
beast-gtk/bstdial.cc | 36 +++++++-------
beast-gtk/bsteffectview.cc | 12 ++--
beast-gtk/bsteventroll.cc | 20 ++++----
beast-gtk/bsteventrollctrl.cc | 24 ++++----
beast-gtk/bstfiledialog.cc | 4 +-
beast-gtk/bstgconfig.cc | 8 ++--
beast-gtk/bstitemseqdialog.cc | 4 +-
beast-gtk/bstitemview.cc | 38 +++++++-------
beast-gtk/bstkeybindings.cc | 4 +-
beast-gtk/bstknob.cc | 20 ++++----
beast-gtk/bstlogadjustment.cc | 12 ++--
beast-gtk/bstmenus.cc | 12 ++--
beast-gtk/bstmsgabsorb.cc | 8 ++--
beast-gtk/bstparam.cc | 14 +++---
beast-gtk/bstparamview.cc | 12 ++--
beast-gtk/bstpartdialog.cc | 2 +-
beast-gtk/bstpartview.cc | 2 +-
beast-gtk/bstpatternctrl.cc | 10 ++--
beast-gtk/bstpatternview.cc | 18 +++---
beast-gtk/bstpianoroll.cc | 16 +++---
beast-gtk/bstpianorollctrl.cc | 22 ++++----
beast-gtk/bstplayback.cc | 6 +-
beast-gtk/bstplaylist.cc | 20 ++++----
beast-gtk/bstpreferences.cc | 16 +++---
beast-gtk/bstprocedure.cc | 30 ++++++------
beast-gtk/bstprofiler.cc | 2 +-
beast-gtk/bstprojectctrl.cc | 2 +-
beast-gtk/bstqsampler.cc | 70 +++++++++++++-------------
beast-gtk/bstrackeditor.cc | 10 ++--
beast-gtk/bstrackitem.cc | 2 +-
beast-gtk/bstracktable.cc | 18 +++---
beast-gtk/bstrackview.cc | 8 ++--
beast-gtk/bstsampleeditor.cc | 6 +-
beast-gtk/bstscrollgraph.cc | 8 ++--
beast-gtk/bstsegment.cc | 6 +-
beast-gtk/bstsequence.cc | 2 +-
beast-gtk/bstservermonitor.cc | 4 +-
beast-gtk/bstskinconfig.cc | 8 ++--
beast-gtk/bstsnetrouter.cc | 16 +++---
beast-gtk/bstsnifferscope.cc | 2 +-
beast-gtk/bstsplash.cc | 8 ++--
beast-gtk/bstsupershell.cc | 2 +-
beast-gtk/bsttrackroll.cc | 40 +++++++-------
beast-gtk/bsttrackrollctrl.cc | 16 +++---
beast-gtk/bsttracksynthdialog.cc | 4 +-
beast-gtk/bsttrackview.cc | 18 +++---
beast-gtk/bsttreestores.cc | 2 +-
beast-gtk/bstusermessage.cc | 4 +-
beast-gtk/bstutils.cc | 104 +++++++++++++++++++-------------------
beast-gtk/bstwaveeditor.cc | 8 ++--
beast-gtk/bstwaveview.cc | 4 +-
beast-gtk/bstxframe.cc | 4 +-
beast-gtk/bstxkb.cc | 10 ++--
62 files changed, 452 insertions(+), 452 deletions(-)
---
diff --git a/beast-gtk/bstapp.cc b/beast-gtk/bstapp.cc
index d722ad3..b14109e 100644
--- a/beast-gtk/bstapp.cc
+++ b/beast-gtk/bstapp.cc
@@ -381,7 +381,7 @@ bst_app_finalize (GObject *object)
BstApp*
bst_app_new (Bse::ProjectH project)
{
- g_return_val_if_fail (project, NULL);
+ assert_return (project, NULL);
BstApp *self = (BstApp*) g_object_new (BST_TYPE_APP, NULL);
gxk_dialog_set_sizes (GXK_DIALOG (self), 500, 400, 950, 800);
@@ -411,7 +411,7 @@ bst_app_find (SfiProxy project)
{
GSList *slist;
- g_return_val_if_fail (BSE_IS_PROJECT (project), NULL);
+ assert_return (BSE_IS_PROJECT (project), NULL);
for (slist = bst_app_class->apps; slist; slist = slist->next)
{
@@ -426,7 +426,7 @@ bst_app_find (SfiProxy project)
static SfiProxy
bst_app_get_current_super (BstApp *app)
{
- g_return_val_if_fail (BST_IS_APP (app), 0);
+ assert_return (BST_IS_APP (app), 0);
if (app->notebook && app->notebook->cur_page)
{
GtkWidget *shell = gtk_notebook_current_widget (app->notebook);
@@ -538,7 +538,7 @@ proxyp_cmp_items (gconstpointer v1,
static void
bst_app_reload_pages (BstApp *self)
{
- g_return_if_fail (BST_IS_APP (self));
+ assert_return (BST_IS_APP (self));
GtkWidget *old_focus = GTK_WINDOW (self)->focus_widget;
if (old_focus)
@@ -643,7 +643,7 @@ bst_app_handle_delete_event (GtkWidget *widget,
static void
rebuild_super_shell (BstSuperShell *super_shell)
{
- g_return_if_fail (BST_IS_SUPER_SHELL (super_shell));
+ assert_return (BST_IS_SUPER_SHELL (super_shell));
Bse::SuperH super = super_shell->super;
bst_super_shell_set_super (super_shell, Bse::SuperH());
diff --git a/beast-gtk/bstasciipixbuf.cc b/beast-gtk/bstasciipixbuf.cc
index 5e8d528..7dbb487 100644
--- a/beast-gtk/bstasciipixbuf.cc
+++ b/beast-gtk/bstasciipixbuf.cc
@@ -29,7 +29,7 @@ bst_ascii_pixbuf_child_destroy (guint8 *pixels,
{
GdkPixbuf *pixbuf = (GdkPixbuf*) data;
- g_return_if_fail (pixbuf == ascii_pixbuf);
+ assert_return (pixbuf == ascii_pixbuf);
g_object_unref (pixbuf);
}
@@ -42,7 +42,7 @@ bst_ascii_pixbuf_new (gchar character,
guint width, i;
guint8 *pixels;
- g_return_val_if_fail (character >= 32 && character <= 126, NULL);
+ assert_return (character >= 32 && character <= 126, NULL);
bst_ascii_pixbuf_ref ();
width = gdk_pixbuf_get_width (ascii_pixbuf);
@@ -75,7 +75,7 @@ bst_ascii_pixbuf_new (gchar character,
void
bst_ascii_pixbuf_unref (void)
{
- g_return_if_fail (ascii_pixbuf != NULL);
+ assert_return (ascii_pixbuf != NULL);
g_object_unref (ascii_pixbuf);
}
diff --git a/beast-gtk/bstbuseditor.cc b/beast-gtk/bstbuseditor.cc
index 9a109d4..0e4cc2c 100644
--- a/beast-gtk/bstbuseditor.cc
+++ b/beast-gtk/bstbuseditor.cc
@@ -59,7 +59,7 @@ bst_bus_editor_finalize (GObject *object)
GtkWidget*
bst_bus_editor_new (SfiProxy bus)
{
- g_return_val_if_fail (BSE_IS_BUS (bus), NULL);
+ assert_return (BSE_IS_BUS (bus), NULL);
GtkWidget *widget = (GtkWidget*) g_object_new (BST_TYPE_BUS_EDITOR, NULL);
BstBusEditor *self = BST_BUS_EDITOR (widget);
bst_bus_editor_set_bus (self, bus);
@@ -125,7 +125,7 @@ bst_bus_editor_set_bus (BstBusEditor *self,
SfiProxy item)
{
if (item)
- g_return_if_fail (BSE_IS_BUS (item));
+ assert_return (BSE_IS_BUS (item));
if (self->item)
{
bse_proxy_disconnect (self->item,
diff --git a/beast-gtk/bstbusmixer.cc b/beast-gtk/bstbusmixer.cc
index f2fdb19..1c2bb98 100644
--- a/beast-gtk/bstbusmixer.cc
+++ b/beast-gtk/bstbusmixer.cc
@@ -84,7 +84,7 @@ bst_bus_mixer_new (SfiProxy song)
{
GtkWidget *bus_mixer;
- g_return_val_if_fail (BSE_IS_SONG (song), NULL);
+ assert_return (BSE_IS_SONG (song), NULL);
bus_mixer = gtk_widget_new (BST_TYPE_BUS_MIXER, NULL);
bst_item_view_set_container (BST_ITEM_VIEW (bus_mixer), song);
diff --git a/beast-gtk/bstbusview.cc b/beast-gtk/bstbusview.cc
index c74ae72..8f8b4d9 100644
--- a/beast-gtk/bstbusview.cc
+++ b/beast-gtk/bstbusview.cc
@@ -54,7 +54,7 @@ bst_bus_view_new (SfiProxy song)
{
GtkWidget *bus_view;
- g_return_val_if_fail (BSE_IS_SONG (song), NULL);
+ assert_return (BSE_IS_SONG (song), NULL);
bus_view = gtk_widget_new (BST_TYPE_BUS_VIEW, NULL);
bst_item_view_set_container (BST_ITEM_VIEW (bus_view), song);
diff --git a/beast-gtk/bstcanvaslink.cc b/beast-gtk/bstcanvaslink.cc
index c89c3dc..ec3e05f 100644
--- a/beast-gtk/bstcanvaslink.cc
+++ b/beast-gtk/bstcanvaslink.cc
@@ -56,7 +56,7 @@ bst_canvas_link_new (GnomeCanvasGroup *group)
{
GnomeCanvasItem *item;
- g_return_val_if_fail (GNOME_IS_CANVAS_GROUP (group), NULL);
+ assert_return (GNOME_IS_CANVAS_GROUP (group), NULL);
item = gnome_canvas_item_new (group,
BST_TYPE_CANVAS_LINK,
@@ -83,7 +83,7 @@ bst_canvas_link_csource_at (BstCanvasLink *clink,
{
GnomeCanvasItem *tag;
- g_return_val_if_fail (BST_IS_CANVAS_LINK (clink), NULL);
+ assert_return (BST_IS_CANVAS_LINK (clink), NULL);
tag = gnome_canvas_typed_item_at (GNOME_CANVAS_ITEM (clink)->canvas, GNOME_TYPE_CANVAS_ELLIPSE, world_x,
world_y);
if (tag && tag == clink->tag_start)
@@ -157,7 +157,7 @@ clink_view_update (BstCanvasLink *clink,
void
bst_canvas_link_popup_view (BstCanvasLink *clink)
{
- g_return_if_fail (BST_IS_CANVAS_LINK (clink));
+ assert_return (BST_IS_CANVAS_LINK (clink));
if (!clink->link_view)
clink->link_view = (GtkWidget*) gxk_dialog_new (&clink->link_view,
@@ -177,7 +177,7 @@ bst_canvas_link_popup_view (BstCanvasLink *clink)
void
bst_canvas_link_toggle_view (BstCanvasLink *clink)
{
- g_return_if_fail (BST_IS_CANVAS_LINK (clink));
+ assert_return (BST_IS_CANVAS_LINK (clink));
if (!clink->link_view || !GTK_WIDGET_VISIBLE (clink->link_view))
bst_canvas_link_popup_view (clink);
@@ -188,7 +188,7 @@ bst_canvas_link_toggle_view (BstCanvasLink *clink)
static void
clink_view_check_update (BstCanvasLink *clink)
{
- g_return_if_fail (BST_IS_CANVAS_LINK (clink));
+ assert_return (BST_IS_CANVAS_LINK (clink));
clink_view_update (clink, FALSE);
}
@@ -198,9 +198,9 @@ bst_canvas_link_set_ocsource (BstCanvasLink *clink,
BstCanvasSource *ocsource,
guint ochannel)
{
- g_return_if_fail (BST_IS_CANVAS_LINK (clink));
+ assert_return (BST_IS_CANVAS_LINK (clink));
if (ocsource)
- g_return_if_fail (BST_CANVAS_SOURCE (ocsource));
+ assert_return (BST_CANVAS_SOURCE (ocsource));
if (clink->ocsource)
{
@@ -233,9 +233,9 @@ bst_canvas_link_set_icsource (BstCanvasLink *clink,
BstCanvasSource *icsource,
guint ichannel)
{
- g_return_if_fail (BST_IS_CANVAS_LINK (clink));
+ assert_return (BST_IS_CANVAS_LINK (clink));
if (icsource)
- g_return_if_fail (BST_CANVAS_SOURCE (icsource));
+ assert_return (BST_CANVAS_SOURCE (icsource));
if (clink->icsource)
{
diff --git a/beast-gtk/bstcanvassource.cc b/beast-gtk/bstcanvassource.cc
index 3e054b6..725b35a 100644
--- a/beast-gtk/bstcanvassource.cc
+++ b/beast-gtk/bstcanvassource.cc
@@ -83,7 +83,7 @@ bst_canvas_source_init (BstCanvasSource *csource)
static void
source_channels_changed (BstCanvasSource *csource)
{
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
GNOME_CANVAS_NOTIFY (csource);
bst_canvas_source_update_links (csource);
@@ -144,7 +144,7 @@ source_name_changed (BstCanvasSource *csource)
{
const gchar *name;
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
name = bse_item_get_name_or_type (csource->source);
@@ -226,8 +226,8 @@ bst_canvas_source_new (GnomeCanvasGroup *group,
BstCanvasSource *csource;
GnomeCanvasItem *item;
- g_return_val_if_fail (GNOME_IS_CANVAS_GROUP (group), NULL);
- g_return_val_if_fail (BSE_IS_SOURCE (source), NULL);
+ assert_return (GNOME_IS_CANVAS_GROUP (group), NULL);
+ assert_return (BSE_IS_SOURCE (source), NULL);
item = gnome_canvas_item_new (group,
BST_TYPE_CANVAS_SOURCE,
@@ -254,7 +254,7 @@ bst_canvas_source_new (GnomeCanvasGroup *group,
void
bst_canvas_source_update_links (BstCanvasSource *csource)
{
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
if (csource->source)
gtk_signal_emit (GTK_OBJECT (csource), csource_signals[SIGNAL_UPDATE_LINKS]);
@@ -282,7 +282,7 @@ bst_canvas_source_reset_params (BstCanvasSource *csource)
{
GtkWidget *param_view;
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
canvas_source_create_params (csource);
param_view = gxk_dialog_get_child (GXK_DIALOG (csource->params_dialog));
@@ -292,7 +292,7 @@ bst_canvas_source_reset_params (BstCanvasSource *csource)
void
bst_canvas_source_popup_params (BstCanvasSource *csource)
{
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
canvas_source_create_params (csource);
gxk_widget_showraise (csource->params_dialog);
@@ -301,7 +301,7 @@ bst_canvas_source_popup_params (BstCanvasSource *csource)
void
bst_canvas_source_toggle_params (BstCanvasSource *csource)
{
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
if (!csource->params_dialog || !GTK_WIDGET_VISIBLE (csource->params_dialog))
bst_canvas_source_popup_params (csource);
@@ -315,7 +315,7 @@ bst_canvas_source_set_channel_hints (BstCanvasSource *csource,
{
GSList *slist;
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
csource->show_hints = !!on_off;
if (csource->show_hints)
@@ -419,7 +419,7 @@ csource_info_update (BstCanvasSource *csource)
void
bst_canvas_source_popup_info (BstCanvasSource *csource)
{
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
if (!csource->source_info)
{
@@ -449,7 +449,7 @@ bst_canvas_source_popup_info (BstCanvasSource *csource)
void
bst_canvas_source_toggle_info (BstCanvasSource *csource)
{
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
if (!csource->source_info || !GTK_WIDGET_VISIBLE (csource->source_info))
bst_canvas_source_popup_info (csource);
@@ -469,7 +469,7 @@ gboolean
bst_canvas_source_is_jchannel (BstCanvasSource *csource,
guint ichannel)
{
- g_return_val_if_fail (BST_IS_CANVAS_SOURCE (csource), FALSE);
+ assert_return (BST_IS_CANVAS_SOURCE (csource), FALSE);
if (!csource->source)
return FALSE;
@@ -481,7 +481,7 @@ gboolean
bst_canvas_source_ichannel_free (BstCanvasSource *csource,
guint ichannel)
{
- g_return_val_if_fail (BST_IS_CANVAS_SOURCE (csource), FALSE);
+ assert_return (BST_IS_CANVAS_SOURCE (csource), FALSE);
if (!csource->source)
return FALSE;
@@ -504,7 +504,7 @@ bst_canvas_source_ichannel_pos (BstCanvasSource *csource,
{
gdouble x = 0, y = 0;
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
x = ICHANNEL_X (csource) + CHANNEL_WIDTH (csource) / 2;
if (csource->source)
@@ -526,7 +526,7 @@ bst_canvas_source_ochannel_pos (BstCanvasSource *csource,
{
gdouble x, y;
- g_return_if_fail (BST_IS_CANVAS_SOURCE (csource));
+ assert_return (BST_IS_CANVAS_SOURCE (csource));
x = OCHANNEL_X (csource) + CHANNEL_WIDTH (csource) / 2;
if (csource->source)
@@ -547,7 +547,7 @@ bst_canvas_source_ichannel_at (BstCanvasSource *csource,
{
guint channel = ~0;
- g_return_val_if_fail (BST_IS_CANVAS_SOURCE (csource), 0);
+ assert_return (BST_IS_CANVAS_SOURCE (csource), 0);
gnome_canvas_item_w2i (GNOME_CANVAS_ITEM (csource), &x, &y);
@@ -571,7 +571,7 @@ bst_canvas_source_ochannel_at (BstCanvasSource *csource,
{
guint channel = ~0;
- g_return_val_if_fail (BST_IS_CANVAS_SOURCE (csource), 0);
+ assert_return (BST_IS_CANVAS_SOURCE (csource), 0);
gnome_canvas_item_w2i (GNOME_CANVAS_ITEM (csource), &x, &y);
diff --git a/beast-gtk/bstcluehunter.cc b/beast-gtk/bstcluehunter.cc
index 44b6fb7..8d919e9 100644
--- a/beast-gtk/bstcluehunter.cc
+++ b/beast-gtk/bstcluehunter.cc
@@ -346,11 +346,11 @@ bst_clue_hunter_set_clist (BstClueHunter *self,
{
GtkWidget *clist_parent;
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
- g_return_if_fail (GTK_IS_CLIST (clist));
+ assert_return (BST_IS_CLUE_HUNTER (self));
+ assert_return (GTK_IS_CLIST (clist));
clist_parent = GTK_WIDGET (clist)->parent;
- g_return_if_fail (clist_parent == NULL);
- g_return_if_fail (column < GTK_CLIST (clist)->columns);
+ assert_return (clist_parent == NULL);
+ assert_return (column < GTK_CLIST (clist)->columns);
if (self->clist)
{
@@ -381,7 +381,7 @@ bst_clue_hunter_set_clist (BstClueHunter *self,
static void
bst_clue_hunter_popdown (BstClueHunter *self)
{
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
+ assert_return (BST_IS_CLUE_HUNTER (self));
if (self->popped_up)
g_signal_emit (self, clue_hunter_signals[SIGNAL_POPDOWN], 0);
@@ -390,7 +390,7 @@ bst_clue_hunter_popdown (BstClueHunter *self)
void
bst_clue_hunter_popup (BstClueHunter *self)
{
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
+ assert_return (BST_IS_CLUE_HUNTER (self));
if (self->popped_up == FALSE &&
self->entry && GTK_WIDGET_DRAWABLE (self->entry))
@@ -401,8 +401,8 @@ void
bst_clue_hunter_select_on (BstClueHunter *self,
const gchar *string)
{
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
- g_return_if_fail (string != NULL);
+ assert_return (BST_IS_CLUE_HUNTER (self));
+ assert_return (string != NULL);
g_signal_emit (self, clue_hunter_signals[SIGNAL_SELECT_ON], 0, string);
}
@@ -420,7 +420,7 @@ bst_clue_hunter_create_arrow (BstClueHunter *self,
{
GtkWidget *button, *arrow;
- g_return_val_if_fail (BST_IS_CLUE_HUNTER (self), NULL);
+ assert_return (BST_IS_CLUE_HUNTER (self), NULL);
button = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
"visible", TRUE,
@@ -497,11 +497,11 @@ void
bst_clue_hunter_set_entry (BstClueHunter *self,
GtkEntry *entry)
{
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
+ assert_return (BST_IS_CLUE_HUNTER (self));
if (entry)
{
- g_return_if_fail (GTK_IS_ENTRY (entry));
- g_return_if_fail (bst_clue_hunter_from_entry (entry) == NULL);
+ assert_return (GTK_IS_ENTRY (entry));
+ assert_return (bst_clue_hunter_from_entry (entry) == NULL);
}
bst_clue_hunter_popdown (self);
@@ -537,7 +537,7 @@ bst_clue_hunter_set_entry (BstClueHunter *self,
gpointer
bst_clue_hunter_from_entry (gpointer entry)
{
- g_return_val_if_fail (GTK_IS_ENTRY (entry), NULL);
+ assert_return (GTK_IS_ENTRY (entry), NULL);
return g_object_get_data (G_OBJECT (entry), "BstClueHunter");
}
@@ -548,8 +548,8 @@ bst_clue_hunter_add_string (BstClueHunter *self,
{
gchar **text;
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
- g_return_if_fail (string != NULL);
+ assert_return (BST_IS_CLUE_HUNTER (self));
+ assert_return (string != NULL);
text = g_new0 (gchar*, self->clist->columns);
text[self->clist_column] = (gchar*) string;
@@ -564,8 +564,8 @@ bst_clue_hunter_remove_string (BstClueHunter *self,
GList *list;
guint n = 0;
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
- g_return_if_fail (string != NULL);
+ assert_return (BST_IS_CLUE_HUNTER (self));
+ assert_return (string != NULL);
for (list = self->clist->row_list; list; list = list->next)
{
@@ -589,7 +589,7 @@ bst_clue_hunter_remove_matches (BstClueHunter *self,
GList *list;
guint n = 0;
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
+ assert_return (BST_IS_CLUE_HUNTER (self));
if (!pattern)
pattern = "*";
@@ -656,7 +656,7 @@ bst_clue_hunter_try_complete (BstClueHunter *self)
GSList *strings = NULL;
guint max_len = 0, n = 0;
- g_return_val_if_fail (BST_IS_CLUE_HUNTER (self), NULL);
+ assert_return (BST_IS_CLUE_HUNTER (self), NULL);
for (list = self->clist->row_list; list; list = list->next)
{
@@ -683,7 +683,7 @@ bst_clue_hunter_try_complete (BstClueHunter *self)
void
bst_clue_hunter_poll_refresh (BstClueHunter *self)
{
- g_return_if_fail (BST_IS_CLUE_HUNTER (self));
+ assert_return (BST_IS_CLUE_HUNTER (self));
if (self->entry && GTK_WIDGET_HAS_FOCUS (self->entry))
g_signal_emit (self, clue_hunter_signals[SIGNAL_POLL_REFRESH], 0);
@@ -709,7 +709,7 @@ bst_clue_hunter_do_popup (BstClueHunter *self)
gint swidth = gdk_screen_width ();
gint x = 0, y = 0, width = 0, height = 0;
- g_return_if_fail (!self->popped_up);
+ assert_return (!self->popped_up);
gtk_widget_grab_focus (GTK_WIDGET (self->entry));
if (!self->cstring)
@@ -812,7 +812,7 @@ bst_clue_hunter_do_popdown (BstClueHunter *self)
{
GtkWidget *widget = GTK_WIDGET (self);
- g_return_if_fail (self->popped_up);
+ assert_return (self->popped_up);
gtk_widget_hide (widget);
gdk_flush (); /* remove pointer instantly */
diff --git a/beast-gtk/bstdbmeter.cc b/beast-gtk/bstdbmeter.cc
index 5dc58f2..2dc5803 100644
--- a/beast-gtk/bstdbmeter.cc
+++ b/beast-gtk/bstdbmeter.cc
@@ -60,7 +60,7 @@ bst_db_setup_new (GxkSpline *db2pixel_spline,
double maxdb,
double mindb)
{
- g_return_val_if_fail (db2pixel_spline != NULL, NULL);
+ assert_return (db2pixel_spline != NULL, NULL);
guint i, zindex = 0;
double miny = db2pixel_spline->segs[0].y, maxy = miny;
for (i = 1; i < db2pixel_spline->n_segs; i++)
@@ -70,8 +70,8 @@ bst_db_setup_new (GxkSpline *db2pixel_spline,
if (!db2pixel_spline->segs[i].x)
zindex = i;
}
- g_return_val_if_fail (miny == 0, NULL);
- g_return_val_if_fail (miny < maxy, NULL);
+ assert_return (miny == 0, NULL);
+ assert_return (miny < maxy, NULL);
BstDBSetup *dbsetup = g_new0 (BstDBSetup, 1);
dbsetup->ref_count = 1;
dbsetup->spline = gxk_spline_copy (db2pixel_spline);
@@ -158,8 +158,8 @@ bst_db_setup_get_color (BstDBSetup *dbsetup,
BstDBSetup*
bst_db_setup_copy (BstDBSetup *srcdb)
{
- g_return_val_if_fail (srcdb != NULL, NULL);
- g_return_val_if_fail (srcdb->ref_count > 0, NULL);
+ assert_return (srcdb != NULL, NULL);
+ assert_return (srcdb->ref_count > 0, NULL);
BstDBSetup *dbsetup = (BstDBSetup*) g_memdup (srcdb, sizeof (srcdb[0]));
dbsetup->spline = gxk_spline_copy (srcdb->spline);
dbsetup->colors = (BstDBColor*) g_memdup (srcdb->colors, sizeof (dbsetup->colors[0]) * dbsetup->n_colors);
@@ -170,8 +170,8 @@ bst_db_setup_copy (BstDBSetup *srcdb)
BstDBSetup*
bst_db_setup_ref (BstDBSetup *dbsetup)
{
- g_return_val_if_fail (dbsetup != NULL, NULL);
- g_return_val_if_fail (dbsetup->ref_count > 0, NULL);
+ assert_return (dbsetup != NULL, NULL);
+ assert_return (dbsetup->ref_count > 0, NULL);
dbsetup->ref_count += 1;
return dbsetup;
}
@@ -179,8 +179,8 @@ bst_db_setup_ref (BstDBSetup *dbsetup)
void
bst_db_setup_unref (BstDBSetup *dbsetup)
{
- g_return_if_fail (dbsetup != NULL);
- g_return_if_fail (dbsetup->ref_count > 0);
+ assert_return (dbsetup != NULL);
+ assert_return (dbsetup->ref_count > 0);
dbsetup->ref_count -= 1;
if (!dbsetup)
{
@@ -362,7 +362,7 @@ db_labeling_draw_lateral_line (BstDBLabeling *self,
{
GtkWidget *widget = GTK_WIDGET (self);
GdkWindow *drawable = widget->window;
- g_return_if_fail (indent <= 0.5);
+ assert_return (indent <= 0.5);
gint pixindent = indent * breadth;
gint breadth_reduz = 2 * pixindent;
switch (self->justify)
@@ -1170,8 +1170,8 @@ void
bst_db_meter_propagate_setup (BstDBMeter *self,
BstDBSetup *db_setup)
{
- g_return_if_fail (BST_IS_DB_METER (self));
- g_return_if_fail (db_setup != NULL);
+ assert_return (BST_IS_DB_METER (self));
+ assert_return (db_setup != NULL);
bst_db_setup_unref (self->dbsetup);
self->dbsetup = bst_db_setup_copy (db_setup);
db_meter_setup_recursive (GTK_WIDGET (self), self->dbsetup);
@@ -1194,7 +1194,7 @@ void
bst_db_meter_propagate_border (BstDBMeter *self,
guint border)
{
- g_return_if_fail (BST_IS_DB_METER (self));
+ assert_return (BST_IS_DB_METER (self));
if (self->border != border)
{
self->border = border;
diff --git a/beast-gtk/bstdial.cc b/beast-gtk/bstdial.cc
index 016decc..45de51b 100644
--- a/beast-gtk/bstdial.cc
+++ b/beast-gtk/bstdial.cc
@@ -104,7 +104,7 @@ bst_dial_destroy (GtkObject *object)
{
BstDial *dial;
- g_return_if_fail (BST_IS_DIAL (object));
+ assert_return (BST_IS_DIAL (object));
dial = BST_DIAL (object);
@@ -215,8 +215,8 @@ static gint
bst_dial_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- g_return_val_if_fail (BST_IS_DIAL (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
+ assert_return (BST_IS_DIAL (widget), FALSE);
+ assert_return (event != NULL, FALSE);
/* since we redraw the whole widget from scratch, we ignore
* intermediate expose events
@@ -413,7 +413,7 @@ bst_dial_mouse_update (BstDial *dial,
gint xc, yc;
gdouble angle;
- g_return_if_fail (BST_IS_DIAL (dial));
+ assert_return (BST_IS_DIAL (dial));
widget = GTK_WIDGET (dial);
adjustment = GTK_ADJUSTMENT (dial->adjustment);
@@ -493,7 +493,7 @@ bst_dial_new (GtkAdjustment *adjustment)
GtkWidget *dial;
if (adjustment)
- g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), NULL);
+ assert_return (GTK_IS_ADJUSTMENT (adjustment), NULL);
else
adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 250.0, 0.0, 0.0, 0.0);
@@ -507,7 +507,7 @@ bst_dial_new (GtkAdjustment *adjustment)
GtkAdjustment*
bst_dial_get_adjustment (BstDial *dial)
{
- g_return_val_if_fail (BST_IS_DIAL (dial), NULL);
+ assert_return (BST_IS_DIAL (dial), NULL);
return GTK_ADJUSTMENT (dial->adjustment);
}
@@ -516,7 +516,7 @@ void
bst_dial_set_update_policy (BstDial *dial,
GtkUpdateType policy)
{
- g_return_if_fail (BST_IS_DIAL (dial));
+ assert_return (BST_IS_DIAL (dial));
if (dial->update_policy != policy)
{
@@ -540,8 +540,8 @@ void
bst_dial_set_adjustment (BstDial *dial,
GtkAdjustment *adjustment)
{
- g_return_if_fail (BST_IS_DIAL (dial));
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (BST_IS_DIAL (dial));
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
if (dial->adjustment)
{
@@ -577,8 +577,8 @@ bst_dial_adjustment_changed (GtkAdjustment *adjustment,
{
BstDial *dial;
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
- g_return_if_fail (data != NULL);
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (data != NULL);
dial = BST_DIAL (data);
@@ -602,8 +602,8 @@ bst_dial_adjustment_value_changed (GtkAdjustment *adjustment,
{
BstDial *dial;
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
- g_return_if_fail (data != NULL);
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (data != NULL);
dial = BST_DIAL (data);
@@ -622,7 +622,7 @@ bst_dial_update (BstDial *dial)
GtkWidget *widget;
gdouble new_value;
- g_return_if_fail (BST_IS_DIAL (dial));
+ assert_return (BST_IS_DIAL (dial));
widget = GTK_WIDGET (dial);
adjustment = GTK_ADJUSTMENT (dial->adjustment);
@@ -650,14 +650,14 @@ bst_dial_set_align_widget (BstDial *dial,
gboolean width_align,
gboolean height_align)
{
- g_return_if_fail (BST_IS_DIAL (dial));
+ assert_return (BST_IS_DIAL (dial));
if (widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (widget != GTK_WIDGET (dial));
+ assert_return (GTK_IS_WIDGET (widget));
+ assert_return (widget != GTK_WIDGET (dial));
width_align = width_align != FALSE;
height_align = height_align != FALSE;
- g_return_if_fail (width_align ^ height_align);
+ assert_return (width_align ^ height_align);
}
if (dial->align_widget)
diff --git a/beast-gtk/bsteffectview.cc b/beast-gtk/bsteffectview.cc
index abe549a..a62238c 100644
--- a/beast-gtk/bsteffectview.cc
+++ b/beast-gtk/bsteffectview.cc
@@ -231,7 +231,7 @@ bst_effect_view_new (BseSong *song)
{
GtkWidget *effect_view;
- g_return_val_if_fail (BSE_IS_SONG (song), NULL);
+ assert_return (BSE_IS_SONG (song), NULL);
effect_view = gtk_widget_new (BST_TYPE_EFFECT_VIEW, NULL);
@@ -244,12 +244,12 @@ bst_effect_view_set_note (BstEffectView *effect_view,
guint channel,
guint row)
{
- g_return_if_fail (BST_IS_EFFECT_VIEW (effect_view));
+ assert_return (BST_IS_EFFECT_VIEW (effect_view));
if (pattern)
{
- g_return_if_fail (BSE_IS_PATTERN (pattern));
- g_return_if_fail (channel < BSE_PATTERN_N_CHANNELS (pattern));
- g_return_if_fail (row < BSE_PATTERN_N_ROWS (pattern));
+ assert_return (BSE_IS_PATTERN (pattern));
+ assert_return (channel < BSE_PATTERN_N_CHANNELS (pattern));
+ assert_return (row < BSE_PATTERN_N_ROWS (pattern));
}
else
{
@@ -283,7 +283,7 @@ bst_effect_view_note_changed (BstEffectView *effect_view,
guint row,
BsePattern *pattern)
{
- g_return_if_fail (effect_view->pattern == pattern);
+ assert_return (effect_view->pattern == pattern);
if (channel == effect_view->channel && row == effect_view->row)
update_effect_lists (effect_view);
diff --git a/beast-gtk/bsteventroll.cc b/beast-gtk/bsteventroll.cc
index d7b1566..1673f91 100644
--- a/beast-gtk/bsteventroll.cc
+++ b/beast-gtk/bsteventroll.cc
@@ -177,8 +177,8 @@ bst_event_roll_add (GtkContainer *container,
{
BstEventRoll *self = BST_EVENT_ROLL (container);
- g_return_if_fail (GTK_IS_WIDGET (child));
- g_return_if_fail (self->child == NULL);
+ assert_return (GTK_IS_WIDGET (child));
+ assert_return (self->child == NULL);
gtk_widget_set_parent_window (child, VPANEL (self));
self->child = child;
@@ -191,8 +191,8 @@ bst_event_roll_remove (GtkContainer *container,
{
BstEventRoll *self = BST_EVENT_ROLL (container);
- g_return_if_fail (GTK_IS_WIDGET (child));
- g_return_if_fail (self->child == child);
+ assert_return (GTK_IS_WIDGET (child));
+ assert_return (self->child == child);
gtk_widget_unparent (child);
self->child = NULL;
@@ -206,7 +206,7 @@ bst_event_roll_forall (GtkContainer *container,
{
BstEventRoll *self = BST_EVENT_ROLL (container);
- g_return_if_fail (callback != NULL);
+ assert_return (callback != NULL);
if (self->child)
callback (self->child, callback_data);
@@ -499,7 +499,7 @@ gfloat
bst_event_roll_set_hzoom (BstEventRoll *self,
gfloat hzoom)
{
- g_return_val_if_fail (BST_IS_EVENT_ROLL (self), 0);
+ assert_return (BST_IS_EVENT_ROLL (self), 0);
bst_event_roll_hsetup (self, self->ppqn, self->qnpt, self->max_ticks, hzoom);
@@ -604,7 +604,7 @@ event_roll_unset_proxy (BstEventRoll *self)
void
bst_event_roll_set_part (BstEventRoll *self, Bse::PartH part)
{
- g_return_if_fail (BST_IS_EVENT_ROLL (self));
+ assert_return (BST_IS_EVENT_ROLL (self));
if (self->part)
bse_proxy_disconnect (self->part.proxy_id(),
@@ -630,7 +630,7 @@ bst_event_roll_set_vpanel_width_hook (BstEventRoll *self,
gint (*fetch_vpanel_width) (gpointer data),
gpointer data)
{
- g_return_if_fail (BST_IS_EVENT_ROLL (self));
+ assert_return (BST_IS_EVENT_ROLL (self));
self->fetch_vpanel_width = fetch_vpanel_width;
self->fetch_vpanel_width_data = data;
@@ -651,7 +651,7 @@ bst_event_roll_set_view_selection (BstEventRoll *self,
guint tick,
guint duration)
{
- g_return_if_fail (BST_IS_EVENT_ROLL (self));
+ assert_return (BST_IS_EVENT_ROLL (self));
if (!duration) /* invalid selection */
{
@@ -699,7 +699,7 @@ bst_event_roll_set_view_selection (BstEventRoll *self,
void
bst_event_roll_set_control_type (BstEventRoll *self, Bse::MidiSignalType control_type)
{
- g_return_if_fail (BST_IS_EVENT_ROLL (self));
+ assert_return (BST_IS_EVENT_ROLL (self));
self->control_type = control_type;
gtk_widget_queue_draw (GTK_WIDGET (self));
diff --git a/beast-gtk/bsteventrollctrl.cc b/beast-gtk/bsteventrollctrl.cc
index 1e76c0c..b7f174f 100644
--- a/beast-gtk/bsteventrollctrl.cc
+++ b/beast-gtk/bsteventrollctrl.cc
@@ -83,8 +83,8 @@ bst_event_roll_controller_new (BstEventRoll *eroll,
{
BstEventRollController *self;
- g_return_val_if_fail (BST_IS_EVENT_ROLL (eroll), NULL);
- g_return_val_if_fail (quant_rtools && canvas_rtools, NULL);
+ assert_return (BST_IS_EVENT_ROLL (eroll), NULL);
+ assert_return (quant_rtools && canvas_rtools, NULL);
self = g_new0 (BstEventRollController, 1);
self->eroll = eroll;
@@ -113,8 +113,8 @@ bst_event_roll_controller_new (BstEventRoll *eroll,
BstEventRollController*
bst_event_roll_controller_ref (BstEventRollController *self)
{
- g_return_val_if_fail (self != NULL, NULL);
- g_return_val_if_fail (self->ref_count >= 1, NULL);
+ assert_return (self != NULL, NULL);
+ assert_return (self->ref_count >= 1, NULL);
self->ref_count++;
@@ -124,8 +124,8 @@ bst_event_roll_controller_ref (BstEventRollController *self)
void
bst_event_roll_controller_unref (BstEventRollController *self)
{
- g_return_if_fail (self != NULL);
- g_return_if_fail (self->ref_count >= 1);
+ assert_return (self != NULL);
+ assert_return (self->ref_count >= 1);
self->ref_count--;
if (!self->ref_count)
@@ -260,7 +260,7 @@ event_canvas_button_tool (BstEventRollController *self,
void
bst_event_roll_controller_clear (BstEventRollController *self)
{
- g_return_if_fail (self != NULL);
+ assert_return (self != NULL);
Bse::PartH part = self->eroll->part;
const Bse::PartControlSeq &cseq = part.list_selected_controls (CONTROL_TYPE (self));
@@ -276,7 +276,7 @@ bst_event_roll_controller_clear (BstEventRollController *self)
void
bst_event_roll_controller_cut (BstEventRollController *self)
{
- g_return_if_fail (self != NULL);
+ assert_return (self != NULL);
Bse::PartH part = self->eroll->part;
const Bse::PartControlSeq &cseq = part.list_selected_controls (CONTROL_TYPE (self));
@@ -293,7 +293,7 @@ bst_event_roll_controller_cut (BstEventRollController *self)
gboolean
bst_event_roll_controller_copy (BstEventRollController *self)
{
- g_return_val_if_fail (self != NULL, FALSE);
+ assert_return (self != NULL, FALSE);
Bse::PartH part = self->eroll->part;
const Bse::PartControlSeq &cseq = part.list_selected_controls (CONTROL_TYPE (self));
@@ -304,7 +304,7 @@ bst_event_roll_controller_copy (BstEventRollController *self)
void
bst_event_roll_controller_paste (BstEventRollController *self)
{
- g_return_if_fail (self != NULL);
+ assert_return (self != NULL);
Bse::PartH part = self->eroll->part;
const Bse::PartControlSeq *cseq = bst_event_roll_controller_get_clipboard ();
@@ -360,7 +360,7 @@ guint
bst_event_roll_controller_quantize (BstEventRollController *self,
guint fine_tick)
{
- g_return_val_if_fail (self != NULL, fine_tick);
+ assert_return (self != NULL, fine_tick);
/* quantize tick */
if (QUANTIZATION (self) && self->eroll)
@@ -734,7 +734,7 @@ controller_canvas_drag (BstEventRollController *self,
return; /* unhandled */
}
size_t i = self->tool_index;
- g_return_if_fail (i < G_N_ELEMENTS (tool_table));
+ assert_return (i < G_N_ELEMENTS (tool_table));
switch (drag->type)
{
case GXK_DRAG_START:
diff --git a/beast-gtk/bstfiledialog.cc b/beast-gtk/bstfiledialog.cc
index bfed32b..019e766 100644
--- a/beast-gtk/bstfiledialog.cc
+++ b/beast-gtk/bstfiledialog.cc
@@ -278,7 +278,7 @@ bst_file_dialog_set_mode (BstFileDialog *self, gpointer parent_widget, BstFileDi
{
GtkWindow *window = GTK_WINDOW (self);
- g_return_if_fail (BST_IS_FILE_DIALOG (self));
+ assert_return (BST_IS_FILE_DIALOG (self));
gtk_widget_hide (GTK_WIDGET (self));
gtk_widget_hide (self->osave);
@@ -792,7 +792,7 @@ bst_file_dialog_set_handler (BstFileDialog *self,
{
BstFileDialogData *data = g_new0 (BstFileDialogData, 1);
- g_return_if_fail (GTK_WIDGET_VISIBLE (self));
+ assert_return (GTK_WIDGET_VISIBLE (self));
data->handler = handler;
data->data = handler_data;
diff --git a/beast-gtk/bstgconfig.cc b/beast-gtk/bstgconfig.cc
index 865ca7c..047f3c0 100644
--- a/beast-gtk/bstgconfig.cc
+++ b/beast-gtk/bstgconfig.cc
@@ -15,7 +15,7 @@ _bst_gconfig_init (void)
GValue *value;
SfiRec *rec;
- g_return_if_fail (bst_global_config == NULL);
+ assert_return (bst_global_config == NULL);
/* global config record description */
Bst::GConfig gconfig;
@@ -60,7 +60,7 @@ set_gconfig (const Bst::GConfig &gconfig)
void
bst_gconfig_apply (SfiRec *rec)
{
- g_return_if_fail (rec != NULL);
+ assert_return (rec != NULL);
SfiRec *vrec = sfi_rec_copy_deep (rec);
sfi_rec_validate (vrec, sfi_pspec_get_rec_fields (pspec_global_config));
@@ -142,7 +142,7 @@ bst_rc_dump (const gchar *file_name)
SfiRec *rec;
gint fd;
- g_return_val_if_fail (file_name != NULL, Bse::ERROR_INTERNAL);
+ assert_return (file_name != NULL, Bse::ERROR_INTERNAL);
sfi_make_dirname_path (file_name);
fd = open (file_name,
@@ -221,7 +221,7 @@ bst_rc_parse (const gchar *file_name)
Bse::ErrorType error = Bse::ERROR_NONE;
gint fd;
- g_return_val_if_fail (file_name != NULL, Bse::ERROR_INTERNAL);
+ assert_return (file_name != NULL, Bse::ERROR_INTERNAL);
fd = open (file_name, O_RDONLY, 0);
if (fd < 0)
diff --git a/beast-gtk/bstitemseqdialog.cc b/beast-gtk/bstitemseqdialog.cc
index 0019862..0dd9273 100644
--- a/beast-gtk/bstitemseqdialog.cc
+++ b/beast-gtk/bstitemseqdialog.cc
@@ -67,7 +67,7 @@ bst_item_seq_dialog_setup (BstItemSeqDialog *self,
{
GtkWindow *window = GTK_WINDOW (self);
- g_return_if_fail (BST_IS_ITEM_SEQ_DIALOG (self));
+ assert_return (BST_IS_ITEM_SEQ_DIALOG (self));
GxkFreeFunc selected_cleanup = self->selected_cleanup;
self->selected_callback = NULL;
@@ -165,7 +165,7 @@ bst_item_seq_dialog_set (BstItemSeqDialog *self,
BseItemSeq *candidates,
BseItemSeq *iseq)
{
- g_return_if_fail (BST_IS_ITEM_SEQ_DIALOG (self));
+ assert_return (BST_IS_ITEM_SEQ_DIALOG (self));
bst_item_seq_store_set (self->candidate_store, candidates);
bst_item_seq_store_set (self->item_store, iseq);
diff --git a/beast-gtk/bstitemview.cc b/beast-gtk/bstitemview.cc
index 9ac6da8..01c8ad7 100644
--- a/beast-gtk/bstitemview.cc
+++ b/beast-gtk/bstitemview.cc
@@ -79,7 +79,7 @@ bst_item_view_name_edited (BstItemView *self,
const gchar *strpath,
const gchar *text)
{
- g_return_if_fail (BST_IS_ITEM_VIEW (self));
+ assert_return (BST_IS_ITEM_VIEW (self));
if (strpath)
{
@@ -95,7 +95,7 @@ bst_item_view_blurb_edited (BstItemView *self,
const gchar *strpath,
const gchar *text)
{
- g_return_if_fail (BST_IS_ITEM_VIEW (self));
+ assert_return (BST_IS_ITEM_VIEW (self));
if (strpath)
{
@@ -123,9 +123,9 @@ GtkTreeModel*
bst_item_view_adapt_list_wrapper (BstItemView *self,
GxkListWrapper *lwrapper)
{
- g_return_val_if_fail (BST_IS_ITEM_VIEW (self), NULL);
- g_return_val_if_fail (GXK_IS_LIST_WRAPPER (lwrapper), NULL);
- g_return_val_if_fail (self->wlist == NULL, NULL);
+ assert_return (BST_IS_ITEM_VIEW (self), NULL);
+ assert_return (GXK_IS_LIST_WRAPPER (lwrapper), NULL);
+ assert_return (self->wlist == NULL, NULL);
g_object_set_data ((GObject*) lwrapper, "item-view", self);
bst_child_list_wrapper_set_listener (lwrapper, item_view_listener);
@@ -146,7 +146,7 @@ void
bst_item_view_set_tree (BstItemView *self,
GtkTreeView *tree)
{
- g_return_if_fail (self->tree == NULL);
+ assert_return (self->tree == NULL);
self->tree = tree;
gxk_nullify_in_object (self, &self->tree);
@@ -168,7 +168,7 @@ bst_item_view_complete_tree (BstItemView *self,
GtkTreeModel *smodel;
GxkListWrapper *lwrapper;
- g_return_if_fail (self->tree == NULL);
+ assert_return (self->tree == NULL);
/* item list model */
lwrapper = bst_child_list_wrapper_store_new ();
@@ -254,9 +254,9 @@ void
bst_item_view_set_container (BstItemView *self,
SfiProxy new_container)
{
- g_return_if_fail (BST_IS_ITEM_VIEW (self));
+ assert_return (BST_IS_ITEM_VIEW (self));
if (new_container)
- g_return_if_fail (BSE_IS_CONTAINER (new_container));
+ assert_return (BSE_IS_CONTAINER (new_container));
BST_ITEM_VIEW_GET_CLASS (self)->set_container (self, new_container);
@@ -267,8 +267,8 @@ void
bst_item_view_select (BstItemView *self,
SfiProxy item)
{
- g_return_if_fail (BST_IS_ITEM_VIEW (self));
- g_return_if_fail (BSE_IS_ITEM (item));
+ assert_return (BST_IS_ITEM_VIEW (self));
+ assert_return (BSE_IS_ITEM (item));
if (self->tree && bse_item_get_parent (item) == self->container)
{
@@ -292,8 +292,8 @@ gint
bst_item_view_get_proxy_row (BstItemView *self,
SfiProxy item)
{
- g_return_val_if_fail (BST_IS_ITEM_VIEW (self), -1);
- g_return_val_if_fail (BSE_IS_ITEM (item), -1);
+ assert_return (BST_IS_ITEM_VIEW (self), -1);
+ assert_return (BSE_IS_ITEM (item), -1);
if (self->tree && bse_item_get_parent (item) == self->container)
{
@@ -324,7 +324,7 @@ bst_item_view_get_proxy (BstItemView *self,
{
SfiProxy item = 0;
- g_return_val_if_fail (BST_IS_ITEM_VIEW (self), 0);
+ assert_return (BST_IS_ITEM_VIEW (self), 0);
if (self->tree && row >= 0)
{
@@ -342,7 +342,7 @@ bst_item_view_get_proxy (BstItemView *self,
gtk_tree_path_free (path);
}
if (item)
- g_return_val_if_fail (BSE_IS_ITEM (item), 0);
+ assert_return (BSE_IS_ITEM (item), 0);
return item;
}
@@ -360,7 +360,7 @@ bst_item_view_get_current (BstItemView *self)
GtkTreeIter siter;
GtkTreeModel *smodel;
- g_return_val_if_fail (BST_IS_ITEM_VIEW (self), 0);
+ assert_return (BST_IS_ITEM_VIEW (self), 0);
if (self->tree &&
gtk_tree_selection_get_selected (gtk_tree_view_get_selection (self->tree), &smodel, &siter))
@@ -373,7 +373,7 @@ bst_item_view_get_current (BstItemView *self)
item = bst_child_list_wrapper_get_from_iter (self->wlist, &witer);
}
if (item)
- g_return_val_if_fail (BSE_IS_ITEM (item), 0);
+ assert_return (BSE_IS_ITEM (item), 0);
return item;
}
@@ -381,8 +381,8 @@ void
bst_item_view_build_param_view (BstItemView *self,
GtkContainer *container)
{
- g_return_if_fail (BST_IS_ITEM_VIEW (self));
- g_return_if_fail (self->pview == NULL);
+ assert_return (BST_IS_ITEM_VIEW (self));
+ assert_return (self->pview == NULL);
/* property view */
self->pview = bst_param_view_new (0);
diff --git a/beast-gtk/bstkeybindings.cc b/beast-gtk/bstkeybindings.cc
index b350630..62dcf45 100644
--- a/beast-gtk/bstkeybindings.cc
+++ b/beast-gtk/bstkeybindings.cc
@@ -601,7 +601,7 @@ bst_key_binding_dump (const gchar *file_name,
GSList *slist;
gint fd;
- g_return_val_if_fail (file_name != NULL, Bse::ERROR_INTERNAL);
+ assert_return (file_name != NULL, Bse::ERROR_INTERNAL);
sfi_make_dirname_path (file_name);
fd = open (file_name,
@@ -680,7 +680,7 @@ bst_key_binding_parse (const gchar *file_name,
SfiRStore *rstore;
gchar *absname;
gint fd;
- g_return_val_if_fail (file_name != NULL, Bse::ERROR_INTERNAL);
+ assert_return (file_name != NULL, Bse::ERROR_INTERNAL);
absname = sfi_path_get_filename (file_name, NULL);
fd = open (absname, O_RDONLY, 0);
diff --git a/beast-gtk/bstknob.cc b/beast-gtk/bstknob.cc
index 2a9acf1..cfb0baa 100644
--- a/beast-gtk/bstknob.cc
+++ b/beast-gtk/bstknob.cc
@@ -430,7 +430,7 @@ bst_knob_new (GtkAdjustment *adjustment)
GtkWidget *knob;
if (adjustment)
- g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), NULL);
+ assert_return (GTK_IS_ADJUSTMENT (adjustment), NULL);
else
adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 250.0, 0.0, 0.0, 0.0);
@@ -444,7 +444,7 @@ bst_knob_new (GtkAdjustment *adjustment)
GtkAdjustment*
bst_knob_get_adjustment (BstKnob *knob)
{
- g_return_val_if_fail (BST_IS_KNOB (knob), NULL);
+ assert_return (BST_IS_KNOB (knob), NULL);
return GTK_ADJUSTMENT (knob->adjustment);
}
@@ -453,7 +453,7 @@ void
bst_knob_set_update_policy (BstKnob *knob,
GtkUpdateType policy)
{
- g_return_if_fail (BST_IS_KNOB (knob));
+ assert_return (BST_IS_KNOB (knob));
if (knob->update_policy != policy)
{
@@ -477,8 +477,8 @@ void
bst_knob_set_adjustment (BstKnob *knob,
GtkAdjustment *adjustment)
{
- g_return_if_fail (BST_IS_KNOB (knob));
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (BST_IS_KNOB (knob));
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
if (knob->adjustment)
{
@@ -514,8 +514,8 @@ bst_knob_adjustment_changed (GtkAdjustment *adjustment,
{
BstKnob *knob;
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
- g_return_if_fail (data != NULL);
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (data != NULL);
knob = BST_KNOB (data);
@@ -539,8 +539,8 @@ bst_knob_adjustment_value_changed (GtkAdjustment *adjustment,
{
BstKnob *knob;
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
- g_return_if_fail (data != NULL);
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (data != NULL);
knob = BST_KNOB (data);
@@ -559,7 +559,7 @@ bst_knob_update (BstKnob *knob)
GtkWidget *widget;
gdouble new_value;
- g_return_if_fail (BST_IS_KNOB (knob));
+ assert_return (BST_IS_KNOB (knob));
widget = GTK_WIDGET (knob);
adjustment = GTK_ADJUSTMENT (knob->adjustment);
diff --git a/beast-gtk/bstlogadjustment.cc b/beast-gtk/bstlogadjustment.cc
index 687a8e0..157d1f1 100644
--- a/beast-gtk/bstlogadjustment.cc
+++ b/beast-gtk/bstlogadjustment.cc
@@ -66,7 +66,7 @@ bst_log_adjustment_from_adj (GtkAdjustment *client)
{
BstLogAdjustment *ladj;
- g_return_val_if_fail (GTK_IS_ADJUSTMENT (client), NULL);
+ assert_return (GTK_IS_ADJUSTMENT (client), NULL);
ladj = (BstLogAdjustment*) g_object_new (BST_TYPE_LOG_ADJUSTMENT, NULL);
bst_log_adjustment_set_client (ladj, client);
@@ -78,9 +78,9 @@ void
bst_log_adjustment_set_client (BstLogAdjustment *ladj,
GtkAdjustment *client)
{
- g_return_if_fail (BST_IS_LOG_ADJUSTMENT (ladj));
+ assert_return (BST_IS_LOG_ADJUSTMENT (ladj));
if (client)
- g_return_if_fail (GTK_IS_ADJUSTMENT (client));
+ assert_return (GTK_IS_ADJUSTMENT (client));
g_object_ref (ladj);
if (ladj->client)
@@ -110,9 +110,9 @@ bst_log_adjustment_setup (BstLogAdjustment *ladj,
{
GtkAdjustment *adj;
- g_return_if_fail (BST_IS_LOG_ADJUSTMENT (ladj));
- g_return_if_fail (n_steps > 0);
- g_return_if_fail (base > 0);
+ assert_return (BST_IS_LOG_ADJUSTMENT (ladj));
+ assert_return (n_steps > 0);
+ assert_return (base > 0);
adj = GTK_ADJUSTMENT (ladj);
ladj->center = center;
diff --git a/beast-gtk/bstmenus.cc b/beast-gtk/bstmenus.cc
index 260a0ba..73da287 100644
--- a/beast-gtk/bstmenus.cc
+++ b/beast-gtk/bstmenus.cc
@@ -116,8 +116,8 @@ bst_choice_menu_add_choice_and_free (GtkWidget *menu,
guint choice_type, choice_flags;
GtkWidget *item;
- g_return_if_fail (GTK_IS_MENU (menu));
- g_return_if_fail (choice != NULL);
+ assert_return (GTK_IS_MENU (menu));
+ assert_return (choice != NULL);
choice_type = choice->type_and_flags & BST_CHOICE_TYPE_MASK;
choice_flags = choice->type_and_flags & BST_CHOICE_FLAG_MASK;
@@ -162,7 +162,7 @@ bst_choice_menu_set_item_sensitive (GtkWidget *menu,
GtkMenuShell *shell;
GList *list;
- g_return_if_fail (GTK_IS_MENU (menu));
+ assert_return (GTK_IS_MENU (menu));
shell = GTK_MENU_SHELL (menu);
for (list = shell->children; list; list = list->next)
@@ -214,7 +214,7 @@ bst_choice_dialog_createv (BstChoice *first_choice,
GtkWidget *vbox, *dialog;
va_list args;
- g_return_val_if_fail (first_choice != NULL, NULL);
+ assert_return (first_choice != NULL, NULL);
/* text portions
*/
@@ -301,7 +301,7 @@ bst_choice_dialog_createv (BstChoice *first_choice,
void
bst_choice_destroy (GtkWidget *choice)
{
- g_return_if_fail (GTK_IS_CONTAINER (choice));
+ assert_return (GTK_IS_CONTAINER (choice));
gtk_widget_destroy (choice);
gtk_widget_unref (choice);
@@ -312,7 +312,7 @@ bst_choice_selectable (GtkWidget *widget)
{
gboolean selectable = FALSE;
- g_return_val_if_fail (GTK_IS_CONTAINER (widget), FALSE);
+ assert_return (GTK_IS_CONTAINER (widget), FALSE);
if (GTK_IS_MENU (widget))
{
diff --git a/beast-gtk/bstmsgabsorb.cc b/beast-gtk/bstmsgabsorb.cc
index 44c26a3..aa13d02 100644
--- a/beast-gtk/bstmsgabsorb.cc
+++ b/beast-gtk/bstmsgabsorb.cc
@@ -18,7 +18,7 @@ static gboolean msg_absorb_config_loaded = FALSE;
void
_bst_msg_absorb_config_init (void)
{
- g_return_if_fail (global_msg_absorb_config == NULL);
+ assert_return (global_msg_absorb_config == NULL);
/* global config record description */
Bst::MsgAbsorbStringSeq mconfig;
@@ -67,7 +67,7 @@ set_msg_absorb_config (const Bst::MsgAbsorbStringSeq &msg_absorb_config)
void
bst_msg_absorb_config_apply (SfiSeq *src_seq)
{
- g_return_if_fail (src_seq != NULL);
+ assert_return (src_seq != NULL);
SfiSeq *seq = sfi_seq_copy_deep (src_seq);
sfi_seq_validate (seq, bst_msg_absorb_config_pspec());
@@ -233,7 +233,7 @@ bst_msg_absorb_config_box_get (GtkWidget *self)
static Bse::ErrorType
bst_msg_absorb_config_dump (const gchar *file_name)
{
- g_return_val_if_fail (file_name != NULL, Bse::ERROR_INTERNAL);
+ assert_return (file_name != NULL, Bse::ERROR_INTERNAL);
sfi_make_dirname_path (file_name);
gint fd = open (file_name,
@@ -297,7 +297,7 @@ msg_absorb_config_try_statement (gpointer context_data,
static Bse::ErrorType
bst_msg_absorb_config_parse (const gchar *file_name)
{
- g_return_val_if_fail (file_name != NULL, Bse::ERROR_INTERNAL);
+ assert_return (file_name != NULL, Bse::ERROR_INTERNAL);
gchar *absname = sfi_path_get_filename (file_name, NULL);
gint fd = open (absname, O_RDONLY, 0);
diff --git a/beast-gtk/bstparam.cc b/beast-gtk/bstparam.cc
index 9abd25c..d3f4fdc 100644
--- a/beast-gtk/bstparam.cc
+++ b/beast-gtk/bstparam.cc
@@ -78,8 +78,8 @@ bst_param_create_gmask_intern (GxkParam *param,
gboolean expand_action;
gchar *tooltip;
- g_return_val_if_fail (GXK_IS_PARAM (param), NULL);
- g_return_val_if_fail (GTK_IS_CONTAINER (parent), NULL);
+ assert_return (GXK_IS_PARAM (param), NULL);
+ assert_return (GTK_IS_CONTAINER (parent), NULL);
gxk_param_set_sizes (param_size_group, BST_GCONFIG (size_group_input_fields) ?
¶m_editor_homogeneous_sizes : NULL);
group = sfi_pspec_get_group (param->pspec);
@@ -305,8 +305,8 @@ void
bst_param_set_proxy (GxkParam *param,
SfiProxy proxy)
{
- g_return_if_fail (GXK_IS_PARAM (param));
- g_return_if_fail (param->binding == &proxy_binding);
+ assert_return (GXK_IS_PARAM (param));
+ assert_return (param->binding == &proxy_binding);
proxy_binding_destroy (param);
param->bdata[0].v_long = proxy;
@@ -322,7 +322,7 @@ bst_param_set_proxy (GxkParam *param,
SfiProxy
bst_param_get_proxy (GxkParam *param)
{
- g_return_val_if_fail (GXK_IS_PARAM (param), 0);
+ assert_return (GXK_IS_PARAM (param), 0);
if (param->binding == &proxy_binding)
return param->bdata[0].v_long;
@@ -369,7 +369,7 @@ bst_param_new_rec (GParamSpec *pspec,
SfiRec *rec)
{
GxkParam *param = gxk_param_new (pspec, &record_binding, (gpointer) FALSE);
- g_return_val_if_fail (rec != NULL, NULL);
+ assert_return (rec != NULL, NULL);
param->bdata[0].v_pointer = sfi_rec_ref (rec);
gxk_param_set_size_group (param, param_size_group);
return param;
@@ -488,7 +488,7 @@ static gboolean
bst_param_xframe_check_button (GxkParam *param,
guint button)
{
- g_return_val_if_fail (GXK_IS_PARAM (param), FALSE);
+ assert_return (GXK_IS_PARAM (param), FALSE);
#if 0
if (bparam->binding->rack_item)
{
diff --git a/beast-gtk/bstparamview.cc b/beast-gtk/bstparamview.cc
index aecbce2..b3983ce 100644
--- a/beast-gtk/bstparamview.cc
+++ b/beast-gtk/bstparamview.cc
@@ -92,7 +92,7 @@ bst_param_view_new (SfiProxy item)
GtkWidget *self = gtk_widget_new (BST_TYPE_PARAM_VIEW, NULL);
if (item)
- g_return_val_if_fail (BSE_IS_ITEM (item), NULL);
+ assert_return (BSE_IS_ITEM (item), NULL);
if (item)
bst_param_view_set_item (BST_PARAM_VIEW (self), item);
@@ -112,9 +112,9 @@ bst_param_view_set_item (BstParamView *self,
{
GSList *slist;
- g_return_if_fail (BST_IS_PARAM_VIEW (self));
+ assert_return (BST_IS_PARAM_VIEW (self));
if (item)
- g_return_if_fail (BSE_IS_ITEM (item));
+ assert_return (BSE_IS_ITEM (item));
if (item == self->item)
return;
@@ -147,7 +147,7 @@ bst_param_view_set_mask (BstParamView *param_view,
const gchar *reject_pattern,
const gchar *match_pattern)
{
- g_return_if_fail (BST_IS_PARAM_VIEW (param_view));
+ assert_return (BST_IS_PARAM_VIEW (param_view));
if (param_view->reject_pattern)
g_pattern_spec_free (param_view->reject_pattern);
@@ -166,7 +166,7 @@ bst_param_view_set_mask (BstParamView *param_view,
void
bst_param_view_apply_defaults (BstParamView *self)
{
- g_return_if_fail (BST_IS_PARAM_VIEW (self));
+ assert_return (BST_IS_PARAM_VIEW (self));
if (self->item)
{
@@ -188,7 +188,7 @@ bst_param_view_rebuild (BstParamView *self)
gint border_width = 5;
size_t i;
- g_return_if_fail (BST_IS_PARAM_VIEW (self));
+ assert_return (BST_IS_PARAM_VIEW (self));
bst_param_view_destroy_contents (self);
diff --git a/beast-gtk/bstpartdialog.cc b/beast-gtk/bstpartdialog.cc
index c772451..0ac14d2 100644
--- a/beast-gtk/bstpartdialog.cc
+++ b/beast-gtk/bstpartdialog.cc
@@ -262,7 +262,7 @@ bst_part_dialog_finalize (GObject *object)
void
bst_part_dialog_set_part (BstPartDialog *self, Bse::PartH part)
{
- g_return_if_fail (BST_IS_PART_DIALOG (self));
+ assert_return (BST_IS_PART_DIALOG (self));
if (self->project)
{
diff --git a/beast-gtk/bstpartview.cc b/beast-gtk/bstpartview.cc
index aa6ad0c..da7342b 100644
--- a/beast-gtk/bstpartview.cc
+++ b/beast-gtk/bstpartview.cc
@@ -73,7 +73,7 @@ bst_part_view_new (SfiProxy song)
{
GtkWidget *part_view;
- g_return_val_if_fail (BSE_IS_SONG (song), NULL);
+ assert_return (BSE_IS_SONG (song), NULL);
part_view = gtk_widget_new (BST_TYPE_PART_VIEW, NULL);
bst_item_view_set_container (BST_ITEM_VIEW (part_view), song);
diff --git a/beast-gtk/bstpatternctrl.cc b/beast-gtk/bstpatternctrl.cc
index f12c4f6..a42cc29 100644
--- a/beast-gtk/bstpatternctrl.cc
+++ b/beast-gtk/bstpatternctrl.cc
@@ -99,7 +99,7 @@ bst_pattern_controller_new (BstPatternView *pview,
{
BstPatternController *self;
- g_return_val_if_fail (BST_IS_PATTERN_VIEW (pview), NULL);
+ assert_return (BST_IS_PATTERN_VIEW (pview), NULL);
self = g_new0 (BstPatternController, 1);
self->vraster = gxk_param_new_value (sfi_pspec_choice ("vertical-raster", _("VZoom"),
@@ -151,8 +151,8 @@ bst_pattern_controller_new (BstPatternView *pview,
BstPatternController*
bst_pattern_controller_ref (BstPatternController *self)
{
- g_return_val_if_fail (self != NULL, NULL);
- g_return_val_if_fail (self->ref_count >= 1, NULL);
+ assert_return (self != NULL, NULL);
+ assert_return (self->ref_count >= 1, NULL);
self->ref_count++;
@@ -162,8 +162,8 @@ bst_pattern_controller_ref (BstPatternController *self)
void
bst_pattern_controller_unref (BstPatternController *self)
{
- g_return_if_fail (self != NULL);
- g_return_if_fail (self->ref_count >= 1);
+ assert_return (self != NULL);
+ assert_return (self->ref_count >= 1);
self->ref_count--;
if (!self->ref_count)
diff --git a/beast-gtk/bstpatternview.cc b/beast-gtk/bstpatternview.cc
index 53c37b8..fdfa66d 100644
--- a/beast-gtk/bstpatternview.cc
+++ b/beast-gtk/bstpatternview.cc
@@ -179,7 +179,7 @@ pattern_view_range_changed (BstPatternView *self)
void
bst_pattern_view_set_part (BstPatternView *self, Bse::PartH part)
{
- g_return_if_fail (BST_PATTERN_VIEW (self));
+ assert_return (BST_PATTERN_VIEW (self));
if (self->part)
{
@@ -916,7 +916,7 @@ bst_pattern_view_add_column (BstPatternView *self,
BstPatternLFlags lflags)
{
BstPatternColumn *col;
- g_return_if_fail (BST_PATTERN_VIEW (self));
+ assert_return (BST_PATTERN_VIEW (self));
self->cols = g_renew (BstPatternColumn*, self->cols, self->n_cols + 1);
col = bst_pattern_column_create (ltype, num, lflags);
@@ -933,14 +933,14 @@ bst_pattern_view_add_column (BstPatternView *self,
gint
bst_pattern_view_get_focus_width (BstPatternView *self)
{
- g_return_val_if_fail (BST_PATTERN_VIEW (self), 0);
+ assert_return (BST_PATTERN_VIEW (self), 0);
return (XTHICKNESS (self) + YTHICKNESS (self)) / 2;
}
gint
bst_pattern_view_get_last_row (BstPatternView *self)
{
- g_return_val_if_fail (BST_PATTERN_VIEW (self), 0);
+ assert_return (BST_PATTERN_VIEW (self), 0);
return last_visible_row (self);
}
@@ -990,7 +990,7 @@ bst_pattern_view_set_focus (BstPatternView *self, int focus_col, int focus_row)
{
GdkRectangle rect;
gint last_row;
- g_return_if_fail (BST_PATTERN_VIEW (self));
+ assert_return (BST_PATTERN_VIEW (self));
focus_col = MIN (focus_col + 1, self->n_focus_cols) - 1;
last_row = bst_pattern_view_get_last_row (self);
@@ -1043,7 +1043,7 @@ bst_pattern_view_set_marker (BstPatternView *self,
GxkScrollCanvas *scc = GXK_SCROLL_CANVAS (self);
GxkScrollMarker *marker;
guint count;
- g_return_if_fail (mark_index > 0);
+ assert_return (mark_index > 0);
mark_index += CUSTOM_MARKER_OFFSET;
marker = gxk_scroll_canvas_lookup_marker (scc, mark_index, &count);
@@ -1065,7 +1065,7 @@ bst_pattern_view_set_marker (BstPatternView *self,
return;
}
- g_return_if_fail (count == 2);
+ assert_return (count == 2);
marker[0].coords.y = position;
marker[1].coords.y = position;
@@ -1091,7 +1091,7 @@ bst_pattern_view_set_pixmarker (BstPatternView *self,
GxkScrollCanvas *scc = GXK_SCROLL_CANVAS (self);
GxkScrollMarker *marker;
guint count;
- g_return_if_fail (mark_index > 0 && mark_index < CUSTOM_MARKER_OFFSET);
+ assert_return (mark_index > 0 && mark_index < CUSTOM_MARKER_OFFSET);
marker = gxk_scroll_canvas_lookup_marker (scc, mark_index, &count);
if (!marker && !mtype)
@@ -1111,7 +1111,7 @@ bst_pattern_view_set_pixmarker (BstPatternView *self,
return;
}
- g_return_if_fail (count == 1);
+ assert_return (count == 1);
if (marker->mtype == mtype && marker->windowp == &CANVAS (self) &&
marker->extends.width == width && marker->extends.height == height)
diff --git a/beast-gtk/bstpianoroll.cc b/beast-gtk/bstpianoroll.cc
index 35cc771..b8d4003 100644
--- a/beast-gtk/bstpianoroll.cc
+++ b/beast-gtk/bstpianoroll.cc
@@ -216,7 +216,7 @@ gfloat
bst_piano_roll_set_vzoom (BstPianoRoll *self,
gfloat vzoom)
{
- g_return_val_if_fail (BST_IS_PIANO_ROLL (self), 0);
+ assert_return (BST_IS_PIANO_ROLL (self), 0);
self->vzoom = vzoom; // * KEY_DEFAULT_VPIXELS;
self->vzoom = CLAMP (self->vzoom, 1, 16);
@@ -1060,7 +1060,7 @@ bst_piano_roll_set_hzoom (BstPianoRoll *self,
gfloat hzoom)
{
GxkScrollCanvas *scc = GXK_SCROLL_CANVAS (self);
- g_return_val_if_fail (BST_IS_PIANO_ROLL (self), 0);
+ assert_return (BST_IS_PIANO_ROLL (self), 0);
bst_piano_roll_hsetup (self, self->ppqn, self->qnpt, self->max_ticks, hzoom);
guint i;
@@ -1199,7 +1199,7 @@ piano_roll_release_proxy (BstPianoRoll *self)
void
bst_piano_roll_set_part (BstPianoRoll *self, Bse::PartH part)
{
- g_return_if_fail (BST_IS_PIANO_ROLL (self));
+ assert_return (BST_IS_PIANO_ROLL (self));
if (self->part)
{
@@ -1260,7 +1260,7 @@ piano_roll_queue_region (BstPianoRoll *self, int tick, int duration, int min_not
void
bst_piano_roll_set_view_selection (BstPianoRoll *self, int tick, int duration, int min_note, int max_note)
{
- g_return_if_fail (BST_IS_PIANO_ROLL (self));
+ assert_return (BST_IS_PIANO_ROLL (self));
if (min_note > max_note || !duration) /* invalid selection */
{
@@ -1332,7 +1332,7 @@ gint
bst_piano_roll_get_vpanel_width (BstPianoRoll *self)
{
gint width = 0;
- g_return_val_if_fail (BST_IS_PIANO_ROLL (self), 0);
+ assert_return (BST_IS_PIANO_ROLL (self), 0);
if (VPANEL (self))
gdk_window_get_size (VPANEL (self), &width, NULL);
else
@@ -1348,7 +1348,7 @@ bst_piano_roll_get_paste_pos (BstPianoRoll *self,
guint tick, semitone;
gint octave;
- g_return_if_fail (BST_IS_PIANO_ROLL (self));
+ assert_return (BST_IS_PIANO_ROLL (self));
if (GTK_WIDGET_DRAWABLE (self))
{
@@ -1388,7 +1388,7 @@ bst_piano_roll_set_marker (BstPianoRoll *self,
GxkScrollCanvas *scc = GXK_SCROLL_CANVAS (self);
GxkScrollMarker *marker;
guint count;
- g_return_if_fail (mark_index > 0);
+ assert_return (mark_index > 0);
marker = gxk_scroll_canvas_lookup_marker (scc, mark_index, &count);
if (!marker && !mtype)
@@ -1408,7 +1408,7 @@ bst_piano_roll_set_marker (BstPianoRoll *self,
return;
}
- g_return_if_fail (count == 1);
+ assert_return (count == 1);
marker[0].coords.x = position;
if (marker[0].mtype != mtype || !marker[0].pixmap)
diff --git a/beast-gtk/bstpianorollctrl.cc b/beast-gtk/bstpianorollctrl.cc
index 25655dd..65a35e5 100644
--- a/beast-gtk/bstpianorollctrl.cc
+++ b/beast-gtk/bstpianorollctrl.cc
@@ -160,7 +160,7 @@ bst_piano_roll_controller_new (BstPianoRoll *proll)
{
BstPianoRollController *self;
- g_return_val_if_fail (BST_IS_PIANO_ROLL (proll), NULL);
+ assert_return (BST_IS_PIANO_ROLL (proll), NULL);
self = g_new0 (BstPianoRollController, 1);
self->proll = proll;
@@ -194,8 +194,8 @@ bst_piano_roll_controller_new (BstPianoRoll *proll)
BstPianoRollController*
bst_piano_roll_controller_ref (BstPianoRollController *self)
{
- g_return_val_if_fail (self != NULL, NULL);
- g_return_val_if_fail (self->ref_count >= 1, NULL);
+ assert_return (self != NULL, NULL);
+ assert_return (self->ref_count >= 1, NULL);
self->ref_count++;
@@ -205,8 +205,8 @@ bst_piano_roll_controller_ref (BstPianoRollController *self)
void
bst_piano_roll_controller_unref (BstPianoRollController *self)
{
- g_return_if_fail (self != NULL);
- g_return_if_fail (self->ref_count >= 1);
+ assert_return (self != NULL);
+ assert_return (self->ref_count >= 1);
self->ref_count--;
if (!self->ref_count)
@@ -342,7 +342,7 @@ piano_canvas_button_tool (BstPianoRollController *self,
void
bst_piano_roll_controller_clear (BstPianoRollController *self)
{
- g_return_if_fail (self != NULL);
+ assert_return (self != NULL);
Bse::PartH part = self->proll->part;
Bse::PartNoteSeq pseq = part.list_selected_notes();
bse_item_group_undo (part.proxy_id(), "Clear Selection");
@@ -357,7 +357,7 @@ bst_piano_roll_controller_clear (BstPianoRollController *self)
void
bst_piano_roll_controller_cut (BstPianoRollController *self)
{
- g_return_if_fail (self != NULL);
+ assert_return (self != NULL);
Bse::PartH part = self->proll->part;
Bse::PartNoteSeq pseq = part.list_selected_notes();
@@ -374,7 +374,7 @@ bst_piano_roll_controller_cut (BstPianoRollController *self)
gboolean
bst_piano_roll_controller_copy (BstPianoRollController *self)
{
- g_return_val_if_fail (self != NULL, FALSE);
+ assert_return (self != NULL, FALSE);
Bse::PartH part = self->proll->part;
Bse::PartNoteSeq pseq = part.list_selected_notes();
@@ -385,7 +385,7 @@ bst_piano_roll_controller_copy (BstPianoRollController *self)
void
bst_piano_roll_controller_paste (BstPianoRollController *self)
{
- g_return_if_fail (self != NULL);
+ assert_return (self != NULL);
Bse::PartH part = self->proll->part;
Bse::PartNoteSeq *pseq = bst_piano_roll_controller_get_clipboard ();
@@ -451,7 +451,7 @@ guint
bst_piano_roll_controller_quantize (BstPianoRollController *self,
guint fine_tick)
{
- g_return_val_if_fail (self != NULL, fine_tick);
+ assert_return (self != NULL, fine_tick);
Bse::PartH part = self->proll->part;
Bse::SongTiming timing = part.get_timing (fine_tick);
@@ -867,7 +867,7 @@ controller_canvas_drag (BstPianoRollController *self,
return; /* unhandled */
}
i = self->tool_index;
- g_return_if_fail (i < G_N_ELEMENTS (tool_table));
+ assert_return (i < G_N_ELEMENTS (tool_table));
switch (drag->type)
{
case GXK_DRAG_START:
diff --git a/beast-gtk/bstplayback.cc b/beast-gtk/bstplayback.cc
index 7fff96e..d84f009 100644
--- a/beast-gtk/bstplayback.cc
+++ b/beast-gtk/bstplayback.cc
@@ -44,9 +44,9 @@ bst_play_back_handle_set (BstPlayBackHandle *handle,
SfiProxy esample,
gdouble osc_freq)
{
- g_return_if_fail (handle != NULL);
+ assert_return (handle != NULL);
if (esample)
- g_return_if_fail (BSE_IS_EDITABLE_SAMPLE (esample));
+ assert_return (BSE_IS_EDITABLE_SAMPLE (esample));
bse_proxy_set (handle->constant, "frequency_1", osc_freq, NULL);
bse_wave_osc_set_from_editable_sample (handle->wosc1, esample);
@@ -175,7 +175,7 @@ bst_play_back_handle_time_pcm_notify (BstPlayBackHandle *handle,
void
bst_play_back_handle_destroy (BstPlayBackHandle *handle)
{
- g_return_if_fail (handle != NULL);
+ assert_return (handle != NULL);
bst_play_back_handle_stop (handle);
diff --git a/beast-gtk/bstplaylist.cc b/beast-gtk/bstplaylist.cc
index b9f733d..f2a0c0a 100644
--- a/beast-gtk/bstplaylist.cc
+++ b/beast-gtk/bstplaylist.cc
@@ -39,7 +39,7 @@ static GdkAtom atom_beast_pattern_pointer = 0;
static void
container_remove (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (widget->parent)
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
@@ -404,15 +404,15 @@ group_list_drag_data_received (GtkWidget *group_list,
gint position;
guint action;
- g_return_if_fail (selection_data->type == atom_beast_pattern_group_pointer);
- g_return_if_fail (selection_data->format == 8);
- g_return_if_fail (selection_data->length == sizeof (gpointer));
+ assert_return (selection_data->type == atom_beast_pattern_group_pointer);
+ assert_return (selection_data->format == 8);
+ assert_return (selection_data->length == sizeof (gpointer));
action = context->actions & context->suggested_action;
- g_return_if_fail ((action & (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)) != 0);
+ assert_return ((action & (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)) != 0);
drag_contents = *((gpointer*) selection_data->data);
- g_return_if_fail (BSE_IS_PATTERN_GROUP (drag_contents));
+ assert_return (BSE_IS_PATTERN_GROUP (drag_contents));
position = bst_container_get_insertion_position (GTK_CONTAINER (group_list),
FALSE, y,
@@ -479,9 +479,9 @@ void
bst_play_list_set_song (BstPlayList *plist,
BseSong *song)
{
- g_return_if_fail (BST_IS_PLAY_LIST (plist));
+ assert_return (BST_IS_PLAY_LIST (plist));
if (song)
- g_return_if_fail (BSE_IS_SONG (song));
+ assert_return (BSE_IS_SONG (song));
if (plist->song)
{
@@ -525,7 +525,7 @@ bst_play_list_set_song (BstPlayList *plist,
void
bst_play_list_rebuild (BstPlayList *plist)
{
- g_return_if_fail (BST_IS_PLAY_LIST (plist));
+ assert_return (BST_IS_PLAY_LIST (plist));
if (plist->song)
{
@@ -545,7 +545,7 @@ bst_play_list_new (BseSong *song)
{
GtkWidget *play_list;
- g_return_val_if_fail (BSE_IS_SONG (song), NULL);
+ assert_return (BSE_IS_SONG (song), NULL);
play_list = gtk_widget_new (BST_TYPE_PLAY_LIST, NULL);
bst_play_list_set_song (BST_PLAY_LIST (play_list), song);
diff --git a/beast-gtk/bstpreferences.cc b/beast-gtk/bstpreferences.cc
index 0b9a069..7cc7b06 100644
--- a/beast-gtk/bstpreferences.cc
+++ b/beast-gtk/bstpreferences.cc
@@ -123,7 +123,7 @@ bst_preferences_build_rec_editor (SfiRec *rec,
SfiRing *ring, *params = NULL;
guint i;
- g_return_val_if_fail (rec != NULL, NULL);
+ assert_return (rec != NULL, NULL);
GtkWidget *vbox = (GtkWidget*) g_object_new (GTK_TYPE_VBOX,
"visible", TRUE,
@@ -168,7 +168,7 @@ bst_preferences_revert (BstPreferences *self)
BstKeyBinding *kbinding;
SfiRec *rec, *crec;
- g_return_if_fail (BST_IS_PREFERENCES (self));
+ assert_return (BST_IS_PREFERENCES (self));
rec = Bse::sfi_rec_new_from_visitable (*bst_gconfig_get_global ());
crec = sfi_rec_copy_deep (rec);
@@ -208,7 +208,7 @@ bst_preferences_default_revert (BstPreferences *self)
BstKeyBinding *kbinding;
SfiRec *rec;
- g_return_if_fail (BST_IS_PREFERENCES (self));
+ assert_return (BST_IS_PREFERENCES (self));
rec = sfi_rec_new ();
sfi_rec_validate (rec, sfi_pspec_get_rec_fields (bst_gconfig_pspec ()));
@@ -247,7 +247,7 @@ void
bst_preferences_apply (BstPreferences *self)
{
BstKeyBinding *kbinding;
- g_return_if_fail (BST_IS_PREFERENCES (self));
+ assert_return (BST_IS_PREFERENCES (self));
bst_gconfig_apply (self->rec_gconfig);
@@ -313,7 +313,7 @@ bst_preferences_save (BstPreferences *self)
gchar *file_name;
GSList *slist = NULL;
- g_return_if_fail (BST_IS_PREFERENCES (self));
+ assert_return (BST_IS_PREFERENCES (self));
bse_server.save_preferences();
@@ -348,9 +348,9 @@ bst_preferences_create_buttons (BstPreferences *self,
{
GtkWidget *widget;
- g_return_if_fail (BST_IS_PREFERENCES (self));
- g_return_if_fail (GXK_IS_DIALOG (dialog));
- g_return_if_fail (self->apply == NULL);
+ assert_return (BST_IS_PREFERENCES (self));
+ assert_return (GXK_IS_DIALOG (dialog));
+ assert_return (self->apply == NULL);
/* Apply
*/
diff --git a/beast-gtk/bstprocedure.cc b/beast-gtk/bstprocedure.cc
index 3706e45..08c05eb 100644
--- a/beast-gtk/bstprocedure.cc
+++ b/beast-gtk/bstprocedure.cc
@@ -123,7 +123,7 @@ void
bst_procedure_shell_set_proc (BstProcedureShell *self,
SfiGlueProc *proc)
{
- g_return_if_fail (BST_IS_PROCEDURE_SHELL (self));
+ assert_return (BST_IS_PROCEDURE_SHELL (self));
if (proc != self->proc)
{
@@ -145,7 +145,7 @@ bst_procedure_shell_rebuild (BstProcedureShell *self)
SfiRing *ring, *pspecs = NULL;
guint i;
- g_return_if_fail (BST_IS_PROCEDURE_SHELL (self));
+ assert_return (BST_IS_PROCEDURE_SHELL (self));
sfi_rec_clear (self->prec);
bst_procedure_shell_destroy_contents (self);
@@ -224,7 +224,7 @@ bst_procedure_shell_update (BstProcedureShell *self)
{
SfiRing *ring;
- g_return_if_fail (BST_IS_PROCEDURE_SHELL (self));
+ assert_return (BST_IS_PROCEDURE_SHELL (self));
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
gxk_param_update ((GxkParam*) ring->data);
@@ -247,9 +247,9 @@ bst_procedure_shell_execute (BstProcedureShell *self)
GtkWidget *widget;
SfiRing *ring;
- g_return_if_fail (BST_IS_PROCEDURE_SHELL (self));
- g_return_if_fail (self->proc != NULL);
- g_return_if_fail (self->in_execution == FALSE);
+ assert_return (BST_IS_PROCEDURE_SHELL (self));
+ assert_return (self->proc != NULL);
+ assert_return (self->in_execution == FALSE);
widget = GTK_WIDGET (self);
gtk_widget_ref (widget);
@@ -294,7 +294,7 @@ bst_procedure_shell_reset (BstProcedureShell *self)
SfiGlueProc *proc;
SfiRing *ring;
- g_return_if_fail (BST_IS_PROCEDURE_SHELL (self));
+ assert_return (BST_IS_PROCEDURE_SHELL (self));
proc = self->proc;
sfi_rec_clear (self->prec);
@@ -327,7 +327,7 @@ bst_procedure_shell_unpreset (BstProcedureShell *self)
{
SfiRing *ring;
- g_return_if_fail (BST_IS_PROCEDURE_SHELL (self));
+ assert_return (BST_IS_PROCEDURE_SHELL (self));
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
{
@@ -360,10 +360,10 @@ bst_procedure_shell_preset (BstProcedureShell *self,
SfiGlueProc *proc;
SfiRing *ring;
- g_return_val_if_fail (BST_IS_PROCEDURE_SHELL (self), 0);
- g_return_val_if_fail (self->proc != NULL, 0);
- g_return_val_if_fail (name != NULL, 0);
- g_return_val_if_fail (G_IS_VALUE (value), 0);
+ assert_return (BST_IS_PROCEDURE_SHELL (self), 0);
+ assert_return (self->proc != NULL, 0);
+ assert_return (name != NULL, 0);
+ assert_return (G_IS_VALUE (value), 0);
proc = self->proc;
@@ -524,7 +524,7 @@ bst_procedure_exec_modal (const gchar *procedure_name,
{
va_list var_args;
- g_return_if_fail (procedure_name != NULL);
+ assert_return (procedure_name != NULL);
va_start (var_args, preset_param);
bst_procedure_exec_internal (procedure_name, preset_param, TRUE, TRUE, TRUE, var_args);
@@ -538,7 +538,7 @@ bst_procedure_exec (const gchar *procedure_name,
{
va_list var_args;
- g_return_if_fail (procedure_name != NULL);
+ assert_return (procedure_name != NULL);
va_start (var_args, preset_param);
bst_procedure_exec_internal (procedure_name, preset_param, FALSE, FALSE, FALSE, var_args);
@@ -552,7 +552,7 @@ bst_procedure_exec_auto (const gchar *procedure_name,
{
va_list var_args;
- g_return_if_fail (procedure_name != NULL);
+ assert_return (procedure_name != NULL);
va_start (var_args, preset_param);
bst_procedure_exec_internal (procedure_name, preset_param, FALSE, TRUE, FALSE, var_args);
diff --git a/beast-gtk/bstprofiler.cc b/beast-gtk/bstprofiler.cc
index 6d83b56..e961883 100644
--- a/beast-gtk/bstprofiler.cc
+++ b/beast-gtk/bstprofiler.cc
@@ -30,7 +30,7 @@ thread_info_cell_fill_value (GtkWidget *profiler,
guint row,
GValue *value)
{
- g_return_if_fail (row < cached_task_list.size());
+ assert_return (row < cached_task_list.size());
TaskStatus *info = &cached_task_list[row];
switch (column)
{
diff --git a/beast-gtk/bstprojectctrl.cc b/beast-gtk/bstprojectctrl.cc
index a5c3d52..8aa2e01 100644
--- a/beast-gtk/bstprojectctrl.cc
+++ b/beast-gtk/bstprojectctrl.cc
@@ -75,7 +75,7 @@ project_release (BstProjectCtrl *self)
void
bst_project_ctrl_set_project (BstProjectCtrl *self, Bse::ProjectH project)
{
- g_return_if_fail (BST_IS_PROJECT_CTRL (self));
+ assert_return (BST_IS_PROJECT_CTRL (self));
if (self->project)
bse_proxy_disconnect (self->project.proxy_id(),
diff --git a/beast-gtk/bstqsampler.cc b/beast-gtk/bstqsampler.cc
index 017e803..7ece498 100644
--- a/beast-gtk/bstqsampler.cc
+++ b/beast-gtk/bstqsampler.cc
@@ -288,7 +288,7 @@ bst_qsampler_get_bounds (BstQSampler *qsampler,
{
guint ostart, oend;
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
// GtkWidget *widget = GTK_WIDGET (qsampler);
@@ -310,8 +310,8 @@ bst_qsampler_get_offset_at (BstQSampler *qsampler,
gboolean fits_visible = FALSE;
gint x_coord = 0;
- g_return_val_if_fail (BST_IS_QSAMPLER (qsampler), FALSE);
- g_return_val_if_fail (x_coord_p != NULL, FALSE);
+ assert_return (BST_IS_QSAMPLER (qsampler), FALSE);
+ assert_return (x_coord_p != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (qsampler))
{
@@ -994,11 +994,11 @@ bst_qsampler_set_source (BstQSampler *qsampler,
gpointer data,
GDestroyNotify destroy)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
if (n_total_samples > 0)
- g_return_if_fail (fill_func != NULL);
+ assert_return (fill_func != NULL);
else
- g_return_if_fail (fill_func == NULL && destroy == NULL);
+ assert_return (fill_func == NULL && destroy == NULL);
if (qsampler->src_destroy)
{
@@ -1031,8 +1031,8 @@ bst_qsampler_get_mark_offset (BstQSampler *qsampler,
{
guint n;
- g_return_val_if_fail (BST_IS_QSAMPLER (qsampler), -1);
- g_return_val_if_fail (mark_index > 0, -1);
+ assert_return (BST_IS_QSAMPLER (qsampler), -1);
+ assert_return (mark_index > 0, -1);
for (n = 0; n < qsampler->n_marks; n++)
if (qsampler->marks[n].index == mark_index)
@@ -1051,10 +1051,10 @@ bst_qsampler_set_mark (BstQSampler *qsampler,
{
guint n;
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
- g_return_if_fail (mark_index > 0);
- g_return_if_fail ((type & ~BST_QSAMPLER_MARK_MASK) == 0);
- g_return_if_fail (offset < offset + 1); /* catch guint wraps */
+ assert_return (BST_IS_QSAMPLER (qsampler));
+ assert_return (mark_index > 0);
+ assert_return ((type & ~BST_QSAMPLER_MARK_MASK) == 0);
+ assert_return (offset < offset + 1); /* catch guint wraps */
if (type)
type |= BST_QSAMPLER_MARK;
@@ -1102,10 +1102,10 @@ bst_qsampler_set_region (BstQSampler *qsampler,
{
guint n;
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
- g_return_if_fail (region_index > 0);
- g_return_if_fail ((type & ~BST_QSAMPLER_REGION_MASK) == 0);
- g_return_if_fail (offset < offset + length); /* catch guint wraps */
+ assert_return (BST_IS_QSAMPLER (qsampler));
+ assert_return (region_index > 0);
+ assert_return ((type & ~BST_QSAMPLER_REGION_MASK) == 0);
+ assert_return (offset < offset + length); /* catch guint wraps */
for (n = 0; n < qsampler->n_regions; n++)
if (qsampler->regions[n].index == region_index)
@@ -1149,7 +1149,7 @@ void
bst_qsampler_set_zoom (BstQSampler *qsampler,
gdouble zoom)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
zoom = CLAMP (zoom, 1e-16, 1e+16);
qsampler->zoom_factor = 100. / zoom;
@@ -1163,7 +1163,7 @@ void
bst_qsampler_set_vscale (BstQSampler *qsampler,
gdouble vscale)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
vscale = CLAMP (vscale, 1e-16, 1e+16);
qsampler->vscale_factor = vscale / 100.;
@@ -1176,7 +1176,7 @@ bst_qsampler_set_vscale (BstQSampler *qsampler,
void
bst_qsampler_set_draw_mode (BstQSampler *qsampler, Bst::QSamplerDrawMode dmode)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
qsampler->draw_mode = dmode;
gtk_widget_queue_draw (GTK_WIDGET (qsampler));
@@ -1214,9 +1214,9 @@ bst_qsampler_scroll_rbounded (BstQSampler *qsampler,
gfloat boundary_padding,
gfloat padding)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
- g_return_if_fail (boundary_padding >= 0.1 && boundary_padding <= 1.0);
- g_return_if_fail (padding >= 0 && padding <= 1.0);
+ assert_return (BST_IS_QSAMPLER (qsampler));
+ assert_return (boundary_padding >= 0.1 && boundary_padding <= 1.0);
+ assert_return (padding >= 0 && padding <= 1.0);
bst_qsampler_scroll_internal (qsampler, pcm_offset, boundary_padding, padding, 1);
gtk_adjustment_value_changed (qsampler->adjustment);
@@ -1228,9 +1228,9 @@ bst_qsampler_scroll_lbounded (BstQSampler *qsampler,
gfloat boundary_padding,
gfloat padding)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
- g_return_if_fail (boundary_padding >= 0.1 && boundary_padding <= 1.0);
- g_return_if_fail (padding >= 0 && padding <= 1.0);
+ assert_return (BST_IS_QSAMPLER (qsampler));
+ assert_return (boundary_padding >= 0.1 && boundary_padding <= 1.0);
+ assert_return (padding >= 0 && padding <= 1.0);
bst_qsampler_scroll_internal (qsampler, pcm_offset, 1.0 - boundary_padding, padding, 2);
gtk_adjustment_value_changed (qsampler->adjustment);
@@ -1242,9 +1242,9 @@ bst_qsampler_scroll_bounded (BstQSampler *qsampler,
gfloat boundary_padding,
gfloat padding)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
- g_return_if_fail (boundary_padding >= 0.1 && boundary_padding <= 1.0);
- g_return_if_fail (padding >= 0 && padding <= 1.0);
+ assert_return (BST_IS_QSAMPLER (qsampler));
+ assert_return (boundary_padding >= 0.1 && boundary_padding <= 1.0);
+ assert_return (padding >= 0 && padding <= 1.0);
bst_qsampler_scroll_internal (qsampler, pcm_offset, boundary_padding, padding, 1);
bst_qsampler_scroll_internal (qsampler, pcm_offset, 1.0 - boundary_padding, padding, 2);
@@ -1255,7 +1255,7 @@ void
bst_qsampler_scroll_show (BstQSampler *qsampler,
guint pcm_offset)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
bst_qsampler_scroll_internal (qsampler, pcm_offset, 1.0, 0, 1);
bst_qsampler_scroll_internal (qsampler, pcm_offset, 0, 0, 2);
@@ -1268,7 +1268,7 @@ bst_qsampler_scroll_to (BstQSampler *qsampler,
{
GtkAdjustment *adjustment;
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
adjustment = qsampler->adjustment;
adjustment->value = pcm_offset;
@@ -1279,7 +1279,7 @@ bst_qsampler_scroll_to (BstQSampler *qsampler,
void
bst_qsampler_force_refresh (BstQSampler *qsampler)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
if (GTK_WIDGET_DRAWABLE (qsampler))
bst_qsampler_redraw (qsampler, FALSE);
@@ -1289,9 +1289,9 @@ void
bst_qsampler_set_adjustment (BstQSampler *qsampler,
GtkAdjustment *adjustment)
{
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
+ assert_return (BST_IS_QSAMPLER (qsampler));
if (adjustment)
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
if (qsampler->adjustment)
{
@@ -1361,8 +1361,8 @@ bst_qsampler_set_source_from_esample (BstQSampler *qsampler,
{
ESampleFiller *fill;
- g_return_if_fail (BST_IS_QSAMPLER (qsampler));
- g_return_if_fail (BSE_IS_EDITABLE_SAMPLE (esample));
+ assert_return (BST_IS_QSAMPLER (qsampler));
+ assert_return (BSE_IS_EDITABLE_SAMPLE (esample));
fill = g_new (ESampleFiller, 1);
fill->esample = esample;
diff --git a/beast-gtk/bstrackeditor.cc b/beast-gtk/bstrackeditor.cc
index 202ef1e..c987875 100644
--- a/beast-gtk/bstrackeditor.cc
+++ b/beast-gtk/bstrackeditor.cc
@@ -177,9 +177,9 @@ void
bst_rack_editor_set_rack_view (BstRackEditor *ed,
SfiProxy pocket)
{
- g_return_if_fail (BST_IS_RACK_EDITOR (ed));
+ assert_return (BST_IS_RACK_EDITOR (ed));
if (pocket)
- g_return_if_fail (BSE_IS_DATA_POCKET (pocket));
+ assert_return (BSE_IS_DATA_POCKET (pocket));
if (ed->pocket)
{
@@ -205,9 +205,9 @@ bst_rack_editor_add_property (BstRackEditor *ed,
SfiProxy item,
const gchar *property_name)
{
- g_return_if_fail (BST_IS_RACK_EDITOR (ed));
- g_return_if_fail (BSE_IS_ITEM (item));
- g_return_if_fail (property_name != NULL);
+ assert_return (BST_IS_RACK_EDITOR (ed));
+ assert_return (BSE_IS_ITEM (item));
+ assert_return (property_name != NULL);
if (ed->pocket)
{
diff --git a/beast-gtk/bstrackitem.cc b/beast-gtk/bstrackitem.cc
index 6d06951..50d1c83 100644
--- a/beast-gtk/bstrackitem.cc
+++ b/beast-gtk/bstrackitem.cc
@@ -146,7 +146,7 @@ bst_rack_item_set_parasite (BstRackItem *self,
SfiProxy proxy,
const gchar *path)
{
- g_return_if_fail (BST_IS_RACK_ITEM (self));
+ assert_return (BST_IS_RACK_ITEM (self));
if (self->proxy)
{
diff --git a/beast-gtk/bstracktable.cc b/beast-gtk/bstracktable.cc
index 960eb48..c7b8977 100644
--- a/beast-gtk/bstracktable.cc
+++ b/beast-gtk/bstracktable.cc
@@ -516,8 +516,8 @@ bst_rack_table_on_area (BstRackTable *rtable,
GtkTable *table = GTK_TABLE (rtable);
guint i, x, y, width, height, hcell2 = hcell1 + hspan, vcell2 = vcell1 + vspan;
- g_return_if_fail (hspan > 0 && hcell2 <= table->ncols);
- g_return_if_fail (vspan > 0 && vcell2 <= table->nrows);
+ assert_return (hspan > 0 && hcell2 <= table->ncols);
+ assert_return (vspan > 0 && vcell2 <= table->nrows);
x = GTK_CONTAINER (widget)->border_width + widget->allocation.x;
width = 0;
@@ -825,7 +825,7 @@ bst_rack_table_check_cell (BstRackTable *rtable,
{
GtkTable *table;
- g_return_val_if_fail (BST_IS_RACK_TABLE (rtable), FALSE);
+ assert_return (BST_IS_RACK_TABLE (rtable), FALSE);
table = GTK_TABLE (rtable);
if (col >= table->ncols || row >= table->nrows)
@@ -847,7 +847,7 @@ bst_rack_table_expand_rect (BstRackTable *rtable,
GtkTable *table;
guint i, j, f;
- g_return_val_if_fail (BST_IS_RACK_TABLE (rtable), FALSE);
+ assert_return (BST_IS_RACK_TABLE (rtable), FALSE);
table = GTK_TABLE (rtable);
if (col + 1 >= table->ncols || row + 1 >= table->nrows ||
@@ -895,7 +895,7 @@ bst_rack_table_check_area (BstRackTable *rtable,
GtkTable *table;
guint i, j;
- g_return_val_if_fail (BST_IS_RACK_TABLE (rtable), FALSE);
+ assert_return (BST_IS_RACK_TABLE (rtable), FALSE);
table = GTK_TABLE (rtable);
if (col >= table->ncols || row >= table->nrows)
@@ -912,7 +912,7 @@ void
bst_rack_table_set_edit_mode (BstRackTable *rtable,
gboolean enable_editing)
{
- g_return_if_fail (BST_IS_RACK_TABLE (rtable));
+ assert_return (BST_IS_RACK_TABLE (rtable));
rtable->edit_mode = enable_editing != FALSE;
if (GTK_WIDGET_REALIZED (rtable))
@@ -933,8 +933,8 @@ void
bst_rack_child_get_info (GtkWidget *widget,
BstRackChildInfo *info)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (info != NULL);
+ assert_return (GTK_IS_WIDGET (widget));
+ assert_return (info != NULL);
#if 0
if (BST_IS_RACK_ITEM (widget))
@@ -964,7 +964,7 @@ bst_rack_child_set_info (GtkWidget *widget,
{
GtkWidget *parent = NULL;
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
g_object_ref (widget);
if (BST_IS_RACK_TABLE (widget->parent))
diff --git a/beast-gtk/bstrackview.cc b/beast-gtk/bstrackview.cc
index d2c3dea..d715738 100644
--- a/beast-gtk/bstrackview.cc
+++ b/beast-gtk/bstrackview.cc
@@ -131,7 +131,7 @@ bst_rack_view_new (SfiProxy item)
GtkWidget *self = (GtkWidget*) g_object_new (BST_TYPE_RACK_VIEW, NULL);
if (item)
{
- g_return_val_if_fail (BSE_IS_ITEM (item), NULL);
+ assert_return (BSE_IS_ITEM (item), NULL);
bst_rack_view_set_item (BST_RACK_VIEW (self), item);
}
return self;
@@ -161,9 +161,9 @@ void
bst_rack_view_set_item (BstRackView *self,
SfiProxy item)
{
- g_return_if_fail (BST_IS_RACK_VIEW (self));
+ assert_return (BST_IS_RACK_VIEW (self));
if (item)
- g_return_if_fail (BSE_IS_ITEM (item));
+ assert_return (BSE_IS_ITEM (item));
if (item == self->item)
return;
@@ -190,7 +190,7 @@ void
bst_rack_view_rebuild (BstRackView *self)
{
GtkWidget *toggle;
- g_return_if_fail (BST_IS_RACK_VIEW (self));
+ assert_return (BST_IS_RACK_VIEW (self));
gtk_container_foreach (GTK_CONTAINER (self->rack_table), (GtkCallback) gtk_widget_destroy, NULL);
toggle = (GtkWidget*) gxk_radget_find (self, "edit-toggle");
diff --git a/beast-gtk/bstsampleeditor.cc b/beast-gtk/bstsampleeditor.cc
index eb15f34..ac62a99 100644
--- a/beast-gtk/bstsampleeditor.cc
+++ b/beast-gtk/bstsampleeditor.cc
@@ -128,9 +128,9 @@ void
bst_sample_editor_set_sample (BstSampleEditor *editor,
SfiProxy sample)
{
- g_return_if_fail (BST_IS_SAMPLE_EDITOR (editor));
+ assert_return (BST_IS_SAMPLE_EDITOR (editor));
if (sample)
- g_return_if_fail (BSE_IS_EDITABLE_SAMPLE (sample));
+ assert_return (BSE_IS_EDITABLE_SAMPLE (sample));
if (sample != editor->esample)
{
@@ -388,7 +388,7 @@ bst_sample_editor_rebuild (BstSampleEditor *editor)
gpointer gmask;
guint i;
- g_return_if_fail (BST_IS_SAMPLE_EDITOR (editor));
+ assert_return (BST_IS_SAMPLE_EDITOR (editor));
gtk_container_foreach (GTK_CONTAINER (editor), (GtkCallback) gtk_widget_destroy, NULL);
g_free (editor->qsampler);
diff --git a/beast-gtk/bstscrollgraph.cc b/beast-gtk/bstscrollgraph.cc
index 3f64055..af01224 100644
--- a/beast-gtk/bstscrollgraph.cc
+++ b/beast-gtk/bstscrollgraph.cc
@@ -372,7 +372,7 @@ bst_scrollgraph_expose (GtkWidget *widget,
void
bst_scrollgraph_clear (BstScrollgraph *self)
{
- g_return_if_fail (BST_IS_SCROLLGRAPH (self));
+ assert_return (BST_IS_SCROLLGRAPH (self));
GtkWidget *widget = GTK_WIDGET (self);
guint i, j;
for (i = 0; i < self->n_bars; i++)
@@ -454,9 +454,9 @@ bst_scrollgraph_set_source (BstScrollgraph *self,
SfiProxy source,
guint ochannel)
{
- g_return_if_fail (BST_IS_SCROLLGRAPH (self));
+ assert_return (BST_IS_SCROLLGRAPH (self));
if (source)
- g_return_if_fail (BSE_IS_SOURCE (source));
+ assert_return (BSE_IS_SOURCE (source));
if (self->source)
{
bse_proxy_disconnect (self->source,
@@ -639,7 +639,7 @@ bst_scrollgraph_build_dialog (GtkWidget *alive_object,
SfiProxy source,
guint ochannel)
{
- g_return_val_if_fail (BSE_IS_SOURCE (source), NULL);
+ assert_return (BSE_IS_SOURCE (source), NULL);
GxkRadget *radget = gxk_radget_create ("beast", "scrollgraph-dialog", NULL);
BstScrollgraph *scg = (BstScrollgraph*) gxk_radget_find (radget, "scrollgraph");
diff --git a/beast-gtk/bstsegment.cc b/beast-gtk/bstsegment.cc
index a05ca63..6b03a72 100644
--- a/beast-gtk/bstsegment.cc
+++ b/beast-gtk/bstsegment.cc
@@ -37,9 +37,9 @@ bst_segment_init (BstSegment *self,
BstSegmentType type,
GdkDrawable *drawable)
{
- g_return_if_fail (self != NULL);
- g_return_if_fail (self->type == 0);
- g_return_if_fail (GDK_IS_DRAWABLE (drawable));
+ assert_return (self != NULL);
+ assert_return (self->type == 0);
+ assert_return (GDK_IS_DRAWABLE (drawable));
self->type = type;
self->any.drawable = (GdkDrawable*) g_object_ref (drawable);
diff --git a/beast-gtk/bstsequence.cc b/beast-gtk/bstsequence.cc
index 475b905..a40e4a1 100644
--- a/beast-gtk/bstsequence.cc
+++ b/beast-gtk/bstsequence.cc
@@ -99,7 +99,7 @@ void
bst_sequence_set_seq (BstSequence *seq,
BseNoteSequence *sdata)
{
- g_return_if_fail (BST_IS_SEQUENCE (seq));
+ assert_return (BST_IS_SEQUENCE (seq));
bse_note_sequence_free (seq->sdata);
if (sdata)
diff --git a/beast-gtk/bstservermonitor.cc b/beast-gtk/bstservermonitor.cc
index 1d391ca..8da6c66 100644
--- a/beast-gtk/bstservermonitor.cc
+++ b/beast-gtk/bstservermonitor.cc
@@ -70,7 +70,7 @@ bst_server_monitor_finalize (GObject *object)
void
bst_server_monitor_rebuild (BstServerMonitor *smon)
{
- g_return_if_fail (BST_IS_SERVER_MONITOR (smon));
+ assert_return (BST_IS_SERVER_MONITOR (smon));
bst_server_monitor_update (smon);
}
@@ -78,6 +78,6 @@ bst_server_monitor_rebuild (BstServerMonitor *smon)
void
bst_server_monitor_update (BstServerMonitor *smon)
{
- g_return_if_fail (BST_IS_SERVER_MONITOR (smon));
+ assert_return (BST_IS_SERVER_MONITOR (smon));
}
diff --git a/beast-gtk/bstskinconfig.cc b/beast-gtk/bstskinconfig.cc
index 5fb2625..d36b62f 100644
--- a/beast-gtk/bstskinconfig.cc
+++ b/beast-gtk/bstskinconfig.cc
@@ -15,7 +15,7 @@ _bst_skin_config_init (void)
GValue *value;
SfiRec *rec;
- g_return_if_fail (global_skin_config == NULL);
+ assert_return (global_skin_config == NULL);
/* global config record description */
Bst::SkinConfig skin_config;
@@ -127,7 +127,7 @@ bst_skin_config_apply (SfiRec *rec, const gchar *skin_file)
SfiRec *vrec;
Bst::SkinConfig skin_config;
- g_return_if_fail (rec != NULL);
+ assert_return (rec != NULL);
vrec = sfi_rec_copy_deep (rec);
sfi_rec_validate (vrec, sfi_pspec_get_rec_fields (pspec_skin_config));
@@ -194,7 +194,7 @@ bst_skin_dump (const gchar *file_name)
SfiRec *rec;
gint fd;
- g_return_val_if_fail (file_name != NULL, Bse::ERROR_INTERNAL);
+ assert_return (file_name != NULL, Bse::ERROR_INTERNAL);
sfi_make_dirname_path (file_name);
fd = open (file_name,
@@ -264,7 +264,7 @@ bst_skin_parse (const gchar *file_name)
gchar *absname;
gint fd;
- g_return_val_if_fail (file_name != NULL, Bse::ERROR_INTERNAL);
+ assert_return (file_name != NULL, Bse::ERROR_INTERNAL);
absname = sfi_path_get_filename (file_name, NULL);
fd = open (absname, O_RDONLY, 0);
diff --git a/beast-gtk/bstsnetrouter.cc b/beast-gtk/bstsnetrouter.cc
index 9ff719c..a9e4f24 100644
--- a/beast-gtk/bstsnetrouter.cc
+++ b/beast-gtk/bstsnetrouter.cc
@@ -255,7 +255,7 @@ bst_snet_router_new (Bse::SNetH snet)
{
GtkWidget *router;
- g_return_val_if_fail (snet != NULL, NULL);
+ assert_return (snet != NULL, NULL);
router = gtk_widget_new (BST_TYPE_SNET_ROUTER,
"aa", BST_SNET_ANTI_ALIASED,
@@ -289,7 +289,7 @@ bst_snet_router_item_added (BstSNetRouter *self,
void
bst_snet_router_set_snet (BstSNetRouter *self, Bse::SNetH snet)
{
- g_return_if_fail (BST_IS_SNET_ROUTER (self));
+ assert_return (BST_IS_SNET_ROUTER (self));
if (self->snet)
{
@@ -341,7 +341,7 @@ bst_snet_router_update (BstSNetRouter *self)
GSList *slist, *csources = NULL;
guint i;
- g_return_if_fail (BST_IS_SNET_ROUTER (self));
+ assert_return (BST_IS_SNET_ROUTER (self));
canvas = GNOME_CANVAS (self);
@@ -439,7 +439,7 @@ bst_snet_router_adjust_region (BstSNetRouter *router)
GnomeCanvas *canvas;
gdouble x1, y1, x2, y2;
- g_return_if_fail (BST_IS_SNET_ROUTER (router));
+ assert_return (BST_IS_SNET_ROUTER (router));
canvas = GNOME_CANVAS (router);
layout = GTK_LAYOUT (router);
@@ -477,8 +477,8 @@ bst_snet_router_csource_from_source (BstSNetRouter *router,
GnomeCanvasGroup *root;
GList *list;
- g_return_val_if_fail (BST_IS_SNET_ROUTER (router), NULL);
- g_return_val_if_fail (BSE_IS_SOURCE (source), NULL);
+ assert_return (BST_IS_SNET_ROUTER (router), NULL);
+ assert_return (BSE_IS_SOURCE (source), NULL);
canvas = GNOME_CANVAS (router);
root = GNOME_CANVAS_GROUP (canvas->root);
@@ -582,7 +582,7 @@ bst_snet_router_root_event (BstSNetRouter *self,
bst_mouse_button_activate (event) &&
ROUTER_TOOL (self) == 0) /* start link (or popup property
dialog) */
{
- g_return_val_if_fail (self->tmp_line == NULL, FALSE);
+ assert_return (self->tmp_line == NULL, FALSE);
self->drag_is_input = ichannel != ~uint (0);
if (csource && at_channel && self->drag_is_input && /* ichannel in use */
!bst_canvas_source_ichannel_free (csource, ichannel))
@@ -953,7 +953,7 @@ bst_snet_router_build_page (Bse::SNetH snet)
GdkBitmap *mask;
GxkRadget *radget;
- g_return_val_if_fail (snet != NULL, NULL);
+ assert_return (snet != NULL, NULL);
/* main radget */
radget = gxk_radget_create ("beast", "snet-view", NULL);
diff --git a/beast-gtk/bstsnifferscope.cc b/beast-gtk/bstsnifferscope.cc
index 8d9a2e6..ed1ac26 100644
--- a/beast-gtk/bstsnifferscope.cc
+++ b/beast-gtk/bstsnifferscope.cc
@@ -265,7 +265,7 @@ bst_sniffer_scope_set_sniffer (BstSnifferScope *self,
{
if (proxy)
{
- g_return_if_fail (BSE_IS_SOURCE (proxy));
+ assert_return (BSE_IS_SOURCE (proxy));
if (!bse_source_has_outputs (proxy))
proxy = 0;
}
diff --git a/beast-gtk/bstsplash.cc b/beast-gtk/bstsplash.cc
index 89174b9..089cd90 100644
--- a/beast-gtk/bstsplash.cc
+++ b/beast-gtk/bstsplash.cc
@@ -275,7 +275,7 @@ bst_splash_release_grab (GtkWidget *widget)
void
bst_splash_update_entity (GtkWidget *widget, const std::string &message)
{
- g_return_if_fail (BST_IS_SPLASH (widget));
+ assert_return (BST_IS_SPLASH (widget));
BstSplash *self = BST_SPLASH (widget);
@@ -287,7 +287,7 @@ bst_splash_update_entity (GtkWidget *widget, const std::string &message)
void
bst_splash_update_item (GtkWidget *widget, const std::string &message)
{
- g_return_if_fail (BST_IS_SPLASH (widget));
+ assert_return (BST_IS_SPLASH (widget));
BstSplash *self = BST_SPLASH (widget);
@@ -317,7 +317,7 @@ bst_splash_set_text (GtkWidget *widget, const std::string &message)
{
BstSplash *self;
- g_return_if_fail (BST_IS_SPLASH (widget));
+ assert_return (BST_IS_SPLASH (widget));
self = BST_SPLASH (widget);
gtk_container_foreach (GTK_CONTAINER (self->splash_box), (GtkCallback) gtk_widget_destroy, NULL);
@@ -351,7 +351,7 @@ bst_splash_set_animation (GtkWidget *widget,
{
BstSplash *self;
- g_return_if_fail (BST_IS_SPLASH (widget));
+ assert_return (BST_IS_SPLASH (widget));
self = BST_SPLASH (widget);
gtk_container_foreach (GTK_CONTAINER (self->splash_box), (GtkCallback) gtk_widget_destroy, NULL);
diff --git a/beast-gtk/bstsupershell.cc b/beast-gtk/bstsupershell.cc
index 18479e1..7987471 100644
--- a/beast-gtk/bstsupershell.cc
+++ b/beast-gtk/bstsupershell.cc
@@ -133,7 +133,7 @@ bst_super_shell_finalize (GObject *object)
void
bst_super_shell_set_super (BstSuperShell *self, Bse::SuperH super)
{
- g_return_if_fail (BST_IS_SUPER_SHELL (self));
+ assert_return (BST_IS_SUPER_SHELL (self));
if (super != self->super)
{
diff --git a/beast-gtk/bsttrackroll.cc b/beast-gtk/bsttrackroll.cc
index 51dd4a6..adf3731 100644
--- a/beast-gtk/bsttrackroll.cc
+++ b/beast-gtk/bsttrackroll.cc
@@ -170,7 +170,7 @@ track_roll_get_layout (GxkScrollCanvas *scc,
static void
track_roll_song_item_removed (BstTrackRoll *self)
{
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
bst_track_roll_queue_row_change (self, -1);
}
@@ -190,11 +190,11 @@ bst_track_roll_setup (BstTrackRoll *self,
GtkTreeView *tree,
SfiProxy song)
{
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
if (tree)
- g_return_if_fail (GTK_IS_TREE_VIEW (tree));
+ assert_return (GTK_IS_TREE_VIEW (tree));
if (song)
- g_return_if_fail (BSE_IS_SONG (song));
+ assert_return (BSE_IS_SONG (song));
if (self->tree)
{
@@ -229,7 +229,7 @@ bst_track_roll_setup (BstTrackRoll *self,
void
bst_track_roll_reselect (BstTrackRoll *self)
{
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
if (self->tree)
{
@@ -535,7 +535,7 @@ void
bst_track_roll_check_update_scopes (BstTrackRoll *self)
{
guint i;
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
/* check whether scope update is necessary and schedule one */
if (!GTK_WIDGET_REALIZED (self) || !self->get_track)
@@ -977,7 +977,7 @@ bst_track_roll_button_press (GtkWidget *widget,
void
bst_track_roll_set_track_callback (BstTrackRoll *self, gpointer data, BstTrackRollTrackFunc get_track)
{
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
self->proxy_data = data;
self->get_track = get_track;
@@ -990,7 +990,7 @@ bst_track_roll_queue_row_change (BstTrackRoll *self, int row)
{
GxkScrollCanvas *scc;
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
scc = GXK_SCROLL_CANVAS (self);
GdkRectangle rect { 0, 0, 0, 0 };
@@ -1020,7 +1020,7 @@ void
bst_track_roll_set_prelight_row (BstTrackRoll *self,
guint row)
{
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
if (self->prelight_row != row)
{
@@ -1067,12 +1067,12 @@ bst_track_roll_start_edit (BstTrackRoll *self,
{
gint ry, rheight, validrow;
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
- g_return_if_fail (GTK_WIDGET_REALIZED (self));
- g_return_if_fail (GTK_IS_CELL_EDITABLE (ecell));
- g_return_if_fail (GTK_WIDGET_CAN_FOCUS (ecell));
- g_return_if_fail (GTK_WIDGET (ecell)->parent == NULL);
- g_return_if_fail (self->ecell == NULL);
+ assert_return (BST_IS_TRACK_ROLL (self));
+ assert_return (GTK_WIDGET_REALIZED (self));
+ assert_return (GTK_IS_CELL_EDITABLE (ecell));
+ assert_return (GTK_WIDGET_CAN_FOCUS (ecell));
+ assert_return (GTK_WIDGET (ecell)->parent == NULL);
+ assert_return (self->ecell == NULL);
validrow = row_to_coords (self, row, &ry, &rheight);
if (!validrow)
@@ -1098,7 +1098,7 @@ static void
track_roll_stop_edit (BstTrackRoll *self,
gboolean canceled)
{
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
if (self->ecell)
{
g_signal_emit (self, signal_stop_edit, 0,
@@ -1116,7 +1116,7 @@ track_roll_stop_edit (BstTrackRoll *self,
void
bst_track_roll_abort_edit (BstTrackRoll *self)
{
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
track_roll_stop_edit (self, TRUE);
}
@@ -1124,7 +1124,7 @@ bst_track_roll_abort_edit (BstTrackRoll *self)
void
bst_track_roll_stop_edit (BstTrackRoll *self)
{
- g_return_if_fail (BST_IS_TRACK_ROLL (self));
+ assert_return (BST_IS_TRACK_ROLL (self));
track_roll_stop_edit (self, FALSE);
}
@@ -1138,7 +1138,7 @@ bst_track_roll_set_marker (BstTrackRoll *self,
GxkScrollCanvas *scc = GXK_SCROLL_CANVAS (self);
GxkScrollMarker *marker;
guint count;
- g_return_if_fail (mark_index > 0);
+ assert_return (mark_index > 0);
marker = gxk_scroll_canvas_lookup_marker (scc, mark_index, &count);
if (!marker && !mtype)
@@ -1159,7 +1159,7 @@ bst_track_roll_set_marker (BstTrackRoll *self,
return;
}
- g_return_if_fail (count == 2);
+ assert_return (count == 2);
marker[0].coords.x = position;
marker[1].coords.x = position;
diff --git a/beast-gtk/bsttrackrollctrl.cc b/beast-gtk/bsttrackrollctrl.cc
index 27032cf..854b19d 100644
--- a/beast-gtk/bsttrackrollctrl.cc
+++ b/beast-gtk/bsttrackrollctrl.cc
@@ -103,7 +103,7 @@ controller_reset_hpanel_cursor (BstTrackRollController *self)
BstTrackRollController*
bst_track_roll_controller_new (BstTrackRoll *troll)
{
- g_return_val_if_fail (BST_IS_TRACK_ROLL (troll), NULL);
+ assert_return (BST_IS_TRACK_ROLL (troll), NULL);
BstTrackRollController *self = new BstTrackRollController();
self->ref_count = 1;
@@ -256,8 +256,8 @@ canvas_button_tool (BstTrackRollController *self,
BstTrackRollController*
bst_track_roll_controller_ref (BstTrackRollController *self)
{
- g_return_val_if_fail (self != NULL, NULL);
- g_return_val_if_fail (self->ref_count >= 1, NULL);
+ assert_return (self != NULL, NULL);
+ assert_return (self->ref_count >= 1, NULL);
self->ref_count++;
@@ -267,8 +267,8 @@ bst_track_roll_controller_ref (BstTrackRollController *self)
void
bst_track_roll_controller_unref (BstTrackRollController *self)
{
- g_return_if_fail (self != NULL);
- g_return_if_fail (self->ref_count >= 1);
+ assert_return (self != NULL);
+ assert_return (self->ref_count >= 1);
self->ref_count--;
if (!self->ref_count)
@@ -287,8 +287,8 @@ void
bst_track_roll_controller_set_song (BstTrackRollController *self,
SfiProxy song)
{
- g_return_if_fail (self != NULL);
- g_return_if_fail (self->ref_count >= 1);
+ assert_return (self != NULL);
+ assert_return (self->ref_count >= 1);
if (BSE_IS_SONG (song))
self->song = song;
@@ -302,7 +302,7 @@ bst_track_roll_controller_quantize (BstTrackRollController *self,
{
guint quant, tick, qtick;
- g_return_val_if_fail (self != NULL, fine_tick);
+ assert_return (self != NULL, fine_tick);
Bse::SongH song = Bse::SongH::down_cast (bse_server.from_proxy (self->song));
Bse::SongTiming timing = song.get_timing (fine_tick);
diff --git a/beast-gtk/bsttracksynthdialog.cc b/beast-gtk/bsttracksynthdialog.cc
index dcad9d9..697ae2a 100644
--- a/beast-gtk/bsttracksynthdialog.cc
+++ b/beast-gtk/bsttracksynthdialog.cc
@@ -164,7 +164,7 @@ bst_track_synth_dialog_setup (BstTrackSynthDialog *self,
{
GtkWindow *window = GTK_WINDOW (self);
- g_return_if_fail (BST_IS_TRACK_SYNTH_DIALOG (self));
+ assert_return (BST_IS_TRACK_SYNTH_DIALOG (self));
self->selected_callback = NULL;
GxkFreeFunc selected_cleanup = self->selected_cleanup;
@@ -258,7 +258,7 @@ bst_track_synth_dialog_set (BstTrackSynthDialog *self,
BseItemSeq *iseq,
SfiProxy wrepo)
{
- g_return_if_fail (BST_IS_TRACK_SYNTH_DIALOG (self));
+ assert_return (BST_IS_TRACK_SYNTH_DIALOG (self));
bst_item_view_set_container (BST_ITEM_VIEW (self->wpage), wrepo);
bst_item_seq_store_set (self->pstore, iseq);
diff --git a/beast-gtk/bsttrackview.cc b/beast-gtk/bsttrackview.cc
index 149a0c0..41cf9be 100644
--- a/beast-gtk/bsttrackview.cc
+++ b/beast-gtk/bsttrackview.cc
@@ -88,7 +88,7 @@ bst_track_view_new (SfiProxy song)
{
GtkWidget *track_view;
- g_return_val_if_fail (BSE_IS_SONG (song), NULL);
+ assert_return (BSE_IS_SONG (song), NULL);
track_view = gtk_widget_new (BST_TYPE_TRACK_VIEW, NULL);
bst_item_view_set_container (BST_ITEM_VIEW (track_view), song);
@@ -174,7 +174,7 @@ track_view_synth_edited (BstTrackView *self,
const gchar *strpath,
const gchar *text)
{
- g_return_if_fail (BST_IS_TRACK_VIEW (self));
+ assert_return (BST_IS_TRACK_VIEW (self));
if (strpath)
{
@@ -209,7 +209,7 @@ track_view_post_synth_edited (BstTrackView *self,
const gchar *strpath,
const gchar *text)
{
- g_return_if_fail (BST_IS_TRACK_VIEW (self));
+ assert_return (BST_IS_TRACK_VIEW (self));
if (strpath)
{
@@ -266,7 +266,7 @@ track_view_synth_popup (BstTrackView *self,
const gchar *text,
GxkCellRendererPopup *pcell)
{
- g_return_if_fail (BST_IS_TRACK_VIEW (self));
+ assert_return (BST_IS_TRACK_VIEW (self));
if (strpath)
{
@@ -295,7 +295,7 @@ track_view_post_synth_popup (BstTrackView *self,
const gchar *text,
GxkCellRendererPopup *pcell)
{
- g_return_if_fail (BST_IS_TRACK_VIEW (self));
+ assert_return (BST_IS_TRACK_VIEW (self));
if (strpath)
{
@@ -350,7 +350,7 @@ track_view_outputs_popup (BstTrackView *self,
const gchar *text,
GxkCellRendererPopup *pcell)
{
- g_return_if_fail (BST_IS_TRACK_VIEW (self));
+ assert_return (BST_IS_TRACK_VIEW (self));
if (strpath)
{
@@ -376,7 +376,7 @@ track_view_mute_toggled (BstTrackView *self,
const gchar *strpath,
GtkCellRendererToggle *tcell)
{
- g_return_if_fail (BST_IS_TRACK_VIEW (self));
+ assert_return (BST_IS_TRACK_VIEW (self));
if (strpath)
{
@@ -398,7 +398,7 @@ track_view_voice_edited (BstTrackView *self,
const gchar *strpath,
const gchar *text)
{
- g_return_if_fail (BST_IS_TRACK_VIEW (self));
+ assert_return (BST_IS_TRACK_VIEW (self));
if (strpath)
{
@@ -418,7 +418,7 @@ track_view_midi_channel_edited (BstTrackView *self,
const gchar *strpath,
const gchar *text)
{
- g_return_if_fail (BST_IS_TRACK_VIEW (self));
+ assert_return (BST_IS_TRACK_VIEW (self));
if (strpath)
{
diff --git a/beast-gtk/bsttreestores.cc b/beast-gtk/bsttreestores.cc
index a5ae213..4940e38 100644
--- a/beast-gtk/bsttreestores.cc
+++ b/beast-gtk/bsttreestores.cc
@@ -145,7 +145,7 @@ bst_file_store_update_list (GtkTreeModel *model,
SfiFileCrawler *crawler = sfi_file_crawler_new ();
glong l;
- g_return_if_fail (search_path != NULL);
+ assert_return (search_path != NULL);
sfi_file_crawler_add_search_path (crawler, search_path, filter);
g_object_set_data_full ((GObject*) store, "file-crawler", crawler, (GDestroyNotify)
sfi_file_crawler_destroy);
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index 2fb546c..dedad3c 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -268,7 +268,7 @@ static void
bst_msg_dialog_janitor_update (GxkDialog *dialog,
SfiProxy janitor)
{
- g_return_if_fail (BSE_IS_JANITOR (janitor));
+ assert_return (BSE_IS_JANITOR (janitor));
guint i, n = bse_janitor_n_actions (janitor);
for (i = 0; i < n; i++)
@@ -321,7 +321,7 @@ bst_msg_bit_create_choice (guint id,
const gchar *options)
{
int saved_errno = errno;
- // g_return_val_if_fail (options && options[0], NULL);
+ // assert_return (options && options[0], NULL);
BstMsgBit *mbit = g_new0 (BstMsgBit, 1);
mbit->id = id;
mbit->text = g_strdup (name);
diff --git a/beast-gtk/bstutils.cc b/beast-gtk/bstutils.cc
index c87c786..93cd4c6 100644
--- a/beast-gtk/bstutils.cc
+++ b/beast-gtk/bstutils.cc
@@ -117,8 +117,8 @@ bst_stock_register_icon (const gchar *stock_id,
guint rowstride,
const guint8 *pixels)
{
- g_return_if_fail (bytes_per_pixel == 3 || bytes_per_pixel == 4);
- g_return_if_fail (width > 0 && height > 0 && rowstride >= width * bytes_per_pixel);
+ assert_return (bytes_per_pixel == 3 || bytes_per_pixel == 4);
+ assert_return (width > 0 && height > 0 && rowstride >= width * bytes_per_pixel);
if (!gtk_icon_factory_lookup (stock_icon_factory, stock_id))
{
@@ -147,7 +147,7 @@ bst_status_set_error (Bse::ErrorType error, const std::string &message)
void
bst_gui_error_bell (gpointer widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (GTK_WIDGET_DRAWABLE (widget) && BST_GUI_ENABLE_ERROR_BELL)
{
@@ -197,12 +197,12 @@ bst_window_sync_title_to_proxy (gpointer window,
{
const char *p;
- g_return_if_fail (GTK_IS_WINDOW (window));
+ assert_return (GTK_IS_WINDOW (window));
if (proxy)
{
- g_return_if_fail (BSE_IS_ITEM (proxy));
- g_return_if_fail (title_format != NULL);
- /* g_return_if_fail (strstr (title_format, "%s") != NULL); */
+ assert_return (BSE_IS_ITEM (proxy));
+ assert_return (title_format != NULL);
+ /* assert_return (strstr (title_format, "%s") != NULL); */
}
p = title_format ? strstr (title_format, "%s") : NULL;
if (proxy && p)
@@ -281,7 +281,7 @@ bst_background_handler_add (gboolean (*handler) (gpointer data),
void (*free_func) (gpointer data),
gint prio)
{
- g_return_if_fail (handler != NULL);
+ assert_return (handler != NULL);
BackgroundHandler *bgh = g_new0 (BackgroundHandler, 1);
bgh->handler = handler;
bgh->data = data;
@@ -492,7 +492,7 @@ bst_action_list_from_cats_pred (BseCategorySeq *cseq,
GxkActionList *alist = gxk_action_list_create ();
guint i;
- g_return_val_if_fail (cseq != NULL, alist);
+ assert_return (cseq != NULL, alist);
for (i = 0; i < cseq->n_cats; i++)
if (!predicate || predicate (predicate_data, cseq->cats[i]))
@@ -553,14 +553,14 @@ gmask_form (GtkWidget *parent,
{
GMask *gmask;
- g_return_val_if_fail (GTK_IS_TABLE (parent), NULL);
- g_return_val_if_fail (GTK_IS_WIDGET (action), NULL);
+ assert_return (GTK_IS_TABLE (parent), NULL);
+ assert_return (GTK_IS_WIDGET (action), NULL);
if (!gmask_quark)
gmask_quark = g_quark_from_static_string ("GMask");
gmask = GMASK_GET (action);
- g_return_val_if_fail (gmask == NULL, NULL);
+ assert_return (gmask == NULL, NULL);
gmask = g_new0 (GMask, 1);
g_object_set_qdata_full (G_OBJECT (action), gmask_quark, gmask, gmask_destroy);
@@ -647,9 +647,9 @@ bst_gmask_set_tip (BstGMask *mask,
{
GMask *gmask;
- g_return_if_fail (GTK_IS_WIDGET (mask));
+ assert_return (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
- g_return_if_fail (gmask != NULL);
+ assert_return (gmask != NULL);
g_free (gmask->tip);
gmask->tip = g_strdup (tip_text);
@@ -667,10 +667,10 @@ bst_gmask_set_prompt (BstGMask *mask,
{
GMask *gmask;
- g_return_if_fail (GTK_IS_WIDGET (mask));
+ assert_return (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
- g_return_if_fail (gmask != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (gmask != NULL);
+ assert_return (GTK_IS_WIDGET (widget));
if (gmask->prompt)
g_object_unref (gmask->prompt);
@@ -690,10 +690,10 @@ bst_gmask_set_aux1 (BstGMask *mask,
{
GMask *gmask;
- g_return_if_fail (GTK_IS_WIDGET (mask));
+ assert_return (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
- g_return_if_fail (gmask != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (gmask != NULL);
+ assert_return (GTK_IS_WIDGET (widget));
if (gmask->aux1)
g_object_unref (gmask->aux1);
@@ -715,10 +715,10 @@ bst_gmask_set_aux2 (BstGMask *mask,
{
GMask *gmask;
- g_return_if_fail (GTK_IS_WIDGET (mask));
+ assert_return (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
- g_return_if_fail (gmask != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (gmask != NULL);
+ assert_return (GTK_IS_WIDGET (widget));
if (gmask->aux2)
g_object_unref (gmask->aux2);
@@ -738,10 +738,10 @@ bst_gmask_set_aux3 (BstGMask *mask,
{
GMask *gmask;
- g_return_if_fail (GTK_IS_WIDGET (mask));
+ assert_return (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
- g_return_if_fail (gmask != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (gmask != NULL);
+ assert_return (GTK_IS_WIDGET (widget));
if (gmask->aux3)
g_object_unref (gmask->aux3);
@@ -762,9 +762,9 @@ bst_gmask_set_column (BstGMask *mask,
{
GMask *gmask;
- g_return_if_fail (GTK_IS_WIDGET (mask));
+ assert_return (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
- g_return_if_fail (gmask != NULL);
+ assert_return (gmask != NULL);
gmask->column = column;
}
@@ -780,9 +780,9 @@ bst_gmask_get_prompt (BstGMask *mask)
{
GMask *gmask;
- g_return_val_if_fail (GTK_IS_WIDGET (mask), NULL);
+ assert_return (GTK_IS_WIDGET (mask), NULL);
gmask = GMASK_GET (mask);
- g_return_val_if_fail (gmask != NULL, NULL);
+ assert_return (gmask != NULL, NULL);
return gmask->prompt;
}
@@ -798,9 +798,9 @@ bst_gmask_get_aux1 (BstGMask *mask)
{
GMask *gmask;
- g_return_val_if_fail (GTK_IS_WIDGET (mask), NULL);
+ assert_return (GTK_IS_WIDGET (mask), NULL);
gmask = GMASK_GET (mask);
- g_return_val_if_fail (gmask != NULL, NULL);
+ assert_return (gmask != NULL, NULL);
return gmask->aux1;
}
@@ -816,9 +816,9 @@ bst_gmask_get_aux2 (BstGMask *mask)
{
GMask *gmask;
- g_return_val_if_fail (GTK_IS_WIDGET (mask), NULL);
+ assert_return (GTK_IS_WIDGET (mask), NULL);
gmask = GMASK_GET (mask);
- g_return_val_if_fail (gmask != NULL, NULL);
+ assert_return (gmask != NULL, NULL);
return gmask->aux2;
}
@@ -834,9 +834,9 @@ bst_gmask_get_aux3 (BstGMask *mask)
{
GMask *gmask;
- g_return_val_if_fail (GTK_IS_WIDGET (mask), NULL);
+ assert_return (GTK_IS_WIDGET (mask), NULL);
gmask = GMASK_GET (mask);
- g_return_val_if_fail (gmask != NULL, NULL);
+ assert_return (gmask != NULL, NULL);
return gmask->aux3;
}
@@ -852,9 +852,9 @@ bst_gmask_get_action (BstGMask *mask)
{
GMask *gmask;
- g_return_val_if_fail (GTK_IS_WIDGET (mask), NULL);
+ assert_return (GTK_IS_WIDGET (mask), NULL);
gmask = GMASK_GET (mask);
- g_return_val_if_fail (gmask != NULL, NULL);
+ assert_return (gmask != NULL, NULL);
return gmask->action;
}
@@ -875,10 +875,10 @@ bst_gmask_foreach (BstGMask *mask,
GMask *gmask;
GtkCallback callback = GtkCallback (func);
- g_return_if_fail (GTK_IS_WIDGET (mask));
+ assert_return (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
- g_return_if_fail (gmask != NULL);
- g_return_if_fail (func != NULL);
+ assert_return (gmask != NULL);
+ assert_return (func != NULL);
if (gmask->prompt)
callback (gmask->prompt, data);
@@ -957,9 +957,9 @@ bst_gmask_pack (BstGMask *mask)
guint row, n, c, dislodge_columns;
GMask *gmask;
- g_return_if_fail (GTK_IS_WIDGET (mask));
+ assert_return (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
- g_return_if_fail (gmask != NULL);
+ assert_return (gmask != NULL);
/* GUI mask layout:
* row: |Prompt|Aux1| Aux2 |Aux3| PreAction#Action#PostAction|
@@ -1158,11 +1158,11 @@ bst_container_set_named_child (GtkWidget *container,
{
NChildren *children;
- g_return_if_fail (GTK_IS_CONTAINER (container));
- g_return_if_fail (qname > 0);
- g_return_if_fail (GTK_IS_WIDGET (child));
+ assert_return (GTK_IS_CONTAINER (container));
+ assert_return (qname > 0);
+ assert_return (GTK_IS_WIDGET (child));
if (child)
- g_return_if_fail (gtk_widget_is_ancestor (child, container));
+ assert_return (gtk_widget_is_ancestor (child, container));
if (!quark_container_named_children)
quark_container_named_children = g_quark_from_static_string ("BstContainer-named_children");
@@ -1187,8 +1187,8 @@ bst_container_get_named_child (GtkWidget *container,
{
NChildren *children;
- g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
- g_return_val_if_fail (qname > 0, NULL);
+ assert_return (GTK_IS_CONTAINER (container), NULL);
+ assert_return (qname > 0, NULL);
children = quark_container_named_children ? (NChildren*) g_object_get_qdata (G_OBJECT (container),
quark_container_named_children) : NULL;
if (children)
@@ -1214,8 +1214,8 @@ bst_xpm_view_create (const gchar **xpm,
GdkPixmap *pixmap;
GdkBitmap *mask;
- g_return_val_if_fail (xpm != NULL, NULL);
- g_return_val_if_fail (GTK_IS_WIDGET (colormap_widget), NULL);
+ assert_return (xpm != NULL, NULL);
+ assert_return (GTK_IS_WIDGET (colormap_widget), NULL);
pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, gtk_widget_get_colormap (colormap_widget),
&mask, NULL, (gchar**) xpm);
@@ -1237,7 +1237,7 @@ bst_file_scan_find_key (const gchar *file,
{
SfiRStore *rstore;
- g_return_val_if_fail (file != NULL, NULL);
+ assert_return (file != NULL, NULL);
rstore = sfi_rstore_new_open (file);
if (rstore)
diff --git a/beast-gtk/bstwaveeditor.cc b/beast-gtk/bstwaveeditor.cc
index 452f465..f0665b3 100644
--- a/beast-gtk/bstwaveeditor.cc
+++ b/beast-gtk/bstwaveeditor.cc
@@ -271,7 +271,7 @@ bst_wave_editor_finalize (GObject *object)
{
BstWaveEditor *self = BST_WAVE_EDITOR (object);
- g_return_if_fail (self->qsamplers == NULL);
+ assert_return (self->qsamplers == NULL);
g_object_unref (self->chunk_wrapper);
@@ -282,7 +282,7 @@ void
bst_wave_editor_set_wave (BstWaveEditor *self,
SfiProxy wave)
{
- g_return_if_fail (BST_IS_WAVE_EDITOR (self));
+ assert_return (BST_IS_WAVE_EDITOR (self));
if (wave != self->wave)
{
@@ -509,9 +509,9 @@ void
bst_wave_editor_set_esample (BstWaveEditor *self,
SfiProxy esample)
{
- g_return_if_fail (BST_IS_WAVE_EDITOR (self));
+ assert_return (BST_IS_WAVE_EDITOR (self));
if (esample)
- g_return_if_fail (BSE_IS_EDITABLE_SAMPLE (esample));
+ assert_return (BSE_IS_EDITABLE_SAMPLE (esample));
if (esample != self->esample)
{
diff --git a/beast-gtk/bstwaveview.cc b/beast-gtk/bstwaveview.cc
index 7921d34..cb2e188 100644
--- a/beast-gtk/bstwaveview.cc
+++ b/beast-gtk/bstwaveview.cc
@@ -66,7 +66,7 @@ bst_wave_view_new (SfiProxy wrepo)
{
GtkWidget *wave_view;
- g_return_val_if_fail (BSE_IS_WAVE_REPO (wrepo), NULL);
+ assert_return (BSE_IS_WAVE_REPO (wrepo), NULL);
wave_view = gtk_widget_new (BST_TYPE_WAVE_VIEW, NULL);
bst_item_view_set_container (BST_ITEM_VIEW (wave_view), wrepo);
@@ -114,7 +114,7 @@ bst_wave_view_set_editable (BstWaveView *self,
{
BstItemView *iview = BST_ITEM_VIEW (self);
- g_return_if_fail (BST_IS_WAVE_VIEW (self));
+ assert_return (BST_IS_WAVE_VIEW (self));
self->editable = enabled != FALSE;
if (iview->tree)
diff --git a/beast-gtk/bstxframe.cc b/beast-gtk/bstxframe.cc
index c20cb50..d80c84f 100644
--- a/beast-gtk/bstxframe.cc
+++ b/beast-gtk/bstxframe.cc
@@ -330,9 +330,9 @@ bst_xframe_set_cover_widget (BstXFrame *xframe,
GtkWidget *widget,
gboolean steal_button)
{
- g_return_if_fail (BST_IS_XFRAME (xframe));
+ assert_return (BST_IS_XFRAME (xframe));
if (widget)
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (xframe->cover)
{
diff --git a/beast-gtk/bstxkb.cc b/beast-gtk/bstxkb.cc
index b08d1a2..9280d98 100644
--- a/beast-gtk/bstxkb.cc
+++ b/beast-gtk/bstxkb.cc
@@ -24,8 +24,8 @@ bst_xkb_open (const gchar *const_display,
int ext_major = XkbMajorVersion;
int ext_minor = XkbMinorVersion;
- g_return_val_if_fail (display != NULL, FALSE);
- g_return_val_if_fail (bst_xkb_display == NULL, FALSE);
+ assert_return (display != NULL, FALSE);
+ assert_return (bst_xkb_display == NULL, FALSE);
bst_xkb_display = XkbOpenDisplay (display,
&ext_base_event,
@@ -67,7 +67,7 @@ bst_xkb_open (const gchar *const_display,
void
bst_xkb_close (void)
{
- g_return_if_fail (bst_xkb_display != NULL);
+ assert_return (bst_xkb_display != NULL);
XkbFreeKeyboard (bst_xkb_desc, XkbAllComponentsMask, True);
bst_xkb_desc = NULL;
@@ -80,7 +80,7 @@ bst_xkb_get_symbol (gboolean physical)
{
gchar *name;
- g_return_val_if_fail (bst_xkb_desc != NULL, NULL);
+ assert_return (bst_xkb_desc != NULL, NULL);
if (physical)
name = bst_xkb_desc->names->phys_symbols ? XGetAtomName (bst_xkb_display,
bst_xkb_desc->names->phys_symbols) : "";
@@ -93,7 +93,7 @@ bst_xkb_get_symbol (gboolean physical)
void
bst_xkb_dump (void)
{
- g_return_if_fail (bst_xkb_desc != NULL);
+ assert_return (bst_xkb_desc != NULL);
g_message ("XKB: keycodes: %s types: %s "
"symbols: %s phys_symbols: %s "
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]