[beast/devel: 4/15] BSE: compile param, project, song, snet, super, sub*, etc as C++



commit 179e218cd5407cfd64c99c7b6e2d5135dee48f56
Author: Tim Janik <timj gnu org>
Date:   Sun Dec 16 21:15:33 2012 +0100

    BSE: compile param, project, song, snet, super, sub*, etc as C++

 bse/Makefile.am                                   |   18 ++--
 bse/bsebus.cc                                     |    2 +-
 bse/bsecontainer.h                                |    3 +-
 bse/bsedatapocket.cc                              |    2 +-
 bse/bseenums.cc                                   |    4 -
 bse/{bseparam.c => bseparam.cc}                   |    4 +-
 bse/{bsepart.c => bsepart.cc}                     |  111 +++++++++---------
 bse/bsepart.h                                     |    7 +-
 bse/bseprocedure.c                                |    3 +-
 bse/{bseproject.c => bseproject.cc}               |   98 +++++++--------
 bse/bseproject.h                                  |    2 +-
 bse/{bsesnet.c => bsesnet.cc}                     |   54 ++++-----
 bse/bsesnet.h                                     |    2 +-
 bse/{bsesong.c => bsesong.cc}                     |   53 ++++----
 bse/{bsesource.c => bsesource.cc}                 |  134 ++++++++++-----------
 bse/bsesource.h                                   |    3 +-
 bse/{bsestandardosc.c => bsestandardosc.cc}       |   32 +++---
 bse/{bsestandardsynths.c => bsestandardsynths.cc} |    4 +-
 bse/{bsesubiport.c => bsesubiport.cc}             |   14 ++-
 bse/{bsesuboport.c => bsesuboport.cc}             |   14 ++-
 bse/{bsesubsynth.c => bsesubsynth.cc}             |   18 ++--
 bse/{bsesuper.c => bsesuper.cc}                   |   27 ++---
 bse/{bsetrack.c => bsetrack.cc}                   |   76 ++++++------
 bse/{bsetype.c => bsetype.cc}                     |   64 +++++------
 bse/bsetype.h                                     |    8 +-
 bse/{bsewave.c => bsewave.cc}                     |   70 +++++------
 bse/{bsewaveosc.c => bsewaveosc.cc}               |   36 ++++---
 bse/{bsewaverepo.c => bsewaverepo.cc}             |   15 +--
 bse/mktypes.pl                                    |    2 +-
 po/POTSCAN                                        |   18 ++--
 30 files changed, 437 insertions(+), 461 deletions(-)
---
diff --git a/bse/Makefile.am b/bse/Makefile.am
index ea1dfbf..31d663d 100644
--- a/bse/Makefile.am
+++ b/bse/Makefile.am
@@ -75,16 +75,16 @@ bse_sources = $(strip \
 	bsemain.cc		bsemath.cc		bsemathsignal.cc		bseladspa.cc \
 	bsemidicontroller.cc	bsemididevice.cc 	bsedevice.cc 			\
 	bsemididevice-null.cc	bsemididevice-oss.cc	bsemidievent.cc			bsemidinotifier.c \
-	bsemidireceiver.cc	bsemidisynth.c		bseobject.c			bsepart.c \
-	bsepcminput.cc		bsepcmoutput.cc		bseparam.c			bseparasite.c \
+	bsemidireceiver.cc	bsemidisynth.c		bseobject.c			bsepart.cc \
+	bsepcminput.cc		bsepcmoutput.cc		bseparam.cc			bseparasite.c \
 	bsepcmdevice.cc		bsepcmdevice-oss.cc	bsepcmdevice-null.cc		bseplugin.c \
-	bseprocedure.c		bseproject.c		bsescripthelper.c		bseserver.cc \
-	bsesnet.c		bsesnooper.c		bsesong.c			bsesequencer.cc \
-	bsesource.c		bsestandardosc.c	bsestandardsynths.c		bsestorage.c \
-	bseinstrumentoutput.cc	bsesubiport.c		bseinstrumentinput.cc		bsesuboport.c \
-	bsesubsynth.c		bsesuper.c		bsetrack.c			bsetype.c \
-	bseutils.cc		bsemidivoice.c		bsewave.c			bsewaveosc.c \
-	bsecsynth.cc		bsewaverepo.c		bseladspamodule.cc		bsepcmwriter.cc \
+	bseprocedure.c		bseproject.cc		bsescripthelper.c		bseserver.cc \
+	bsesnet.cc		bsesnooper.c		bsesong.cc			bsesequencer.cc \
+	bsesource.cc		bsestandardosc.cc	bsestandardsynths.cc		bsestorage.c \
+	bseinstrumentoutput.cc	bsesubiport.cc		bseinstrumentinput.cc		bsesuboport.cc \
+	bsesubsynth.cc		bsesuper.cc		bsetrack.cc			bsetype.cc \
+	bseutils.cc		bsemidivoice.c		bsewave.cc			bsewaveosc.cc \
+	bsecsynth.cc		bsewaverepo.cc		bseladspamodule.cc		bsepcmwriter.cc \
 	bsecompat.cc		bseundostack.c		bsemidiinput.cc			bsemididecoder.cc \
 	bsenote.cc		bsemidifile.cc		bseblockutils.cc		\
 	bsecxxvalue.cc		bsecxxutils.cc		bsecxxbase.cc			bsecxxclosure.cc \
diff --git a/bse/bsebus.cc b/bse/bsebus.cc
index 40fc86b..cfbe926 100644
--- a/bse/bsebus.cc
+++ b/bse/bsebus.cc
@@ -800,7 +800,7 @@ bus_restore_private (BseObject  *object,
         return SfiTokenType (token);
       /* close statement */
       parse_or_return (scanner, ')');
-      return SfiTokenType (G_TOKEN_NONE);
+      return SFI_TOKEN_NONE;
     }
   else /* chain parent class' handler */
     return BSE_OBJECT_CLASS (bus_parent_class)->restore_private (object, storage, scanner);
diff --git a/bse/bsecontainer.h b/bse/bsecontainer.h
index ee09cfb..0f3f7a4 100644
--- a/bse/bsecontainer.h
+++ b/bse/bsecontainer.h
@@ -19,7 +19,8 @@
 #ifndef __BSE_CONTAINER_H__
 #define __BSE_CONTAINER_H__
 
-#include	<bse/bsesource.h>
+#include <bse/bsesource.h>
+#include <sfi/gbsearcharray.h>
 
 G_BEGIN_DECLS
 
diff --git a/bse/bsedatapocket.cc b/bse/bsedatapocket.cc
index e2ee5f2..c7596bf 100644
--- a/bse/bsedatapocket.cc
+++ b/bse/bsedatapocket.cc
@@ -641,7 +641,7 @@ parse_set_data (BseDataPocket *pocket,
   
   g_scanner_get_next_token (scanner); /* eat ')' */
   
-  return SfiTokenType (G_TOKEN_NONE);
+  return SFI_TOKEN_NONE;
 }
 
 static SfiTokenType
diff --git a/bse/bseenums.cc b/bse/bseenums.cc
index 0cd5a1c..27031e4 100644
--- a/bse/bseenums.cc
+++ b/bse/bseenums.cc
@@ -18,10 +18,6 @@
 #include "gslcommon.h"
 #include <errno.h>
 
-/* --- prototypes --- */
-extern "C" void	bse_type_register_enums		(void);
-
-
 /* include generated enum value arrays and *.h files the enums steam from */
 #include "bseenum_arrays.c"
 
diff --git a/bse/bseparam.c b/bse/bseparam.cc
similarity index 98%
rename from bse/bseparam.c
rename to bse/bseparam.cc
index cfba483..f0fbd0b 100644
--- a/bse/bseparam.c
+++ b/bse/bseparam.cc
@@ -43,7 +43,7 @@ bse_param_spec_object (const gchar    *name,
   
   g_return_val_if_fail (g_type_is_a (object_type, BSE_TYPE_OBJECT), NULL);
   
-  pspec = g_param_spec_object (name, NULL_CHECKED (nick), NULL_CHECKED (blurb), object_type, 0);
+  pspec = g_param_spec_object (name, NULL_CHECKED (nick), NULL_CHECKED (blurb), object_type, GParamFlags (0));
   sfi_pspec_set_options (pspec, hints);
   sfi_pspec_add_option (pspec, "skip-default", "+");
   
@@ -103,7 +103,7 @@ bse_param_spec_boxed (const gchar *name,
   if (sfi_boxed_type_get_rec_fields (boxed_type).n_fields ||
       sfi_boxed_type_get_seq_element (boxed_type))
     {
-      pspec = g_param_spec_boxed (name, nick, blurb, boxed_type, 0);
+      pspec = g_param_spec_boxed (name, nick, blurb, boxed_type, GParamFlags (0));
       sfi_pspec_set_options (pspec, hints);
     }
   else
diff --git a/bse/bsepart.c b/bse/bsepart.cc
similarity index 94%
rename from bse/bsepart.c
rename to bse/bsepart.cc
index 834584f..0ea07d5 100644
--- a/bse/bsepart.c
+++ b/bse/bsepart.cc
@@ -19,7 +19,7 @@
 #include "bsestorage.h"
 #include "bsesong.h"
 #include "bsetrack.h"
-#include <sfi/gbsearcharray.h>
+#include "bsecxxplugin.hh"
 #include "gslcommon.h"
 #include "bsemathsignal.h" // bse_semitone_table
 #include "bseieee754.h"
@@ -166,7 +166,7 @@ part_add_channel (BsePart *self,
   guint i = self->n_channels++;
   self->channels = g_renew (BsePartNoteChannel, self->channels, self->n_channels);
   bse_part_note_channel_init (&self->channels[i]);
-  g_object_notify (self, "n_channels");
+  g_object_notify ((GObject*) self, "n_channels");
 }
 
 static void
@@ -352,7 +352,7 @@ part_update_last_tick (BsePart *self)
   BSE_SEQUENCER_LOCK ();
   self->last_tick_SL = last_tick;
   BSE_SEQUENCER_UNLOCK ();
-  g_object_notify (self, "last-tick");
+  g_object_notify ((GObject*) self, "last-tick");
   bse_part_links_changed (self);
 }
 
@@ -361,7 +361,7 @@ range_changed_notify_handler (gpointer data)
 {
   while (plist_range_changed)
     {
-      BsePart *self = sfi_ring_pop_head (&plist_range_changed);
+      BsePart *self = (BsePart*) sfi_ring_pop_head (&plist_range_changed);
       self->range_queued = FALSE;
       guint tick = self->range_tick, duration = self->range_bound - tick;
       gint min_note = self->range_min_note, max_note = self->range_max_note;
@@ -438,7 +438,7 @@ links_changed_notify_handler (gpointer data)
 {
   while (plist_links_changed)
     {
-      BsePart *self = sfi_ring_pop_head (&plist_links_changed);
+      BsePart *self = (BsePart*) sfi_ring_pop_head (&plist_links_changed);
       self->links_queued = FALSE;
       g_signal_emit (self, signal_links_changed, 0);
     }
@@ -464,8 +464,8 @@ static int
 part_link_compare (const void *p1,
                    const void *p2)
 {
-  const BsePartLink *const*lp1 = p1;
-  const BsePartLink *const*lp2 = p2;
+  const BsePartLink *const*lp1 = (const BsePartLink *const*) p1;
+  const BsePartLink *const*lp2 = (const BsePartLink *const*) p2;
   const BsePartLink *l1 = lp1[0];
   const BsePartLink *l2 = lp2[0];
   if (l1->tick == l2->tick)
@@ -490,10 +490,9 @@ bse_part_list_links (BsePart *self)
       SfiRing *ring;
       for (ring = song->tracks_SL; ring; ring = sfi_ring_walk (ring, song->tracks_SL))
         {
-          BseTrack *track = ring->data;
+          BseTrack *track = (BseTrack*) ring->data;
           BseTrackPartSeq *tps = bse_track_list_part (track, self);
-          gint i;
-          for (i = 0; i < tps->n_tparts; i++)
+          for (uint i = 0; i < tps->n_tparts; i++)
             {
               BseTrackPart *tp = tps->tparts[i];
               BsePartLink pl;
@@ -528,7 +527,7 @@ bse_part_select_notes (BsePart *self,
   for (channel = 0; channel < self->n_channels; channel++)
     {
       BsePartEventNote *note, *last;
-      if (channel != match_channel && match_channel != ~0)
+      if (channel != match_channel && match_channel != ~uint (0))
         continue;
       note = bse_part_note_channel_lookup_ge (&self->channels[channel], tick);
       last = bse_part_note_channel_lookup_lt (&self->channels[channel], tick + duration);
@@ -602,7 +601,7 @@ bse_part_select_notes_exclusive (BsePart *self,
         {
           gboolean selected = (note->tick >= tick && note->tick < tick + duration &&
                                note->note >= min_note && note->note <= max_note &&
-                               (channel == match_channel || match_channel == ~0));
+                               (channel == match_channel || match_channel == ~uint (0)));
           if (note->selected != selected)
             {
               bse_part_note_channel_change_note (&self->channels[channel], note, note->id, selected,
@@ -789,7 +788,7 @@ bse_part_insert_note (BsePart *self,
 		      gfloat   velocity)
 {
   BsePartEventNote key = { 0 };
-  gboolean use_any_channel = channel == ~0;
+  const bool use_any_channel = channel == ~uint (0);
   g_return_val_if_fail (BSE_IS_PART (self), BSE_ERROR_INTERNAL);
   if (use_any_channel)
     channel = 0;
@@ -893,7 +892,7 @@ bse_part_change_note (BsePart *self,
 		      gfloat   velocity)
 {
   BsePartEventNote key = { 0 }, *note;
-  gboolean use_any_channel = channel == ~0;
+  const bool use_any_channel = channel == ~uint (0);
   guint i, old_tick;
   
   g_return_val_if_fail (BSE_IS_PART (self), FALSE);
@@ -1101,7 +1100,7 @@ bse_part_query_event (BsePart           *self,
           equery->velocity = 0;
           equery->fine_tune_value = 0;
           equery->velocity_value = 0;
-          equery->control_type = cev->ctype;
+          equery->control_type = BseMidiSignalType (cev->ctype);
           equery->control_value = cev->value;
         }
       return BSE_PART_EVENT_CONTROL;
@@ -1129,7 +1128,7 @@ bse_part_query_event (BsePart           *self,
           equery->velocity = note->velocity;
           equery->fine_tune_value = note_get_control_value (note, BSE_MIDI_SIGNAL_FINE_TUNE);
           equery->velocity_value = note_get_control_value (note, BSE_MIDI_SIGNAL_VELOCITY);
-          equery->control_type = 0;
+          equery->control_type = BseMidiSignalType (0);
           equery->control_value = 0;
         }
       return BSE_PART_EVENT_NOTE;
@@ -1189,7 +1188,7 @@ bse_part_list_notes (BsePart *self,
   for (channel = 0; channel < self->n_channels; channel++)
     {
       SfiUPool *tickpool;
-      if (channel != match_channel && match_channel != ~0)
+      if (channel != match_channel && match_channel != ~uint (0))
         continue;
       tickpool = sfi_upool_new ();
       /* gather notes spanning across tick */
@@ -1251,7 +1250,7 @@ bse_part_list_controls (BsePart          *self,
           BsePartEventNote *last = bse_part_note_channel_lookup_lt (&self->channels[channel], tick + duration);
           if (!note)
             continue;
-          if (channel != match_channel && match_channel != ~0)
+          if (channel != match_channel && match_channel != ~uint (0))
             continue;
           while (note <= last)
             {
@@ -1274,7 +1273,7 @@ bse_part_list_controls (BsePart          *self,
               bse_part_control_seq_take_append (cseq,
                                                 bse_part_control (cev->id,
                                                                   node->tick,
-                                                                  cev->ctype,
+                                                                  BseMidiSignalType (cev->ctype),
                                                                   cev->value,
                                                                   cev->selected));
           node++;
@@ -1381,7 +1380,7 @@ bse_part_list_selected_controls (BsePart           *self,
               bse_part_control_seq_take_append (cseq,
                                                 bse_part_control (cev->id,
                                                                   node->tick,
-                                                                  cev->ctype,
+                                                                  BseMidiSignalType (cev->ctype),
                                                                   cev->value,
                                                                   cev->selected));
           node++;
@@ -1492,7 +1491,7 @@ bse_part_restore_private (BseObject  *object,
       parse_or_return (scanner, G_TOKEN_INT);           /* channel */
       channel = scanner->value.v_int64;
       if (channel >= self->n_channels)
-        return bse_storage_warn_skip (storage, "ignoring notes with invalid channel: %u", channel);
+        return (SfiTokenType) bse_storage_warn_skip (storage, "ignoring notes with invalid channel: %u", channel);
       while (g_scanner_peek_next_token (scanner) != ')')
         {
           guint tick, duration, note;
@@ -1532,7 +1531,7 @@ bse_part_restore_private (BseObject  *object,
                               channel, tick, duration, note);
         }
       parse_or_return (scanner, ')');
-      return G_TOKEN_NONE;
+      return SFI_TOKEN_NONE;
     }
   else if (quark == quark_insert_controls)
     {
@@ -1564,19 +1563,19 @@ bse_part_restore_private (BseObject  *object,
           else
             {
               g_clear_error (&error);
-              return G_TOKEN_FLOAT;
+              return SfiTokenType (G_TOKEN_FLOAT);
             }
           if (g_scanner_peek_next_token (scanner) != ')')
             g_clear_error (&error);
           parse_or_return (scanner, ')');
           if (error)
             bse_storage_warn (storage, "unknown control event: %s", error->message);
-          else if (!bse_part_insert_control (self, tick, ctype, CLAMP (value, -1, +1)))
+          else if (!bse_part_insert_control (self, tick, BseMidiSignalType (ctype), CLAMP (value, -1, +1)))
             bse_storage_warn (storage, "failed to insert control event of type: %d", ctype);
           g_clear_error (&error);
         }
       parse_or_return (scanner, ')');
-      return G_TOKEN_NONE;
+      return SFI_TOKEN_NONE;
     }
   else if (quark == quark_insert_note)       /* pre-0.6.0 */
     {
@@ -1611,7 +1610,7 @@ bse_part_restore_private (BseObject  *object,
       if (!bse_part_insert_note (self, ~0, tick, duration, note, fine_tune, velocity))
 	bse_storage_warn (storage, "note insertion (note=%d tick=%u duration=%u) failed",
 			  note, tick, duration);
-      return G_TOKEN_NONE;
+      return SFI_TOKEN_NONE;
     }
   else if (quark == quark_insert_control)       /* pre-0.6.0 */
     {
@@ -1638,12 +1637,12 @@ bse_part_restore_private (BseObject  *object,
           value = negate ? -scanner->value.v_float : scanner->value.v_float;
         }
       else
-        return G_TOKEN_FLOAT;
+        return SfiTokenType (G_TOKEN_FLOAT);
       parse_or_return (scanner, ')');
 
-      if (!bse_part_insert_control (self, tick, ctype, CLAMP (value, -1, +1)))
+      if (!bse_part_insert_control (self, tick, BseMidiSignalType (ctype), CLAMP (value, -1, +1)))
         bse_storage_warn (storage, "skipping control event of invalid type: %d", ctype);
-      return G_TOKEN_NONE;
+      return SFI_TOKEN_NONE;
     }
   else /* chain parent class' handler */
     return BSE_OBJECT_CLASS (parent_class)->restore_private (object, storage, scanner);
@@ -1655,8 +1654,8 @@ static gint
 part_controls_cmp_tick_nodes (gconstpointer bsearch_node1, /* key */
                               gconstpointer bsearch_node2)
 {
-  const BsePartTickNode *n1 = bsearch_node1;
-  const BsePartTickNode *n2 = bsearch_node2;
+  const BsePartTickNode *n1 = (const BsePartTickNode*) bsearch_node1;
+  const BsePartTickNode *n2 = (const BsePartTickNode*) bsearch_node2;
   return G_BSEARCH_ARRAY_CMP (n1->tick, n2->tick);
 }
 
@@ -1678,7 +1677,7 @@ bse_part_controls_lookup (BsePartControls     *self,
 {
   BsePartTickNode key, *node;
   key.tick = tick;
-  node = g_bsearch_array_lookup (self->bsa, &controls_bsc, &key);
+  node = (BsePartTickNode*) g_bsearch_array_lookup (self->bsa, &controls_bsc, &key);
   return node;
 }
 
@@ -1689,7 +1688,7 @@ bse_part_controls_lookup_event (BsePartControls     *self,
 {
   BsePartTickNode key, *node;
   key.tick = tick;
-  node = g_bsearch_array_lookup (self->bsa, &controls_bsc, &key);
+  node = (BsePartTickNode*) g_bsearch_array_lookup (self->bsa, &controls_bsc, &key);
   if (node)
     {
       BsePartEventControl *cev;
@@ -1706,11 +1705,11 @@ bse_part_controls_lookup_ge (BsePartControls     *self,
 {
   BsePartTickNode key, *node;
   key.tick = tick;
-  node = g_bsearch_array_lookup_sibling (self->bsa, &controls_bsc, &key);
+  node = (BsePartTickNode*) g_bsearch_array_lookup_sibling (self->bsa, &controls_bsc, &key);
   if (node && node->tick < tick)        /* adjust smaller ticks */
     {
       guint ix = 1 + g_bsearch_array_get_index (self->bsa, &controls_bsc, node);
-      node = g_bsearch_array_get_nth (self->bsa, &controls_bsc, ix); /* returns NULL for i >= n_nodes */
+      node = (BsePartTickNode*) g_bsearch_array_get_nth (self->bsa, &controls_bsc, ix); /* returns NULL for i >= n_nodes */
       g_assert (!node || node->tick >= tick);
     }
   return node;
@@ -1722,7 +1721,7 @@ bse_part_controls_lookup_le (BsePartControls     *self,
 {
   BsePartTickNode key, *node;
   key.tick = tick;
-  node = g_bsearch_array_lookup_sibling (self->bsa, &controls_bsc, &key);
+  node = (BsePartTickNode*) g_bsearch_array_lookup_sibling (self->bsa, &controls_bsc, &key);
   if (node && node->tick > tick)        /* adjust smaller ticks */
     {
       node = g_bsearch_array_get_index (self->bsa, &controls_bsc, node) > 0 ? node - 1 : NULL;
@@ -1742,7 +1741,7 @@ BsePartTickNode*
 bse_part_controls_get_bound (BsePartControls *self)
 {
   guint nn = g_bsearch_array_get_n_nodes (self->bsa);
-  BsePartTickNode *first = g_bsearch_array_get_nth (self->bsa, &controls_bsc, 0);
+  BsePartTickNode *first = (BsePartTickNode*) g_bsearch_array_get_nth (self->bsa, &controls_bsc, 0);
   return first ? first + nn : NULL;
 }
 
@@ -1752,7 +1751,7 @@ bse_part_controls_get_last_tick (BsePartControls *self)
   guint n_nodes = g_bsearch_array_get_n_nodes (self->bsa);
   if (n_nodes)
     {
-      BsePartTickNode *node = g_bsearch_array_get_nth (self->bsa, &controls_bsc, n_nodes - 1);
+      BsePartTickNode *node = (BsePartTickNode*) g_bsearch_array_get_nth (self->bsa, &controls_bsc, n_nodes - 1);
       return node->tick + 1;
     }
   return 0;
@@ -1764,13 +1763,13 @@ bse_part_controls_ensure_tick (BsePartControls *self,
 {
   BsePartTickNode key = { 0 }, *node;
   key.tick = tick;
-  node = g_bsearch_array_lookup (self->bsa, &controls_bsc, &key);
+  node = (BsePartTickNode*) g_bsearch_array_lookup (self->bsa, &controls_bsc, &key);
   if (!node)
     {
       BSE_SEQUENCER_LOCK ();
       self->bsa = g_bsearch_array_insert (self->bsa, &controls_bsc, &key);
       BSE_SEQUENCER_UNLOCK ();
-      node = g_bsearch_array_lookup (self->bsa, &controls_bsc, &key);
+      node = (BsePartTickNode*) g_bsearch_array_lookup (self->bsa, &controls_bsc, &key);
     }
   return node;
 }
@@ -1860,7 +1859,7 @@ bse_part_controls_destroy (BsePartControls *self)
   guint nn = g_bsearch_array_get_n_nodes (self->bsa);
   while (nn)
     {
-      BsePartTickNode *node = g_bsearch_array_get_nth (self->bsa, &controls_bsc, --nn);
+      BsePartTickNode *node = (BsePartTickNode*) g_bsearch_array_get_nth (self->bsa, &controls_bsc, --nn);
       BsePartEventControl *cev, *next;
       for (cev = node->events; cev; cev = next)
         {
@@ -1878,8 +1877,8 @@ static gint
 part_note_channel_cmp_notes (gconstpointer bsearch_node1, /* key */
                              gconstpointer bsearch_node2)
 {
-  const BsePartEventNote *n1 = bsearch_node1;
-  const BsePartEventNote *n2 = bsearch_node2;
+  const BsePartEventNote *n1 = (const BsePartEventNote*) bsearch_node1;
+  const BsePartEventNote *n2 = (const BsePartEventNote*) bsearch_node2;
   return G_BSEARCH_ARRAY_CMP (n1->tick, n2->tick);
 }
 
@@ -1901,7 +1900,7 @@ bse_part_note_channel_lookup (BsePartNoteChannel     *self,
 {
   BsePartEventNote key, *note;
   key.tick = tick;
-  note = g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
+  note = (BsePartEventNote*) g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
   return note;
 }
 
@@ -1909,7 +1908,7 @@ BsePartEventNote*
 bse_part_note_channel_get_bound (BsePartNoteChannel *self)
 {
   guint nn = g_bsearch_array_get_n_nodes (self->bsa);
-  BsePartEventNote *first = g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, 0);
+  BsePartEventNote *first = (BsePartEventNote*) g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, 0);
   return first ? first + nn : NULL;
 }
 
@@ -1919,7 +1918,7 @@ bse_part_note_channel_lookup_le (BsePartNoteChannel     *self,
 {
   BsePartEventNote key, *note;
   key.tick = tick;
-  note = g_bsearch_array_lookup_sibling (self->bsa, &note_channel_bsc, &key);
+  note = (BsePartEventNote*) g_bsearch_array_lookup_sibling (self->bsa, &note_channel_bsc, &key);
   if (note && note->tick > tick)        /* adjust greater ticks */
     {
       note = g_bsearch_array_get_index (self->bsa, &note_channel_bsc, note) > 0 ? note - 1 : NULL;
@@ -1941,11 +1940,11 @@ bse_part_note_channel_lookup_ge (BsePartNoteChannel     *self,
 {
   BsePartEventNote key, *note;
   key.tick = tick;
-  note = g_bsearch_array_lookup_sibling (self->bsa, &note_channel_bsc, &key);
+  note = (BsePartEventNote*) g_bsearch_array_lookup_sibling (self->bsa, &note_channel_bsc, &key);
   if (note && note->tick < tick)        /* adjust smaller ticks */
     {
       guint ix = 1 + g_bsearch_array_get_index (self->bsa, &note_channel_bsc, note);
-      note = g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, ix); /* returns NULL for i >= n_nodes */
+      note = (BsePartEventNote*) g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, ix); /* returns NULL for i >= n_nodes */
       g_assert (!note || note->tick >= tick);
     }
   return note;
@@ -1957,14 +1956,14 @@ bse_part_note_channel_get_last_tick (BsePartNoteChannel *self)
   guint last_tick = 0, n_nodes = g_bsearch_array_get_n_nodes (self->bsa);
   if (n_nodes)
     {
-      BsePartEventNote *note = g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, n_nodes - 1);
+      BsePartEventNote *note = (BsePartEventNote*) g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, n_nodes - 1);
       BsePartEventNote key = { 0 };
       guint i;
       for (i = 0; i < BSE_PART_NOTE_N_CROSSINGS (note); i++)
         {
           BsePartEventNote *xnote;
           key.tick = BSE_PART_NOTE_CROSSING (note, i);
-          xnote = g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
+          xnote = (BsePartEventNote*) g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
           last_tick = MAX (last_tick, xnote->tick + xnote->duration);
         }
       last_tick = MAX (last_tick, note->tick + note->duration);
@@ -1979,7 +1978,7 @@ part_note_channel_check_crossing (BsePartNoteChannel *self,
 {
   BsePartEventNote key, *note;
   key.tick = note_tick;
-  note = g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
+  note = (BsePartEventNote*) g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
   g_assert (note);
   return note->tick + note->duration > tick_mark;
 }
@@ -2030,13 +2029,13 @@ bse_part_note_channel_insert (BsePartNoteChannel     *self,
   BSE_SEQUENCER_LOCK ();
   self->bsa = g_bsearch_array_insert (self->bsa, &note_channel_bsc, &key);
   BSE_SEQUENCER_UNLOCK ();
-  note = g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
+  note = (BsePartEventNote*) g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
   g_assert (note->crossings == NULL && note->id == key.id);
   ix = g_bsearch_array_get_index (self->bsa, &note_channel_bsc, note);
   /* copy predecessor crossings */
   if (ix > 0)
     {
-      BsePartEventNote *pre = g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, ix - 1);
+      BsePartEventNote *pre = (BsePartEventNote*) g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, ix - 1);
       guint *crossings = NULL;
       for (i = 0; i < BSE_PART_NOTE_N_CROSSINGS (pre); i++)
         if (part_note_channel_check_crossing (self, BSE_PART_NOTE_CROSSING (pre, i), key.tick))
@@ -2050,7 +2049,7 @@ bse_part_note_channel_insert (BsePartNoteChannel     *self,
   /* update successor crossings */
   for (i = ix + 1; i < g_bsearch_array_get_n_nodes (self->bsa); i++)
     {
-      BsePartEventNote *node = g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, i);
+      BsePartEventNote *node = (BsePartEventNote*) g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, i);
       if (key.tick + key.duration > node->tick)
         {
           BSE_SEQUENCER_LOCK ();
@@ -2091,7 +2090,7 @@ bse_part_note_channel_remove (BsePartNoteChannel     *self,
 {
   BsePartEventNote key, *note, *next, *bound = bse_part_note_channel_get_bound (self);
   key.tick = tick;
-  note = g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
+  note = (BsePartEventNote*) g_bsearch_array_lookup (self->bsa, &note_channel_bsc, &key);
   key = *note;
   /* update successor crossings */
   for (next = note + 1; next < bound; next++)
@@ -2117,7 +2116,7 @@ bse_part_note_channel_destroy (BsePartNoteChannel *self)
   guint nn = g_bsearch_array_get_n_nodes (self->bsa);
   while (nn)
     {
-      BsePartEventNote *note = g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, --nn);
+      BsePartEventNote *note = (BsePartEventNote*) g_bsearch_array_get_nth (self->bsa, &note_channel_bsc, --nn);
       g_free (note->crossings);
     }
   g_bsearch_array_free (self->bsa, &note_channel_bsc);
diff --git a/bse/bsepart.h b/bse/bsepart.h
index 114771d..91a1c62 100644
--- a/bse/bsepart.h
+++ b/bse/bsepart.h
@@ -17,7 +17,8 @@
 #ifndef __BSE_PART_H__
 #define __BSE_PART_H__
 
-#include        <bse/bseitem.h>
+#include <bse/bseitem.h>
+#include <sfi/gbsearcharray.h>
 
 G_BEGIN_DECLS
 
@@ -32,10 +33,10 @@ G_BEGIN_DECLS
 
 /* --- typedefs & structures --- */
 typedef struct {
-  gpointer bsa;
+  GBSearchArray *bsa;
 } BsePartControls;
 typedef struct {
-  gpointer bsa;
+  GBSearchArray *bsa;
 } BsePartNoteChannel;
 struct _BsePart
 {
diff --git a/bse/bseprocedure.c b/bse/bseprocedure.c
index 5d9ca4e..25b3701 100644
--- a/bse/bseprocedure.c
+++ b/bse/bseprocedure.c
@@ -33,7 +33,6 @@ static SFI_MSG_TYPE_DEFINE (debug_procs, "procs", SFI_MSG_DEBUG, NULL);
 
 
 /* --- prototypes --- */
-extern void     bse_type_register_procedure_info  (GTypeInfo                *info);
 static void     bse_procedure_base_init           (BseProcedureClass        *proc);
 static void     bse_procedure_base_finalize       (BseProcedureClass        *proc);
 static void     bse_procedure_init                (BseProcedureClass        *proc,
@@ -725,7 +724,7 @@ procedure_class_unref (BseProcedureClass *proc)
     }
 }
 
-extern void
+void
 bse_type_register_procedure_info (GTypeInfo *info)
 {
   static const GTypeInfo proc_info = {
diff --git a/bse/bseproject.c b/bse/bseproject.cc
similarity index 90%
rename from bse/bseproject.c
rename to bse/bseproject.cc
index 27f3521..9afcd96 100644
--- a/bse/bseproject.c
+++ b/bse/bseproject.cc
@@ -126,7 +126,7 @@ bse_project_class_init (BseProjectClass *klass)
   BseSourceClass *source_class = BSE_SOURCE_CLASS (klass);
   BseContainerClass *container_class = BSE_CONTAINER_CLASS (klass);
   
-  parent_class = g_type_class_peek_parent (klass);
+  parent_class = (GTypeClass*) g_type_class_peek_parent (klass);
   quark_storage_trap = g_quark_from_static_string ("bse-project-storage-trap");
 
   gobject_class->set_property = bse_project_set_property;
@@ -165,7 +165,7 @@ undo_notify (BseProject     *project,
              BseUndoStack   *ustack,
              gboolean        step_added)
 {
-  g_object_notify (project, "dirty");
+  g_object_notify ((GObject*) project, "dirty");
   if (step_added && !project->in_redo)
     {
       bse_undo_stack_force_dirty (project->undo_stack);
@@ -178,7 +178,7 @@ redo_notify (BseProject     *project,
              BseUndoStack   *ustack,
              gboolean        step_added)
 {
-  g_object_notify (project, "dirty");
+  g_object_notify ((GObject*) project, "dirty");
 }
 
 static void
@@ -199,9 +199,7 @@ bse_project_init (BseProject *self,
   bse_midi_receiver_enter_farm (self->midi_receiver);
 
   /* we always have a wave-repo */
-  wrepo = bse_container_new_child (BSE_CONTAINER (self), BSE_TYPE_WAVE_REPO,
-                                   "uname", "Wave-Repository",
-                                   NULL);
+  wrepo = (BseWaveRepo*) bse_container_new_child (BSE_CONTAINER (self), BSE_TYPE_WAVE_REPO, "uname", "Wave-Repository", NULL);
   /* with fixed uname */
   BSE_OBJECT_SET_FLAGS (wrepo, BSE_OBJECT_FLAG_FIXED_UNAME);
 }
@@ -249,9 +247,9 @@ bse_project_release_children (BseContainer *container)
   BseProject *project = BSE_PROJECT (container);
 
   while (project->items)
-    bse_container_remove_item (BSE_CONTAINER (project), project->items->data);
+    bse_container_remove_item (BSE_CONTAINER (project), (BseItem*) project->items->data);
   while (project->supers)
-    bse_container_remove_item (BSE_CONTAINER (project), project->supers->data);
+    bse_container_remove_item (BSE_CONTAINER (project), (BseItem*) project->supers->data);
 
   /* chain parent class' handler */
   BSE_CONTAINER_CLASS (parent_class)->release_children (container);
@@ -301,7 +299,7 @@ bse_project_clear_undo (BseProject *self)
     {
       bse_undo_stack_clear (self->undo_stack);
       bse_undo_stack_clear (self->redo_stack);
-      g_object_notify (self, "dirty");
+      g_object_notify ((GObject*) self, "dirty");
     }
 }
 
@@ -311,14 +309,14 @@ bse_project_clean_dirty (BseProject *self)
   g_return_if_fail (BSE_IS_PROJECT (self));
   bse_undo_stack_clean_dirty (self->undo_stack);
   bse_undo_stack_clean_dirty (self->redo_stack);
-  g_object_notify (self, "dirty");
+  g_object_notify ((GObject*) self, "dirty");
 }
 
 static void
 project_undo_do_deactivate (BseUndoStep  *ustep,
                             BseUndoStack *ustack)
 {
-  BseProject *self = bse_undo_pointer_unpack (ustep->data[0].v_pointer, ustack);
+  BseProject *self = (BseProject*) bse_undo_pointer_unpack ((const char*) ustep->data[0].v_pointer, ustack);
   bse_project_deactivate (self);
 }
 
@@ -400,9 +398,7 @@ bse_project_forall_items (BseContainer      *container,
   slist = self->supers;
   while (slist)
     {
-      BseItem *item;
-
-      item = slist->data;
+      BseItem *item = (BseItem*) slist->data;
       slist = slist->next;
       if (!func (item, data))
 	return;
@@ -411,9 +407,7 @@ bse_project_forall_items (BseContainer      *container,
   slist = self->items;
   while (slist)
     {
-      BseItem *item;
-
-      item = slist->data;
+      BseItem *item = (BseItem*) slist->data;
       slist = slist->next;
       if (!func (item, data))
 	return;
@@ -434,14 +428,14 @@ bse_project_retrieve_child (BseContainer *container,
 
       for (slist = self->supers; slist; slist = slist->next)
 	if (g_type_is_a (G_OBJECT_TYPE (slist->data), BSE_TYPE_WAVE_REPO))
-	  return slist->data;
+	  return (BseItem*) slist->data;
       g_warning ("%s: no wave-repo found in project\n", G_STRLOC);
       return NULL;	/* shouldn't happen */
     }
   else
     {
       BseItem *item = BSE_CONTAINER_CLASS (parent_class)->retrieve_child (container, child_type, uname);
-      StorageTrap *strap = g_object_get_qdata (self, quark_storage_trap);
+      StorageTrap *strap = (StorageTrap*) g_object_get_qdata ((GObject*) self, quark_storage_trap);
       if (item && strap)
 	{
           if (strap->intern_children)
@@ -457,10 +451,10 @@ static gboolean
 add_item_upaths (BseItem *item,
 		 gpointer data_p)
 {
-  gpointer *data = data_p;
-  BseStringSeq *sseq = data[0];
+  gpointer *data = (void**) data_p;
+  BseStringSeq *sseq = (BseStringSeq*) data[0];
   GType item_type = (GType) data[1];
-  BseContainer *container = data[2];
+  BseContainer *container = (BseContainer*) data[2];
 
   if (g_type_is_a (BSE_OBJECT_TYPE (item), item_type))
     {
@@ -501,7 +495,7 @@ compute_missing_supers (BseProject *self,
   GSList *targets = NULL, *missing = sfi_ppool_slist (storage->referenced_items);
   while (missing)
     {
-      BseItem *item = g_slist_pop_head (&missing);
+      BseItem *item = (BseItem*) g_slist_pop_head (&missing);
       BseSuper *super = bse_item_get_super (item);
       if (BSE_ITEM (super)->parent == project_item &&
           !sfi_ppool_lookup (storage->stored_items, super))
@@ -534,16 +528,16 @@ bse_project_store_bse (BseProject  *self,
   if (fd < 0)
     return bse_error_from_errno (errno, BSE_ERROR_FILE_OPEN_FAILED);
 
-  storage = g_object_new (BSE_TYPE_STORAGE, NULL);
+  storage = (BseStorage*) g_object_new (BSE_TYPE_STORAGE, NULL);
   flags = 0;
   if (self_contained)
     flags |= BSE_STORAGE_SELF_CONTAINED;
-  bse_storage_prepare_write (storage, flags);
+  bse_storage_prepare_write (storage, BseStorageMode (flags));
 
   slist = g_slist_prepend (slist, super ? (void*) super : (void*) self);
   while (slist)
     {
-      BseItem *item = g_slist_pop_head (&slist);
+      BseItem *item = (BseItem*) g_slist_pop_head (&slist);
       if (item == (BseItem*) self)
         bse_storage_store_item (storage, item);
       else
@@ -590,7 +584,7 @@ bse_project_restore (BseProject *self,
   GSList *slist = self->supers;
   while (slist)
     {
-      BseSuper *super = slist->data;
+      BseSuper *super = (BseSuper*) slist->data;
       slist = slist->next;
       BseSuperClass *super_class = BSE_SUPER_GET_CLASS (super);
       super_class->compat_finish (super, storage->major_version, storage->minor_version, storage->micro_version);
@@ -611,7 +605,7 @@ bse_project_upath_resolver (gpointer     func_data,
 			    const gchar *upath,
 			    gchar      **error_p)
 {
-  BseProject *self = func_data;
+  BseProject *self = (BseProject*) func_data;
   gpointer item = NULL;
 
   if (error_p)
@@ -625,8 +619,8 @@ bse_project_upath_resolver (gpointer     func_data,
     item = bse_container_resolve_upath (BSE_CONTAINER (self), upath);
   else if (error_p)
     *error_p = g_strdup_printf ("unable to resolve object of type `%s' from upath: %s", g_type_name (required_type), upath);
-  
-  return item;
+
+  return (BseObject*) item;
 }
 
 BseItem*
@@ -653,7 +647,7 @@ bse_project_get_wave_repo (BseProject *self)
   GSList *slist;
   for (slist = self->supers; slist; slist = slist->next)
     if (BSE_IS_WAVE_REPO (slist->data))
-      return slist->data;
+      return (BseWaveRepo*) slist->data;
   return NULL;
 }
 
@@ -664,7 +658,7 @@ bse_project_get_song (BseProject *self)
   GSList *slist;
   for (slist = self->supers; slist; slist = slist->next)
     if (BSE_IS_SONG (slist->data))
-      return slist->data;
+      return (BseSong*) slist->data;
   return NULL;
 }
 
@@ -674,7 +668,7 @@ project_check_restore (BseContainer *container,
 {
   if (BSE_CONTAINER_CLASS (parent_class)->check_restore (container, child_type))
     {
-      StorageTrap *strap = g_object_get_qdata (container, quark_storage_trap);
+      StorageTrap *strap = (StorageTrap*) g_object_get_qdata ((GObject*) container, quark_storage_trap);
       if (!strap)
 	return TRUE;
       if (!g_type_is_a (g_type_from_name (child_type), strap->base_type))
@@ -687,7 +681,7 @@ project_check_restore (BseContainer *container,
     return FALSE;
 }
 
-gpointer
+BseSNet*
 bse_project_create_intern_synth (BseProject  *self,
 				 const gchar *synth_name,
 				 GType        check_type)
@@ -701,11 +695,11 @@ bse_project_create_intern_synth (BseProject  *self,
   bse_synth = bse_standard_synth_inflate (synth_name, NULL);
   if (bse_synth)
     {
-      BseStorage *storage = g_object_new (BSE_TYPE_STORAGE, NULL);
+      BseStorage *storage = (BseStorage*) g_object_new (BSE_TYPE_STORAGE, NULL);
       BseErrorType error = BSE_ERROR_NONE;
-      StorageTrap strap = { 0, TRUE, }, *old_strap = g_object_get_qdata (self, quark_storage_trap);
+      StorageTrap strap = { 0, TRUE, }, *old_strap = (StorageTrap*) g_object_get_qdata ((GObject*) self, quark_storage_trap);
       bse_storage_input_text (storage, bse_synth, "<builtin-lib>");
-      g_object_set_qdata (self, quark_storage_trap, &strap);
+      g_object_set_qdata ((GObject*) self, quark_storage_trap, &strap);
       strap.max_items = 1;
       strap.base_type = check_type;
       strap.items = NULL;
@@ -718,21 +712,18 @@ bse_project_create_intern_synth (BseProject  *self,
 	g_warning ("failed to create internal synth \"%s\": %s",
 		   synth_name, bse_error_blurb (error ? error : BSE_ERROR_NO_ENTRY));
       else
-	synth = strap.items->data;
+	synth = (BseItem*) strap.items->data;
       g_slist_free (strap.items);
-      g_object_set_qdata (self, quark_storage_trap, old_strap);
+      g_object_set_qdata ((GObject*) self, quark_storage_trap, old_strap);
     }
-  return synth;
+  return BSE_SNET (synth);
 }
 
 BseCSynth*
 bse_project_create_intern_csynth (BseProject *self,
                                   const char *base_name)
 {
-  BseCSynth *csynth = bse_container_new_child_bname (BSE_CONTAINER (self),
-                                                     BSE_TYPE_CSYNTH,
-                                                     base_name,
-                                                     NULL);
+  BseCSynth *csynth = (BseCSynth*) bse_container_new_child_bname (BSE_CONTAINER (self), BSE_TYPE_CSYNTH, base_name, NULL);
   bse_item_set_internal (BSE_ITEM (csynth), TRUE);
   return csynth;
 }
@@ -743,9 +734,10 @@ bse_project_get_midi_notifier (BseProject *self)
   GSList *slist;
   for (slist = self->items; slist; slist = slist->next)
     if (BSE_IS_MIDI_NOTIFIER (slist->data))
-      return slist->data;
+      return (BseMidiNotifier*) slist->data;
 
-  BseMidiNotifier *mnot = bse_container_new_child_bname (BSE_CONTAINER (self), BSE_TYPE_MIDI_NOTIFIER, "%bse-intern-midi-notifier", NULL);
+  BseMidiNotifier *mnot = (BseMidiNotifier*) bse_container_new_child_bname (BSE_CONTAINER (self), BSE_TYPE_MIDI_NOTIFIER,
+                                                                            "%bse-intern-midi-notifier", NULL);
   bse_midi_notifier_set_receiver (mnot, self->midi_receiver);
   bse_item_set_internal (BSE_ITEM (mnot), TRUE);
   return mnot;
@@ -760,7 +752,7 @@ bse_project_prepare (BseSource *source)
   /* make sure Wave repositories are prepared first */
   for (slist = self->supers; slist; slist = slist->next)
     if (BSE_IS_WAVE_REPO (slist->data))
-      bse_source_prepare (slist->data);
+      bse_source_prepare ((BseSource*) slist->data);
 
   /* chain parent class' handler to prepare the rest */
   BSE_SOURCE_CLASS (parent_class)->prepare (source);
@@ -792,7 +784,7 @@ bse_project_state_changed (BseProject     *self,
     {
       SfiTime stamp = gsl_tick_stamp ();
       SfiTime delay_usecs = 0;
-      if (self->deactivate_min_tick > stamp)
+      if (SfiTime (self->deactivate_min_tick) > stamp)
 	delay_usecs = (self->deactivate_min_tick - stamp) * 1000000 / bse_engine_sample_freq ();
       self->deactivate_timer = bse_idle_timed (self->deactivate_usecs + delay_usecs, auto_deactivate, self);
     }
@@ -874,7 +866,7 @@ bse_project_start_playback (BseProject *self)
     {
       BseSuper *super = BSE_SUPER (slist->data);
       if (BSE_SUPER_NEEDS_CONTEXT (super) &&
-	  super->context_handle == ~0)
+	  super->context_handle == ~uint (0))
 	{
           BseMidiContext mcontext = { 0, 0, 0 };
           BseSNet *snet = BSE_SNET (super);
@@ -898,7 +890,7 @@ bse_project_start_playback (BseProject *self)
     bse_project_state_changed (self, BSE_PROJECT_PLAYING);
   /* then, start the sequencer */
   while (songs)
-    bse_sequencer_start_song (sfi_ring_pop_head (&songs), 0);
+    bse_sequencer_start_song ((BseSong*) sfi_ring_pop_head (&songs), 0);
 }
 
 void
@@ -919,7 +911,7 @@ bse_project_stop_playback (BseProject *self)
       BseSuper *super = BSE_SUPER (slist->data);
       if (BSE_IS_SONG (super))
         bse_sequencer_remove_song (BSE_SONG (super));
-      if (super->context_handle != ~0 && BSE_SUPER_NEEDS_CONTEXT (super))
+      if (super->context_handle != ~uint (0) && BSE_SUPER_NEEDS_CONTEXT (super))
 	{
 	  BseSource *source = BSE_SOURCE (super);
 	  bse_source_dismiss_context (source, super->context_handle, trans);
@@ -946,7 +938,7 @@ bse_project_check_auto_stop (BseProject *self)
       for (slist = self->supers; slist; slist = slist->next)
 	{
 	  BseSuper *super = BSE_SUPER (slist->data);
-	  if (super->context_handle != ~0)
+	  if (super->context_handle != ~uint (0))
 	    {
 	      if (!BSE_IS_SONG (super) || !BSE_SONG (super)->sequencer_done_SL)
 		return;
@@ -974,7 +966,7 @@ bse_project_deactivate (BseProject *self)
   for (slist = self->supers; slist; slist = slist->next)
     {
       BseSuper *super = BSE_SUPER (slist->data);
-      if (super->context_handle != ~0)
+      if (super->context_handle != ~uint (0))
 	{
 	  BseSource *source = BSE_SOURCE (super);
 	  bse_source_dismiss_context (source, super->context_handle, trans);
diff --git a/bse/bseproject.h b/bse/bseproject.h
index a4aa0c4..baa510b 100644
--- a/bse/bseproject.h
+++ b/bse/bseproject.h
@@ -91,7 +91,7 @@ BseItem*	bse_project_lookup_typed_item	(BseProject	*project,
 						 const gchar	*uname);
 BseWaveRepo*	bse_project_get_wave_repo	(BseProject	*project);
 BseSong*	bse_project_get_song    	(BseProject	*project);
-gpointer	bse_project_create_intern_synth	(BseProject	*project,
+BseSNet*	bse_project_create_intern_synth	(BseProject	*project,
 						 const gchar	*synth_name,
 						 GType           check_type);
 BseCSynth*      bse_project_create_intern_csynth(BseProject     *project,
diff --git a/bse/bsesnet.c b/bse/bsesnet.cc
similarity index 95%
rename from bse/bsesnet.c
rename to bse/bsesnet.cc
index 6306928..d5d8219 100644
--- a/bse/bsesnet.c
+++ b/bse/bsesnet.cc
@@ -19,7 +19,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
-#include <sfi/gbsearcharray.h>
 #include <bse/bseengine.h>
 #include <bse/gslcommon.h>
 #include "bsesnet.h"
@@ -110,7 +109,7 @@ void
 bse_snet_intern_child (BseSNet *self,
                        gpointer child)
 {
-  BseItem *item = child;
+  BseItem *item = (BseItem*) child;
 
   g_return_if_fail (BSE_IS_SNET (self));
   g_return_if_fail (BSE_IS_ITEM (item));
@@ -128,8 +127,8 @@ bse_snet_release_children (BseContainer *container)
   BseSNet *snet = BSE_SNET (container);
 
   while (snet->sources)
-    bse_container_remove_item (container, sfi_ring_pop_head (&snet->sources));
-  
+    bse_container_remove_item (container, (BseItem*) sfi_ring_pop_head (&snet->sources));
+
   /* chain parent class' handler */
   BSE_CONTAINER_CLASS (parent_class)->release_children (container);
 }
@@ -148,9 +147,9 @@ bse_snet_finalize (GObject *object)
   BseContainer *container = BSE_CONTAINER (object);
   
   while (snet->sources)
-    bse_container_remove_item (container, sfi_ring_pop_head (&snet->sources));
+    bse_container_remove_item (container, (BseItem*) sfi_ring_pop_head (&snet->sources));
   while (snet->isources)
-    bse_container_remove_item (container, sfi_ring_pop_head (&snet->isources));
+    bse_container_remove_item (container, (BseItem*) sfi_ring_pop_head (&snet->isources));
   if (snet->port_unregistered_id)
     {
       bse_idle_remove (snet->port_unregistered_id);
@@ -255,7 +254,7 @@ bse_snet_forall_items (BseContainer      *container,
   node = snet->sources;
   while (node)
     {
-      BseItem *item = node->data;
+      BseItem *item = (BseItem*) node->data;
       node = sfi_ring_walk (node, snet->sources);
       if (!func (item, data))
         return;
@@ -264,7 +263,7 @@ bse_snet_forall_items (BseContainer      *container,
   node = snet->isources;
   while (node)
     {
-      BseItem *item = node->data;
+      BseItem *item = (BseItem*) node->data;
       node = sfi_ring_walk (node, snet->isources);
       if (!func (item, data))
         return;
@@ -301,7 +300,7 @@ snet_find_port_name (BseSNet     *snet,
   GSList *slist;
   
   for (slist = in_port ? snet->iport_names : snet->oport_names; slist; slist = slist->next)
-    if (strcmp (name, slist->data) == 0)
+    if (strcmp (name, (const char*) slist->data) == 0)
       return slist;
   return NULL;
 }
@@ -426,8 +425,8 @@ static gint
 snet_ports_compare (gconstpointer bsearch_node1, /* key */
 		    gconstpointer bsearch_node2)
 {
-  const BseSNetPort *p1 = bsearch_node1;
-  const BseSNetPort *p2 = bsearch_node2;
+  const BseSNetPort *p1 = (const BseSNetPort*) bsearch_node1;
+  const BseSNetPort *p2 = (const BseSNetPort*) bsearch_node2;
   gint cmp;
   
   cmp = G_BSEARCH_ARRAY_CMP (p1->context, p2->context);
@@ -446,11 +445,10 @@ port_lookup (BseSNet     *snet,
 	     gboolean	  is_input)
 {
   BseSNetPort key;
-  
   key.name = (gchar*) name;
   key.context = snet_context;
   key.input = is_input != FALSE;
-  return g_bsearch_array_lookup (snet->port_array, &port_array_config, &key);
+  return (BseSNetPort*) g_bsearch_array_lookup (snet->port_array, &port_array_config, &key);
 }
 
 static BseSNetPort*
@@ -460,21 +458,20 @@ port_insert (BseSNet     *snet,
 	     gboolean     is_input)
 {
   BseSNetPort key = { NULL, }, *port;
-  
   key.name = (gchar*) name;
   key.context = snet_context;
   key.input = is_input != FALSE;
-  
-  port = g_bsearch_array_lookup (snet->port_array, &port_array_config, &key);
+
+  port = (BseSNetPort*) g_bsearch_array_lookup (snet->port_array, &port_array_config, &key);
   g_return_val_if_fail (port == NULL, port);	/* shouldn't fail */
-  
+
   key.name = g_strdup (key.name);
   key.src_omodule = NULL;
   key.src_ostream = G_MAXUINT;
   key.dest_imodule = NULL;
   key.dest_istream = G_MAXUINT;
   snet->port_array = g_bsearch_array_insert (snet->port_array, &port_array_config, &key);
-  return g_bsearch_array_lookup (snet->port_array, &port_array_config, &key);
+  return (BseSNetPort*) g_bsearch_array_lookup (snet->port_array, &port_array_config, &key);
 }
 
 static void
@@ -638,8 +635,7 @@ static inline ContextData*
 find_context_data (BseSNet *self,
 		   guint    context_id)
 {
-  gpointer data = bse_source_get_context_data (BSE_SOURCE (self), context_id);
-  return data;
+  return (ContextData*) bse_source_get_context_data (BSE_SOURCE (self), context_id);
 }
 
 static ContextData*
@@ -678,10 +674,10 @@ free_context_data (BseSource *source,
 		   BseTrans  *trans)
 {
   BseSNet *self = BSE_SNET (source);
-  ContextData *cdata = data;
-  
+  ContextData *cdata = (ContextData*) data;
+
   g_return_if_fail (cdata->n_branches == 0);
-  
+
   bse_midi_receiver_unref (cdata->midi_receiver);
   bse_id_free (cdata->context_id);
   if (cdata->parent_context)
@@ -846,8 +842,8 @@ bse_snet_reset (BseSource *source)
   
   if (g_bsearch_array_get_n_nodes (self->port_array))
     {
-      BseSNetPort *port = g_bsearch_array_get_nth (self->port_array, &port_array_config, 0);
-      
+      BseSNetPort *port = (BseSNetPort*) g_bsearch_array_get_nth (self->port_array, &port_array_config, 0);
+
       g_warning ("%s: %cport \"%s\" still active: context=%u src=%p dest=%p",
 		 G_STRLOC, port->input ? 'i' : 'o', port->name,
 		 port->context, port->src_omodule, port->dest_imodule);
@@ -867,7 +863,7 @@ bse_snet_context_create (BseSource *source,
   
   if (self->tmp_context_children)
     {
-      BseContextMerger *context_merger = self->tmp_context_children->data;
+      BseContextMerger *context_merger = (BseContextMerger*) self->tmp_context_children->data;
       ContextData *cdata = find_context_data (self, context_handle);
       
       g_assert (BSE_IS_CONTEXT_MERGER (context_merger));
@@ -922,9 +918,9 @@ bse_snet_class_init (BseSNetClass *klass)
   BseObjectClass *object_class = BSE_OBJECT_CLASS (klass);
   BseSourceClass *source_class = BSE_SOURCE_CLASS (klass);
   BseContainerClass *container_class = BSE_CONTAINER_CLASS (klass);
-  
-  parent_class = g_type_class_peek_parent (klass);
-  
+
+  parent_class = (GTypeClass*) g_type_class_peek_parent (klass);
+
   gobject_class->set_property = bse_snet_set_property;
   gobject_class->get_property = bse_snet_get_property;
   gobject_class->dispose = bse_snet_dispose;
diff --git a/bse/bsesnet.h b/bse/bsesnet.h
index 957c36c..452a247 100644
--- a/bse/bsesnet.h
+++ b/bse/bsesnet.h
@@ -61,7 +61,7 @@ struct _BseSNet
   SfiRing	*isources;	/* internal (protected) sources */
   GSList	*iport_names;
   GSList	*oport_names;
-  gpointer	 port_array;	/* of type BseSNetPort* */
+  GBSearchArray *port_array;	/* of type BseSNetPort* */
 
   GSList	*tmp_context_children;
 
diff --git a/bse/bsesong.c b/bse/bsesong.cc
similarity index 92%
rename from bse/bsesong.c
rename to bse/bsesong.cc
index c4cfebc..62534b3 100644
--- a/bse/bsesong.c
+++ b/bse/bsesong.cc
@@ -28,6 +28,7 @@
 #include "bsesequencer.h"
 #include "bsesubsynth.h"
 #include "bseengine.h"	// FIXME: for bse_engine_sample_freq()
+#include "bsecxxplugin.hh"
 #include <string.h>
 
 
@@ -103,11 +104,11 @@ bse_song_release_children (BseContainer *container)
   BseSong *self = BSE_SONG (container);
 
   while (self->busses)
-    bse_container_remove_item (container, self->busses->data);
+    bse_container_remove_item (container, (BseItem*) self->busses->data);
   while (self->parts)
-    bse_container_remove_item (container, self->parts->data);
+    bse_container_remove_item (container, (BseItem*) self->parts->data);
   while (self->tracks_SL)
-    bse_container_remove_item (container, self->tracks_SL->data);
+    bse_container_remove_item (container, (BseItem*) self->tracks_SL->data);
 
   /* chain parent class' handler */
   BSE_CONTAINER_CLASS (parent_class)->release_children (container);
@@ -169,10 +170,10 @@ bse_song_set_property (GObject      *object,
     case PROP_MUSICAL_TUNING:
       if (!BSE_SOURCE_PREPARED (self))
         {
-          self->musical_tuning = g_value_get_enum (value);
+          self->musical_tuning = (BseMusicalTuningType) g_value_get_enum (value);
           SfiRing *ring;
           for (ring = self->parts; ring; ring = sfi_ring_walk (ring, self->parts))
-            bse_part_set_semitone_table (ring->data, bse_semitone_table_from_tuning (self->musical_tuning));
+            bse_part_set_semitone_table ((BsePart*) ring->data, bse_semitone_table_from_tuning (self->musical_tuning));
         }
       break;
     case PROP_BPM:
@@ -188,7 +189,7 @@ bse_song_set_property (GObject      *object,
               bse_item_cross_unlink (BSE_ITEM (self), BSE_ITEM (self->pnet), song_uncross_pnet);
               self->pnet = NULL;
             }
-          self->pnet = bse_value_get_object (value);
+          self->pnet = (BseSNet*) bse_value_get_object (value);
           if (self->pnet)
             {
               bse_item_cross_link (BSE_ITEM (self), BSE_ITEM (self->pnet), song_uncross_pnet);
@@ -235,7 +236,7 @@ bse_song_set_property (GObject      *object,
 				   self->loop_right_SL > self->loop_left_SL);
 	  BSE_SEQUENCER_UNLOCK ();
 	  if (loop_enabled != self->loop_enabled_SL)
-	    g_object_notify (self, "loop_enabled");
+	    g_object_notify ((GObject*) self, "loop_enabled");
 	}
       break;
     case PROP_LOOP_RIGHT:
@@ -250,18 +251,18 @@ bse_song_set_property (GObject      *object,
 				   self->loop_right_SL > self->loop_left_SL);
 	  BSE_SEQUENCER_UNLOCK ();
           if (loop_enabled != self->loop_enabled_SL)
-	    g_object_notify (self, "loop_enabled");
+	    g_object_notify ((GObject*) self, "loop_enabled");
 	}
       break;
     case PROP_TICK_POINTER:
       vint = sfi_value_get_int (value);
-      if (vint != self->tick_SL)
+      if (uint (vint) != self->tick_SL)
 	{
 	  BSE_SEQUENCER_LOCK ();
 	  self->tick_SL = vint;
 	  for (ring = self->tracks_SL; ring; ring = sfi_ring_walk (ring, self->tracks_SL))
 	    {
-	      BseTrack *track = ring->data;
+	      BseTrack *track = (BseTrack*) ring->data;
 	      track->track_done_SL = FALSE;	/* let sequencer recheck if playing */
 	    }
 	  BSE_SEQUENCER_UNLOCK ();
@@ -417,7 +418,7 @@ bse_song_forall_items (BseContainer	 *container,
   ring = self->parts;
   while (ring)
     {
-      BseItem *item = ring->data;
+      BseItem *item = (BseItem*) ring->data;
       ring = sfi_ring_walk (ring, self->parts);
       if (!func (item, data))
 	return;
@@ -439,7 +440,7 @@ bse_song_remove_item (BseContainer *container,
       bse_track_remove_modules (BSE_TRACK (item), BSE_CONTAINER (self));
       ring = sfi_ring_find (self->tracks_SL, item);
       for (tmp = sfi_ring_walk (ring, self->tracks_SL); tmp; tmp = sfi_ring_walk (tmp, self->tracks_SL))
-	bse_item_queue_seqid_changed (tmp->data);
+	bse_item_queue_seqid_changed ((BseItem*) tmp->data);
       BSE_SEQUENCER_LOCK ();
       self->tracks_SL = sfi_ring_remove_node (self->tracks_SL, ring);
       BSE_SEQUENCER_UNLOCK ();
@@ -448,7 +449,7 @@ bse_song_remove_item (BseContainer *container,
     {
       SfiRing *tmp, *ring = sfi_ring_find (self->parts, item);
       for (tmp = sfi_ring_walk (ring, self->parts); tmp; tmp = sfi_ring_walk (tmp, self->parts))
-	bse_item_queue_seqid_changed (tmp->data);
+	bse_item_queue_seqid_changed ((BseItem*) tmp->data);
       self->parts = sfi_ring_remove_node (self->parts, ring);
     }
   else if (g_type_is_a (BSE_OBJECT_TYPE (item), BSE_TYPE_BUS))
@@ -457,7 +458,7 @@ bse_song_remove_item (BseContainer *container,
         bse_song_set_solo_bus (self, NULL);
       SfiRing *tmp, *ring = sfi_ring_find (self->busses, item);
       for (tmp = sfi_ring_walk (ring, self->busses); tmp; tmp = sfi_ring_walk (tmp, self->busses))
-	bse_item_queue_seqid_changed (tmp->data);
+	bse_item_queue_seqid_changed ((BseItem*) tmp->data);
       self->busses = sfi_ring_remove_node (self->busses, ring);
     }
   else
@@ -472,7 +473,7 @@ song_position_handler (gpointer data)
 {
   BseSong *self = BSE_SONG (data);
 
-  if (self->last_position != self->tick_SL)
+  if (uint (self->last_position) != self->tick_SL)
     {
       BSE_SEQUENCER_LOCK ();
       self->last_position = self->tick_SL;
@@ -527,7 +528,7 @@ bse_song_context_create (BseSource *source,
 
   if (!bse_snet_context_is_branch (snet, context_handle))       /* catch recursion */
     for (ring = self->tracks_SL; ring; ring = sfi_ring_walk (ring, self->tracks_SL))
-      bse_track_clone_voices (ring->data, snet, context_handle, mcontext, trans);
+      bse_track_clone_voices ((BseTrack*) ring->data, snet, context_handle, mcontext, trans);
 }
 
 static void
@@ -553,7 +554,7 @@ bse_song_reset (BseSource *source)
 
   bse_object_unlock (BSE_OBJECT (self));
 
-  g_object_notify (self, "tick-pointer");
+  g_object_notify ((GObject*) self, "tick-pointer");
 }
 
 BseSource*
@@ -562,7 +563,7 @@ bse_song_create_summation (BseSong *self)
   GType type = g_type_from_name ("BseSummation");
   if (!g_type_is_a (type, BSE_TYPE_SOURCE))
     g_error ("%s: failed to resolve %s object type, probably missing or broken plugin installation", G_STRFUNC, "BseSummation");
-  BseSource *summation = bse_container_new_child (BSE_CONTAINER (self), type, "uname", "Summation", NULL);
+  BseSource *summation = (BseSource*) bse_container_new_child (BSE_CONTAINER (self), type, "uname", "Summation", NULL);
   g_assert (summation != NULL);
   bse_snet_intern_child (BSE_SNET (self), summation);
   return summation;
@@ -590,7 +591,7 @@ bse_song_set_solo_bus (BseSong        *self,
   SfiRing *ring;
   self->solo_bus = bus;
   for (ring = self->busses; ring; ring = sfi_ring_walk (ring, self->busses))
-    bse_bus_change_solo (ring->data, self->solo_bus && ring->data != self->solo_bus && ring->data != master);
+    bse_bus_change_solo ((BseBus*) ring->data, self->solo_bus && ring->data != self->solo_bus && ring->data != master);
 }
 
 static void
@@ -625,14 +626,12 @@ bse_song_init (BseSong *self)
   self->loop_right_SL = -1;
 
   /* post processing slot */
-  self->postprocess = bse_container_new_child (BSE_CONTAINER (self), BSE_TYPE_SUB_SYNTH,
-                                               "uname", "Postprocess",
-                                               NULL);
+  self->postprocess = (BseSource*) bse_container_new_child (BSE_CONTAINER (self), BSE_TYPE_SUB_SYNTH, "uname", "Postprocess", NULL);
   bse_snet_intern_child (snet, self->postprocess);
   bse_sub_synth_set_null_shortcut (BSE_SUB_SYNTH (self->postprocess), TRUE);
 
   /* output */
-  self->output = bse_container_new_child (BSE_CONTAINER (self), BSE_TYPE_PCM_OUTPUT, NULL);
+  self->output = (BseSource*) bse_container_new_child (BSE_CONTAINER (self), BSE_TYPE_PCM_OUTPUT, NULL);
   bse_snet_intern_child (snet, self->output);
 
   /* postprocess <-> output */
@@ -656,7 +655,7 @@ bse_song_ensure_master (BseSong *self)
   if (!child)
     {
       BseUndoStack *ustack = bse_item_undo_open (self, "create-master");
-      child = bse_container_new_child_bname (BSE_CONTAINER (self), BSE_TYPE_BUS, master_bus_name(), NULL);
+      child = (BseSource*) bse_container_new_child_bname (BSE_CONTAINER (self), BSE_TYPE_BUS, master_bus_name(), NULL);
       g_object_set (child, "master-output", TRUE, NULL); /* no undo */
       bse_item_push_undo_proc (self, "remove-bus", child);
       bse_item_undo_close (ustack);
@@ -681,7 +680,7 @@ bse_song_compat_finish (BseSuper       *super,
       /* collect all bus inputs */
       SfiRing *node, *tracks, *inputs = NULL;
       for (node = self->busses; node; node = sfi_ring_walk (node, self->busses))
-        inputs = sfi_ring_concat (inputs, bse_bus_list_inputs (node->data));
+        inputs = sfi_ring_concat (inputs, bse_bus_list_inputs ((BseBus*) node->data));
       /* find tracks that are not in input list */
       tracks = sfi_ring_copy (self->tracks_SL);
       inputs = sfi_ring_sort (inputs, sfi_pointer_cmp, NULL);
@@ -695,7 +694,7 @@ bse_song_compat_finish (BseSuper       *super,
       BseSource *master = bse_song_ensure_master (self);
       for (node = master ? tracks : NULL; node; node = sfi_ring_walk (node, tracks))
         {
-          BseErrorType error = bse_bus_connect (BSE_BUS (master), node->data);
+          BseErrorType error = bse_bus_connect (BSE_BUS (master), (BseItem*) node->data);
           if (error)
             sfi_warning ("Failed to connect track %s: %s", bse_object_debug_name (node->data), bse_error_blurb (error));
           clear_undo = TRUE;
@@ -721,7 +720,7 @@ bse_song_class_init (BseSongClass *klass)
   BseSuperClass *super_class = BSE_SUPER_CLASS (klass);
   BseSongTiming timing;
 
-  parent_class = g_type_class_peek_parent (klass);
+  parent_class = (GTypeClass*) g_type_class_peek_parent (klass);
   
   gobject_class->set_property = bse_song_set_property;
   gobject_class->get_property = bse_song_get_property;
diff --git a/bse/bsesource.c b/bse/bsesource.cc
similarity index 92%
rename from bse/bsesource.c
rename to bse/bsesource.cc
index 9b66432..35e5e08 100644
--- a/bse/bsesource.c
+++ b/bse/bsesource.cc
@@ -15,7 +15,6 @@
  * with this library; if not, see http://www.gnu.org/copyleft/.
  */
 #include <string.h>
-#include <sfi/gbsearcharray.h>
 #include "bsesource.h"
 
 #include "bsecontainer.h"
@@ -326,7 +325,7 @@ bse_source_class_cache_engine_class (BseSourceClass *source_class,
   g_return_if_fail (source_class->engine_class == NULL);
   g_return_if_fail (engine_class != NULL);
 
-  source_class->engine_class = g_memdup (engine_class, sizeof (*engine_class));
+  source_class->engine_class = (BseModuleClass*) g_memdup (engine_class, sizeof (*engine_class));
 }
 
 guint
@@ -366,7 +365,7 @@ source_class_collect_properties (BseSourceClass *klass)
                g_type_is_a (G_PARAM_SPEC_VALUE_TYPE (pspec), SFI_TYPE_INT) ||
                g_type_is_a (G_PARAM_SPEC_VALUE_TYPE (pspec), SFI_TYPE_NUM)))
             {
-              BseSourceClass *source_class = g_type_class_ref (pspec->owner_type);
+              BseSourceClass *source_class = (BseSourceClass*) g_type_class_ref (pspec->owner_type);
               if (!source_class || !source_class->property_updated)
                 g_warning ("%s: ignoring automation property \"%s\" without property_updated() implementation",
                            g_type_name (pspec->owner_type), pspec->name);
@@ -387,15 +386,15 @@ source_notify_properties (BseSource *self)
   source_class_collect_properties (BSE_SOURCE_GET_CLASS (self));
   SfiRing *ring;
   for (ring = klass->unprepared_properties; ring; ring = sfi_ring_walk (ring, klass->unprepared_properties))
-    g_object_notify (self, G_PARAM_SPEC (ring->data)->name);
+    g_object_notify ((GObject*) self, G_PARAM_SPEC (ring->data)->name);
 }
 
 static gint
 contexts_compare (gconstpointer bsearch_node1, /* key */
 		  gconstpointer bsearch_node2)
 {
-  const BseSourceContext *c1 = bsearch_node1;
-  const BseSourceContext *c2 = bsearch_node2;
+  const BseSourceContext *c1 = (const BseSourceContext*) bsearch_node1;
+  const BseSourceContext *c2 = (const BseSourceContext*) bsearch_node2;
 
   return G_BSEARCH_ARRAY_CMP (c1->id, c2->id);
 }
@@ -445,9 +444,7 @@ bse_source_reset (BseSource *source)
       BseTrans *trans = bse_trans_open ();
       while (n_contexts)
 	{
-	  BseSourceContext *context = g_bsearch_array_get_nth (source->contexts,
-							       &context_config,
-							       n_contexts - 1);
+	  BseSourceContext *context = (BseSourceContext*) g_bsearch_array_get_nth (source->contexts, &context_config, n_contexts - 1);
 	  bse_source_dismiss_context (source, context->id, trans);
 	  n_contexts = BSE_SOURCE_N_CONTEXTS (source);
 	}
@@ -467,8 +464,8 @@ static gint
 automation_properties_cmp (gconstpointer bsearch_node1, /* key */
                            gconstpointer bsearch_node2)
 {
-  const BseAutomationProperty *ap1 = bsearch_node1;
-  const BseAutomationProperty *ap2 = bsearch_node2;
+  const BseAutomationProperty *ap1 = (const BseAutomationProperty*) bsearch_node1;
+  const BseAutomationProperty *ap2 = (const BseAutomationProperty*) bsearch_node2;
   return G_BSEARCH_ARRAY_CMP (ap1->pspec, ap2->pspec);
 }
 
@@ -477,7 +474,7 @@ static const GBSearchConfig aprop_bconfig = { sizeof (BseAutomationProperty), au
 static void
 aprop_array_free (gpointer data)
 {
-  GBSearchArray *aparray = data;
+  GBSearchArray *aparray = (GBSearchArray*) data;
   g_bsearch_array_free (aparray, &aprop_bconfig);
 }
 
@@ -487,46 +484,47 @@ bse_source_set_automation_property (BseSource        *source,
                                     guint             midi_channel,
                                     BseMidiSignalType signal_type)
 {
-  g_assert (BSE_MIDI_CONTROL_NONE          == 0 &&
-            BSE_MIDI_CONTROL_CONTINUOUS_0  == BSE_MIDI_SIGNAL_CONTINUOUS_0 &&
-            BSE_MIDI_CONTROL_CONTINUOUS_31 == BSE_MIDI_SIGNAL_CONTINUOUS_31 &&
-            BSE_MIDI_CONTROL_0             == BSE_MIDI_SIGNAL_CONTROL_0 &&
-            BSE_MIDI_CONTROL_127           == BSE_MIDI_SIGNAL_CONTROL_127);
+  g_assert (BSE_MIDI_CONTROL_NONE          == BseMidiControlType (0) &&
+            BSE_MIDI_CONTROL_CONTINUOUS_0  == BseMidiControlType (BSE_MIDI_SIGNAL_CONTINUOUS_0) &&
+            BSE_MIDI_CONTROL_CONTINUOUS_31 == BseMidiControlType (BSE_MIDI_SIGNAL_CONTINUOUS_31) &&
+            BSE_MIDI_CONTROL_0             == BseMidiControlType (BSE_MIDI_SIGNAL_CONTROL_0) &&
+            BSE_MIDI_CONTROL_127           == BseMidiControlType (BSE_MIDI_SIGNAL_CONTROL_127));
   g_return_val_if_fail (BSE_IS_SOURCE (source), BSE_ERROR_INTERNAL);
   g_return_val_if_fail (prop_name != NULL, BSE_ERROR_INTERNAL);
   if (BSE_SOURCE_PREPARED (source))
     return BSE_ERROR_SOURCE_BUSY;
-  if (signal_type != BSE_MIDI_CONTROL_NONE &&
-      (signal_type < BSE_MIDI_CONTROL_CONTINUOUS_0 || signal_type > BSE_MIDI_CONTROL_CONTINUOUS_31) &&
-      (signal_type < BSE_MIDI_CONTROL_0 || signal_type > BSE_MIDI_CONTROL_127))
+  const BseMidiControlType control_type = BseMidiControlType (signal_type);
+  if (control_type != BSE_MIDI_CONTROL_NONE &&
+      (control_type < BSE_MIDI_CONTROL_CONTINUOUS_0 || control_type > BSE_MIDI_CONTROL_CONTINUOUS_31) &&
+      (control_type < BSE_MIDI_CONTROL_0 || control_type > BSE_MIDI_CONTROL_127))
     return BSE_ERROR_INVALID_MIDI_CONTROL;
   source_class_collect_properties (BSE_SOURCE_GET_CLASS (source));
   GParamSpec *pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (source), prop_name);
   SfiRing *ring = sfi_ring_find (BSE_SOURCE_GET_CLASS (source)->automation_properties, pspec);
   if (!ring)    /* !pspec or pspec not found */
     return BSE_ERROR_INVALID_PROPERTY;
-  GBSearchArray *aparray = g_object_get_data (source, "BseSource-AutomationProperties"), *oarray = aparray;
+  GBSearchArray *aparray = (GBSearchArray*) g_object_get_data (G_OBJECT (source), "BseSource-AutomationProperties"), *oarray = aparray;
   if (!aparray)
     aparray = g_bsearch_array_create (&aprop_bconfig);
-  BseAutomationProperty key = { pspec, }, *ap = g_bsearch_array_lookup (aparray, &aprop_bconfig, &key);
+  BseAutomationProperty key = { pspec, }, *ap = (BseAutomationProperty*) g_bsearch_array_lookup (aparray, &aprop_bconfig, &key);
   if (!ap)
     {
       key.midi_channel = 0;
-      key.signal_type = 0;
+      key.signal_type = BseMidiSignalType (0);
       aparray = g_bsearch_array_insert (aparray, &aprop_bconfig, &key);
-      ap = g_bsearch_array_lookup (aparray, &aprop_bconfig, &key);
+      ap = (BseAutomationProperty*) g_bsearch_array_lookup (aparray, &aprop_bconfig, &key);
     }
   if (oarray != aparray)
     {
-      g_object_steal_data (source, "BseSource-AutomationProperties");
-      g_object_set_data_full (source, "BseSource-AutomationProperties", aparray, aprop_array_free);
+      g_object_steal_data ((GObject*) source, "BseSource-AutomationProperties");
+      g_object_set_data_full ((GObject*) source, "BseSource-AutomationProperties", aparray, aprop_array_free);
     }
   if (ap->midi_channel != midi_channel ||
       ap->signal_type != signal_type)
     {
       ap->midi_channel = midi_channel;
       ap->signal_type = signal_type;
-      g_object_notify (source, pspec->name);
+      g_object_notify ((GObject*) source, pspec->name);
     }
   return BSE_ERROR_NONE;
 }
@@ -542,10 +540,10 @@ bse_source_get_automation_property (BseSource         *source,
   GParamSpec *pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (source), prop_name);
   if (pspec)
     {
-      GBSearchArray *aparray = g_object_get_data (source, "BseSource-AutomationProperties");
+      GBSearchArray *aparray = (GBSearchArray*) g_object_get_data ((GObject*) source, "BseSource-AutomationProperties");
       if (aparray)
         {
-          BseAutomationProperty key = { pspec, }, *ap = g_bsearch_array_lookup (aparray, &aprop_bconfig, &key);
+          BseAutomationProperty key = { pspec, }, *ap = (BseAutomationProperty*) g_bsearch_array_lookup (aparray, &aprop_bconfig, &key);
           if (ap)
             {
               if (psignal_type)
@@ -566,11 +564,12 @@ bse_source_get_automation_properties (BseSource        *source,
   g_return_val_if_fail (BSE_IS_SOURCE (source), NULL);
   if (n_props)
     {
-      GBSearchArray *aparray = g_object_get_data (source, "BseSource-AutomationProperties");
+      GBSearchArray *aparray = (GBSearchArray*) g_object_get_data ((GObject*) source, "BseSource-AutomationProperties");
       if (aparray)
         {
           *n_props = g_bsearch_array_get_n_nodes (aparray);
-          return g_memdup (g_bsearch_array_get_nth (aparray, &aprop_bconfig, 0), sizeof (BseAutomationProperty) * *n_props);
+          void *ap = g_memdup (g_bsearch_array_get_nth (aparray, &aprop_bconfig, 0), sizeof (BseAutomationProperty) * *n_props);
+          return (BseAutomationProperty*) ap;
         }
       *n_props = 0;
     }
@@ -590,7 +589,7 @@ context_nth (BseSource *source,
 {
   g_return_val_if_fail (index < BSE_SOURCE_N_CONTEXTS (source), NULL);
 
-  return g_bsearch_array_get_nth (source->contexts, &context_config, index);
+  return (BseSourceContext*) g_bsearch_array_get_nth (source->contexts, &context_config, index);
 }
 
 static inline BseSourceContext*
@@ -600,7 +599,7 @@ context_lookup (BseSource *source,
   BseSourceContext key;
 
   key.id = context_handle;
-  return g_bsearch_array_lookup (source->contexts, &context_config, &key);
+  return (BseSourceContext*) g_bsearch_array_lookup (source->contexts, &context_config, &key);
 }
 
 gboolean
@@ -671,7 +670,7 @@ source_create_context (BseSource               *source,
 
   g_object_ref (source);
   key.id = context_handle;
-  key.u.data.d1 = free_data;
+  key.u.data.d1 = (void*) free_data;
   key.u.data.d2 = data;
   source->contexts = g_bsearch_array_insert (source->contexts, &context_config, &key);
   BSE_SOURCE_GET_CLASS (source)->context_create (source, key.id, trans);
@@ -853,7 +852,7 @@ bse_source_dismiss_context (BseSource *source,
       if (BSE_SOURCE_N_OCHANNELS (source) == 0 &&
 	  BSE_SOURCE_N_ICHANNELS (source) == 0)
 	{
-	  free_cdata = context->u.data.d1;
+	  free_cdata = (BseSourceFreeContextData) context->u.data.d1;
 	  cdata = context->u.data.d2;
 	}
       source->contexts = g_bsearch_array_remove (source->contexts, &context_config,
@@ -962,7 +961,7 @@ bse_source_list_omodules (BseSource *source)
   if (BSE_SOURCE_N_OCHANNELS (source))
     for (i = 0; i < n_contexts; i++)
       {
-        BseSourceContext *context = g_bsearch_array_get_nth (source->contexts, &context_config, i);
+        BseSourceContext *context = (BseSourceContext*) g_bsearch_array_get_nth (source->contexts, &context_config, i);
         if (context->u.mods.omodule)
           ring = sfi_ring_append (ring, context->u.mods.omodule);
       }
@@ -1076,14 +1075,13 @@ bse_source_flow_access_modules (BseSource    *source,
       else if (context->u.mods.omodule && context->u.mods.omodule != context->u.mods.imodule)
 	modules = g_slist_prepend (modules, context->u.mods.omodule);
     }
-  
+
   if (modules)
     {
       BseTrans *my_trans = trans ? trans : bse_trans_open ();
-      GSList *slist;
-      
-      for (slist = modules; slist; slist = slist->next)
-	bse_trans_add (my_trans, bse_job_flow_access (slist->data, tick_stamp, access_func, data,
+
+      for (GSList *slist = modules; slist; slist = slist->next)
+	bse_trans_add (my_trans, bse_job_flow_access ((BseModule*) slist->data, tick_stamp, access_func, data,
 						      slist->next ? NULL : data_free_func));
       if (!trans)
 	bse_trans_commit (my_trans);
@@ -1124,7 +1122,7 @@ bse_source_access_modules (BseSource    *source,
       GSList *slist;
 
       for (slist = modules; slist; slist = slist->next)
-	bse_trans_add (my_trans, bse_job_access (slist->data, access_func, data,
+	bse_trans_add (my_trans, bse_job_access ((BseModule*) slist->data, access_func, data,
 						 slist->next ? NULL : data_free_func));
       if (!trans)
 	bse_trans_commit (my_trans);
@@ -1143,8 +1141,8 @@ static void
 op_access_update (BseModule *module,
 		  gpointer   data)
 {
-  AccessData *adata = data;
-  guint8 *m = module->user_data;
+  AccessData *adata = (AccessData*) data;
+  guint8 *m = (guint8*) module->user_data;
 
   memcpy (m + adata->member_offset, adata + 1, adata->member_size);
 }
@@ -1163,7 +1161,7 @@ bse_source_update_modules (BseSource *source,
   g_return_if_fail (member_data != NULL);
   g_return_if_fail (member_size > 0);
 
-  adata = g_malloc (sizeof (AccessData) + member_size);
+  adata = (AccessData*) g_malloc (sizeof (AccessData) + member_size);
   adata->member_offset = member_offset;
   adata->member_size = member_size;
   memcpy (adata + 1, member_data, member_size);
@@ -1418,7 +1416,7 @@ bse_source_has_output (BseSource *source,
       GSList *slist;
       for (slist = source->outputs; slist; slist = slist->next)
         {
-          BseSource *isource = slist->data;
+          BseSource *isource = (BseSource*) slist->data;
           guint i, j;
           for (i = 0; i < BSE_SOURCE_N_ICHANNELS (isource); i++)
             {
@@ -1453,8 +1451,7 @@ bse_source_must_set_input_loc (BseSource      *source,
 }
 
 static SfiRing*
-collect_inputs_flat (SfiRing   *ring,
-                     BseSource *source)
+collect_inputs_flat (SfiRing *ring, BseSource *source)
 {
   guint i, j;
 
@@ -1501,7 +1498,7 @@ bse_source_collect_inputs_recursive (BseSource *source)
 
   ring = collect_inputs_flat (ring, source);
   for (node = ring; node; node = sfi_ring_walk (node, ring))
-    ring = collect_inputs_flat (ring, node->data);
+    ring = collect_inputs_flat (ring, (BseSource*) node->data);
   return ring;
 }
 
@@ -1544,7 +1541,7 @@ bse_source_test_input_recursive (BseSource      *source,
   gboolean match = last->data == test;
   for (node = ring; node && !match; node = sfi_ring_walk (node, ring))
     {
-      ring = collect_inputs_flat (ring, node->data);
+      ring = collect_inputs_flat (ring, (BseSource*) node->data);
       match = ring_search_backwards (ring->prev, last, test);
       last = ring->prev;
     }
@@ -1637,7 +1634,7 @@ bse_source_clear_ochannels (BseSource *source)
   g_object_ref (source);
   while (source->outputs)
     {
-      BseSource *isource = source->outputs->data;
+      BseSource *isource = (BseSource*) source->outputs->data;
       guint i;
       
       g_object_ref (isource);
@@ -1695,7 +1692,7 @@ bse_source_backup_ochannels_to_undo (BseSource *source)
       
       for (slist = uniq_outputs; slist; slist = slist->next)
         {
-          BseSource *isource = slist->data;
+          BseSource *isource = (BseSource*) slist->data;
           guint i;
           for (i = 0; i < BSE_SOURCE_N_ICHANNELS (isource); i++)
             {
@@ -1745,7 +1742,7 @@ bse_source_real_store_private (BseObject  *object,
       
       for (slist = outputs; slist; slist = slist->next)
         {
-          BseSourceOutput *output = slist->data;
+          BseSourceOutput *output = (BseSourceOutput*) slist->data;
           
           bse_storage_break (storage);
           bse_storage_printf (storage,
@@ -1775,7 +1772,7 @@ bse_source_input_backup_to_undo (BseSource      *source,
 
   ustack = bse_item_undo_open (source, "unset-input %s", bse_object_debug_name (source));
 
-  storage = g_object_new (BSE_TYPE_STORAGE, NULL);
+  storage = (BseStorage*) g_object_new (BSE_TYPE_STORAGE, NULL);
   bse_storage_prepare_write (storage, BSE_STORAGE_DBLOCK_CONTAINED);
 
   bse_storage_break (storage);
@@ -1808,7 +1805,7 @@ resolve_osource_input (gpointer     data,
 		       BseItem     *to_item,
 		       const gchar *error)
 {
-  DeferredInput *dinput = data;
+  DeferredInput *dinput = (DeferredInput*) data;
   BseSource *source = BSE_SOURCE (from_item);
   BseSource *osource = to_item ? BSE_SOURCE (to_item) : NULL;
 
@@ -1889,17 +1886,17 @@ bse_source_restore_private (BseObject  *object,
 	{
 	  GTokenType token = bse_storage_parse_item_link (storage, BSE_ITEM (source), resolve_osource_input, dinput);
 	  if (token != G_TOKEN_NONE)
-	    return token;
+	    return SfiTokenType (token);
 	}
-      
+
       /* parse ochannel name */
       parse_or_return (scanner, G_TOKEN_STRING);
       peek_or_return (scanner, ')');
       dinput->ochannel_ident = g_strdup (scanner->value.v_string);
-      
+
       /* close statement */
       parse_or_return (scanner, ')');
-      return G_TOKEN_NONE;
+      return SFI_TOKEN_NONE;
     }
   else /* chain parent class' handler */
     return BSE_OBJECT_CLASS (parent_class)->restore_private (object, storage, scanner);
@@ -1939,7 +1936,7 @@ void
 bse_source_class_inherit_channels (BseSourceClass *source_class)
 {
   g_return_if_fail (BSE_IS_SOURCE_CLASS (source_class));
-  BseSourceClass *parent_class = g_type_class_peek_parent (source_class);
+  BseSourceClass *parent_class = (BseSourceClass*) g_type_class_peek_parent (source_class);
   g_return_if_fail (BSE_IS_SOURCE_CLASS (parent_class));
   g_return_if_fail (source_class->channel_defs.n_ichannels == 0);
   g_return_if_fail (source_class->channel_defs.n_ochannels == 0);
@@ -1949,9 +1946,9 @@ bse_source_class_inherit_channels (BseSourceClass *source_class)
   guint i;
   /* dup ichannel arrays */
   source_class->channel_defs.n_ichannels = defs->n_ichannels;
-  source_class->channel_defs.ichannel_idents = g_memdup (defs->ichannel_idents, sizeof (gchar*) * defs->n_ichannels);
-  source_class->channel_defs.ichannel_labels = g_memdup (defs->ichannel_labels, sizeof (gchar*) * defs->n_ichannels);
-  source_class->channel_defs.ichannel_blurbs = g_memdup (defs->ichannel_blurbs, sizeof (gchar*) * defs->n_ichannels);
+  source_class->channel_defs.ichannel_idents = (char**) g_memdup (defs->ichannel_idents, sizeof (gchar*) * defs->n_ichannels);
+  source_class->channel_defs.ichannel_labels = (char**) g_memdup (defs->ichannel_labels, sizeof (gchar*) * defs->n_ichannels);
+  source_class->channel_defs.ichannel_blurbs = (char**) g_memdup (defs->ichannel_blurbs, sizeof (gchar*) * defs->n_ichannels);
   /* dup ichannel array contents */
   for (i = 0; i < defs->n_ichannels; i++)
     {
@@ -1960,13 +1957,13 @@ bse_source_class_inherit_channels (BseSourceClass *source_class)
       source_class->channel_defs.ichannel_blurbs[i] = g_strdup (defs->ichannel_blurbs[i]);
     }
   /* dup jstream ids + jchannel flags */
-  source_class->channel_defs.ijstreams = g_memdup (defs->ijstreams, sizeof (guint) * defs->n_ichannels);
+  source_class->channel_defs.ijstreams = (guint*) g_memdup (defs->ijstreams, sizeof (guint) * defs->n_ichannels);
   source_class->channel_defs.n_jstreams = defs->n_jstreams;
   /* dup ochannel arrays */
   source_class->channel_defs.n_ochannels = defs->n_ochannels;
-  source_class->channel_defs.ochannel_idents = g_memdup (defs->ochannel_idents, sizeof (gchar*) * defs->n_ochannels);
-  source_class->channel_defs.ochannel_labels = g_memdup (defs->ochannel_labels, sizeof (gchar*) * defs->n_ochannels);
-  source_class->channel_defs.ochannel_blurbs = g_memdup (defs->ochannel_blurbs, sizeof (gchar*) * defs->n_ochannels);
+  source_class->channel_defs.ochannel_idents = (char**) g_memdup (defs->ochannel_idents, sizeof (gchar*) * defs->n_ochannels);
+  source_class->channel_defs.ochannel_labels = (char**) g_memdup (defs->ochannel_labels, sizeof (gchar*) * defs->n_ochannels);
+  source_class->channel_defs.ochannel_blurbs = (char**) g_memdup (defs->ochannel_blurbs, sizeof (gchar*) * defs->n_ochannels);
   /* dup ochannel array contents */
   for (i = 0; i < defs->n_ochannels; i++)
     {
@@ -2022,8 +2019,7 @@ bse_source_class_init (BseSourceClass *klass)
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   BseObjectClass *object_class = BSE_OBJECT_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
-  
+  parent_class = (GTypeClass*) g_type_class_peek_parent (klass);
   gobject_class->set_property = bse_source_set_property;
   gobject_class->get_property = bse_source_get_property;
   gobject_class->dispose = bse_source_dispose;
diff --git a/bse/bsesource.h b/bse/bsesource.h
index 55d055c..90f5530 100644
--- a/bse/bsesource.h
+++ b/bse/bsesource.h
@@ -21,6 +21,7 @@
 
 #include <bse/bseitem.h>
 #include <bse/gsldefs.h>
+#include <sfi/gbsearcharray.h>
 
 G_BEGIN_DECLS
 
@@ -102,7 +103,7 @@ struct _BseSource
   BseSourceChannelDefs *channel_defs;
   BseSourceInput       *inputs;	/* [n_ichannels] */
   GSList	       *outputs;
-  gpointer		contexts; /* bsearch array of type BseSourceContext */
+  GBSearchArray        *contexts; /* bsearch array of type BseSourceContext */
   SfiReal		pos_x, pos_y;
   BseSourceProbes      *probes;
 };
diff --git a/bse/bsestandardosc.c b/bse/bsestandardosc.cc
similarity index 97%
rename from bse/bsestandardosc.c
rename to bse/bsestandardosc.cc
index 14f956b..09e21c5 100644
--- a/bse/bsestandardosc.c
+++ b/bse/bsestandardosc.cc
@@ -235,11 +235,11 @@ bse_standard_osc_set_property (GObject      *object,
 			       GParamSpec   *pspec)
 {
   BseStandardOsc *self = BSE_STANDARD_OSC (object);
-  
+
   switch (param_id)
     {
     case PROP_WAVE_FORM:
-      self->wave = g_value_get_enum (value);
+      self->wave = (BseStandardOscWaveType) g_value_get_enum (value);
       bse_standard_osc_update_modules (self, TRUE, NULL);
       break;
     case PROP_PHASE:
@@ -249,15 +249,15 @@ bse_standard_osc_set_property (GObject      *object,
     case PROP_BASE_FREQ:
       self->config.cfreq = sfi_value_get_real (value);
       bse_standard_osc_update_modules (self, FALSE, NULL);
-      g_object_notify (self, "base_note");
+      g_object_notify ((GObject*) self, "base_note");
       break;
     case PROP_BASE_NOTE:
       self->config.cfreq = bse_note_to_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), sfi_value_get_note (value));
       self->config.cfreq = MAX (self->config.cfreq, BSE_MIN_OSC_FREQUENCY);
       bse_standard_osc_update_modules (self, FALSE, NULL);
-      g_object_notify (self, "base_freq");
+      g_object_notify ((GObject*) self, "base_freq");
       if (bse_note_from_freq (bse_item_current_musical_tuning (BSE_ITEM (self)), self->config.cfreq) != sfi_value_get_note (value))
-	g_object_notify (self, "base_note");
+	g_object_notify ((GObject*) self, "base_note");
       break;
     case PROP_TRANSPOSE:
       self->transpose = sfi_value_get_int (value);
@@ -353,9 +353,9 @@ static void
 bse_standard_osc_prepare (BseSource *source)
 {
   BseStandardOsc *self = BSE_STANDARD_OSC (source);
-  
+
   self->config.table = gsl_osc_table_create (bse_engine_sample_freq (),
-					     self->wave,
+					     GslOscWaveForm (self->wave),
 					     bse_window_blackman,
 					     G_N_ELEMENTS (osc_table_freqs),
 					     osc_table_freqs);
@@ -375,18 +375,18 @@ static void
 standard_osc_access (BseModule *module,
 		     gpointer   data)
 {
-  GslOscData *osc = module->user_data;
-  OscConfigData *cdata = data;
-  
+  GslOscData *osc = (GslOscData*) module->user_data;
+  OscConfigData *cdata = (OscConfigData*) data;
+
   /* this runs in the Gsl Engine threads */
-  
+
   gsl_osc_config (osc, &cdata->config);
 }
 
 static void
 standard_osc_access_free (gpointer data)
 {
-  OscConfigData *cdata = data;
+  OscConfigData *cdata = (OscConfigData*) data;
   
   if (cdata->old_osc_table)
     gsl_osc_table_free (cdata->old_osc_table);
@@ -411,7 +411,7 @@ bse_standard_osc_update_modules (BseStandardOsc *self,
 	{
 	  cdata.old_osc_table = self->config.table;
 	  self->config.table = gsl_osc_table_create (bse_engine_sample_freq (),
-						     self->wave,
+						     GslOscWaveForm (self->wave),
 						     bse_window_blackman,
 						     G_N_ELEMENTS (osc_table_freqs),
 						     osc_table_freqs);
@@ -430,8 +430,8 @@ bse_standard_osc_update_modules (BseStandardOsc *self,
 static void
 standard_osc_reset (BseModule *module)
 {
-  GslOscData *osc = module->user_data;
-  
+  GslOscData *osc = (GslOscData*) module->user_data;
+
   gsl_osc_reset (osc);
 }
 
@@ -439,7 +439,7 @@ static void
 standard_osc_process (BseModule *module,
 		      guint      n_values)
 {
-  GslOscData *osc = module->user_data;
+  GslOscData *osc = (GslOscData*) module->user_data;
   const gfloat *freq_in = NULL;
   const gfloat *mod_in = NULL;
   const gfloat *sync_in = NULL;
diff --git a/bse/bsestandardsynths.c b/bse/bsestandardsynths.cc
similarity index 97%
rename from bse/bsestandardsynths.c
rename to bse/bsestandardsynths.cc
index 6f7e0ff..3eec674 100644
--- a/bse/bsestandardsynths.c
+++ b/bse/bsestandardsynths.cc
@@ -46,7 +46,7 @@ bse_zfile_uncompress (const BseZFile *zfile,
 {
   uLongf dlen = zfile->text_size;
   guint len = dlen + 1;
-  guint8 *text = g_malloc (len);
+  guint8 *text = (guint8*) g_malloc (len);
   gint result;
   const gchar *err;
 
@@ -85,7 +85,7 @@ bse_zfile_uncompress (const BseZFile *zfile,
   text[dlen] = 0;
   if (text_len)
     *text_len = dlen;
-  return text;
+  return (char*) text;
 }
 
 gchar*
diff --git a/bse/bsesubiport.c b/bse/bsesubiport.cc
similarity index 96%
rename from bse/bsesubiport.c
rename to bse/bsesubiport.cc
index 01d4950..28c8810 100644
--- a/bse/bsesubiport.c
+++ b/bse/bsesubiport.cc
@@ -182,12 +182,14 @@ bse_sub_iport_context_create (BseSource *source,
   if (!BSE_SOURCE_GET_CLASS (self)->engine_class)
     {
       BseModuleClass module_class = {
-        .n_istreams = BSE_SOURCE_N_OCHANNELS (self),
-        .n_jstreams = 0,
-        .n_ostreams = BSE_SOURCE_N_OCHANNELS (self),
-        .process = sub_iport_process,
-        .free = NULL,
-        .mflags = BSE_COST_CHEAP,
+        BSE_SOURCE_N_OCHANNELS (self),  // n_istreams
+        0,                              // n_jstreams
+        BSE_SOURCE_N_OCHANNELS (self),  // n_ostreams
+        sub_iport_process,              // process
+        NULL,                           // process_defer
+        NULL,                           // reset
+        NULL,                           // free
+        BSE_COST_CHEAP,                 // mflags
       };
       bse_source_class_cache_engine_class (BSE_SOURCE_GET_CLASS (self), &module_class);
     }
diff --git a/bse/bsesuboport.c b/bse/bsesuboport.cc
similarity index 96%
rename from bse/bsesuboport.c
rename to bse/bsesuboport.cc
index db93ca6..d8b7229 100644
--- a/bse/bsesuboport.c
+++ b/bse/bsesuboport.cc
@@ -184,12 +184,14 @@ bse_sub_oport_context_create (BseSource *source,
   if (!BSE_SOURCE_GET_CLASS (self)->engine_class)
     {
       BseModuleClass module_class = {
-        .n_istreams = BSE_SOURCE_N_ICHANNELS (self),
-        .n_jstreams = 0,
-        .n_ostreams = BSE_SOURCE_N_ICHANNELS (self),
-        .process = sub_oport_process,
-        .free = NULL,
-        .mflags = BSE_COST_CHEAP,
+        BSE_SOURCE_N_ICHANNELS (self),  // n_istreams
+        0,                              // n_jstreams
+        BSE_SOURCE_N_ICHANNELS (self),  // n_ostreams
+        sub_oport_process,              // process
+        NULL,                           // process_defer
+        NULL,                           // reset
+        NULL,                           // free
+        BSE_COST_CHEAP,                 // mflags
       };
       bse_source_class_cache_engine_class (BSE_SOURCE_GET_CLASS (self), &module_class);
     }
diff --git a/bse/bsesubsynth.c b/bse/bsesubsynth.cc
similarity index 98%
rename from bse/bsesubsynth.c
rename to bse/bsesubsynth.cc
index e811e6c..fa564d6 100644
--- a/bse/bsesubsynth.c
+++ b/bse/bsesubsynth.cc
@@ -223,7 +223,7 @@ bse_sub_synth_set_property (GObject      *object,
               bse_item_cross_unlink (BSE_ITEM (self), BSE_ITEM (self->snet), sub_synth_uncross_snet);
               self->snet = NULL;
             }
-	  self->snet = bse_value_get_object (value);
+	  self->snet = (BseSNet*) bse_value_get_object (value);
 	  if (self->snet)
             {
               bse_item_cross_link (BSE_ITEM (self), BSE_ITEM (self->snet), sub_synth_uncross_snet);
@@ -396,9 +396,9 @@ bse_sub_synth_context_connect (BseSource *source,
     {
       BseModule *imodule = bse_source_get_context_imodule (source, context_handle);
       BseModule *omodule = bse_source_get_context_omodule (source, context_handle);
-      ModData *mdata_in = imodule->user_data;
+      ModData *mdata_in = (ModData*) imodule->user_data;
       guint foreign_context_handle = mdata_in->synth_context_handle;
-      
+
       if (foreign_context_handle)
 	{
 	  bse_source_connect_context (BSE_SOURCE (snet), foreign_context_handle, trans);
@@ -424,9 +424,9 @@ bse_sub_synth_context_dismiss (BseSource *source,
   if (snet)
     {
       BseModule *imodule = bse_source_get_context_imodule (source, context_handle);
-      ModData *mdata_in = imodule->user_data;
+      ModData *mdata_in = (ModData*) imodule->user_data;
       guint i, foreign_context_handle = mdata_in->synth_context_handle;
-      
+
       if (foreign_context_handle)
 	{
 	  for (i = 0; i < BSE_SOURCE_N_ICHANNELS (self); i++)
@@ -460,9 +460,9 @@ bse_sub_synth_update_port_contexts (BseSubSynth *self,
     if (is_input)
       {
 	BseModule *imodule = bse_source_get_context_imodule (source, cids[i]);
-	ModData *mdata_in = imodule->user_data;
+	ModData *mdata_in = (ModData*) imodule->user_data;
 	guint foreign_context_handle = mdata_in->synth_context_handle;
-	
+
 	if (foreign_context_handle)
 	  {
 	    bse_snet_set_iport_src (snet, old_name, foreign_context_handle, NULL, port, trans);
@@ -472,9 +472,9 @@ bse_sub_synth_update_port_contexts (BseSubSynth *self,
     else
       {
 	BseModule *omodule = bse_source_get_context_omodule (source, cids[i]);
-	ModData *mdata_in = omodule->user_data;
+	ModData *mdata_in = (ModData*) omodule->user_data;
         guint foreign_context_handle = mdata_in->synth_context_handle;
-	
+
         if (foreign_context_handle)
 	  {
 	    bse_snet_set_oport_dest (snet, old_name, foreign_context_handle, NULL, port, trans);
diff --git a/bse/bsesuper.c b/bse/bsesuper.cc
similarity index 91%
rename from bse/bsesuper.c
rename to bse/bsesuper.cc
index 6b44c59..27a2550 100644
--- a/bse/bsesuper.c
+++ b/bse/bsesuper.cc
@@ -43,10 +43,6 @@ static void
 bse_super_init (BseSuper *super,
 		gpointer  rclass)
 {
-  BseObject *object;
-  
-  object = BSE_OBJECT (super);
-  
   super->creation_time = sfi_time_from_utc (sfi_time_system ());
   super->mod_time = super->creation_time;
   super->context_handle = ~0;
@@ -85,23 +81,23 @@ bse_super_set_property (GObject      *object,
   switch (param_id)
     {
     case PARAM_AUTHOR:
-      g_object_set_qdata_full (super,
+      g_object_set_qdata_full ((GObject*) super,
 			       quark_author,
 			       g_strdup (g_value_get_string (value)),
 			       g_free);
       break;
     case PARAM_LICENSE:
-      g_object_set_qdata_full (super,
+      g_object_set_qdata_full ((GObject*) super,
 			       quark_license,
 			       g_strdup (g_value_get_string (value)),
 			       g_free);
       break;
     case PARAM_COPYRIGHT:
-      if (g_object_get_qdata (super, quark_license) == NULL)
-        g_object_set_qdata_full (super, quark_license,
+      if (g_object_get_qdata ((GObject*) super, quark_license) == NULL)
+        g_object_set_qdata_full ((GObject*) super, quark_license,
                                  g_strdup (g_value_get_string (value)),
                                  g_free);
-      g_object_notify (super, "license");
+      g_object_notify ((GObject*) super, "license");
       break;
     case PARAM_MOD_TIME:
       super->mod_time = MAX (super->creation_time, sfi_value_get_time (value));
@@ -112,7 +108,7 @@ bse_super_set_property (GObject      *object,
       if (super->creation_time > super->mod_time)
 	{
 	  super->mod_time = super->creation_time;
-	  g_object_notify (super, "modification-time");
+	  g_object_notify ((GObject*) super, "modification-time");
 	}
       break;
     default:
@@ -131,10 +127,10 @@ bse_super_get_property (GObject     *object,
   switch (param_id)
     {
     case PARAM_AUTHOR:
-      g_value_set_string (value, g_object_get_qdata (super, quark_author));
+      g_value_set_string (value, (const char*) g_object_get_qdata ((GObject*) super, quark_author));
       break;
     case PARAM_LICENSE:
-      g_value_set_string (value, g_object_get_qdata (super, quark_license));
+      g_value_set_string (value, (const char*) g_object_get_qdata ((GObject*) super, quark_license));
       break;
     case PARAM_MOD_TIME:
       sfi_value_set_time (value, super->mod_time);
@@ -183,12 +179,11 @@ bse_super_class_init (BseSuperClass *klass)
   BseObjectClass *object_class = BSE_OBJECT_CLASS (klass);
   BseItemClass *item_class = BSE_ITEM_CLASS (klass);
   // BseSourceClass *source_class = BSE_SOURCE_CLASS (klass);
-  
-  parent_class = g_type_class_peek_parent (klass);
-  
+
+  parent_class = (GTypeClass*) g_type_class_peek_parent (klass);
   quark_author = g_quark_from_static_string ("author");
   quark_license = g_quark_from_static_string ("license");
-  
+
   gobject_class->set_property = bse_super_set_property;
   gobject_class->get_property = bse_super_get_property;
   gobject_class->finalize = bse_super_finalize;
diff --git a/bse/bsetrack.c b/bse/bsetrack.cc
similarity index 93%
rename from bse/bsetrack.c
rename to bse/bsetrack.cc
index 7c9a7a9..21022cc 100644
--- a/bse/bsetrack.c
+++ b/bse/bsetrack.cc
@@ -30,6 +30,7 @@
 #include "bsemidivoice.h"
 #include "bsemidireceiver.h"
 #include "bsewaverepo.h"
+#include "bsecxxplugin.hh"
 #include <string.h>
 
 static SFI_MSG_TYPE_DEFINE (debug_xref, "xref", SFI_MSG_DEBUG, NULL);
@@ -203,18 +204,15 @@ static void
 track_delete_entry (BseTrack *self,
 		    guint     index)
 {
-  guint n;
-  BsePart *part;
-
   g_return_if_fail (index < self->n_entries_SL);
 
-  part = self->entries_SL[index].part;
+  BsePart *part = self->entries_SL[index].part;
   bse_object_remove_reemit (part, "notify::last-tick", self, "changed");
   bse_object_unproxy_notifies (part, self, "changed");
   XREF_DEBUG ("cross-unlink: %p %p", self, part);
   bse_item_cross_unlink (BSE_ITEM (self), BSE_ITEM (part), track_uncross_part);
   BSE_SEQUENCER_LOCK ();
-  n = self->n_entries_SL--;
+  self->n_entries_SL -= 1;
   bse_id_free (self->entries_SL[index].id);
   g_memmove (self->entries_SL + index, self->entries_SL + index + 1, (self->n_entries_SL - index) * sizeof (self->entries_SL[0]));
   BSE_SEQUENCER_UNLOCK ();
@@ -301,7 +299,7 @@ bse_track_get_candidates (BseItem               *item,
       bse_bus_or_track_list_output_candidates (BSE_ITEM (self), pc->items);
       /* remove existing outputs */
       for (ring = self->bus_outputs; ring; ring = sfi_ring_walk (ring, self->bus_outputs))
-        bse_item_seq_remove (pc->items, ring->data);
+        bse_item_seq_remove (pc->items, (BseItem*) ring->data);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (self, param_id, pspec);
@@ -401,14 +399,14 @@ clear_snet_and_wave (BseTrack *self)
       bse_object_unproxy_notifies (self->snet, self, "changed");
       bse_item_cross_unlink (BSE_ITEM (self), BSE_ITEM (self->snet), track_uncross_snet);
       self->snet = NULL;
-      g_object_notify (self, "snet");
+      g_object_notify ((GObject*) self, "snet");
     }
   if (self->wave)
     {
       bse_object_unproxy_notifies (self->wave, self, "changed");
       bse_item_cross_unlink (BSE_ITEM (self), BSE_ITEM (self->wave), track_uncross_wave);
       self->wave = NULL;
-      g_object_notify (self, "wave");
+      g_object_notify ((GObject*) self, "wave");
     }
   if (self->wnet)
     {
@@ -438,7 +436,7 @@ bse_track_set_property (GObject      *object,
     case PROP_SNET:
       if (!self->sub_synth || !BSE_SOURCE_PREPARED (self))
 	{
-	  BseSNet *snet = bse_value_get_object (value);
+	  BseSNet *snet = (BseSNet*) bse_value_get_object (value);
 	  if (snet || self->snet)
 	    {
 	      clear_snet_and_wave (self);
@@ -458,7 +456,7 @@ bse_track_set_property (GObject      *object,
     case PROP_WAVE:
       if (!self->sub_synth || !BSE_SOURCE_PREPARED (self->sub_synth))
 	{
-	  BseWave *wave = bse_value_get_object (value);
+	  BseWave *wave = (BseWave*) bse_value_get_object (value);
 	  if (wave || self->wave)
 	    {
 	      clear_snet_and_wave (self);
@@ -494,7 +492,7 @@ bse_track_set_property (GObject      *object,
               bse_item_cross_unlink (BSE_ITEM (self), BSE_ITEM (self->pnet), track_uncross_pnet);
               self->pnet = NULL;
             }
-          self->pnet = bse_value_get_object (value);
+          self->pnet = (BseSNet*) bse_value_get_object (value);
           if (self->pnet)
             {
               bse_item_cross_link (BSE_ITEM (self), BSE_ITEM (self->pnet), track_uncross_pnet);
@@ -507,7 +505,7 @@ bse_track_set_property (GObject      *object,
 	}
       break;
     case PROP_OUTPUTS:
-      bse_bus_or_track_set_outputs (BSE_ITEM (self), g_value_get_boxed (value));
+      bse_bus_or_track_set_outputs (BSE_ITEM (self), (BseItemSeq*) g_value_get_boxed (value));
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (self, param_id, pspec);
@@ -539,7 +537,7 @@ bse_track_get_property (GObject    *object,
     case PROP_OUTPUTS:
       iseq = bse_item_seq_new();
       for (ring = self->bus_outputs; ring; ring = sfi_ring_walk (ring, self->bus_outputs))
-        bse_item_seq_append (iseq, ring->data);
+        bse_item_seq_append (iseq, (BseItem*) ring->data);
       g_value_take_boxed (value, iseq);
       break;
     case PROP_WAVE:
@@ -734,21 +732,21 @@ bse_track_add_modules (BseTrack        *self,
   g_return_if_fail (midi_receiver != NULL);
 
   /* midi voice input */
-  self->voice_input = bse_container_new_child (container, BSE_TYPE_MIDI_VOICE_INPUT, NULL);
+  self->voice_input = (BseSource*) bse_container_new_child (container, BSE_TYPE_MIDI_VOICE_INPUT, NULL);
   bse_item_set_internal (self->voice_input, TRUE);
   
   /* sub synth */
-  self->sub_synth = bse_container_new_child_bname (container, BSE_TYPE_SUB_SYNTH, "Track-Instrument",
-                                                   "in_port_1", "frequency",
-                                                   "in_port_2", "gate",
-                                                   "in_port_3", "velocity",
-                                                   "in_port_4", "aftertouch",
-                                                   "out_port_1", "left-audio",
-                                                   "out_port_2", "right-audio",
-                                                   "out_port_3", "unused",
-                                                   "out_port_4", "synth-done",
-                                                   "snet", self->snet,
-                                                   NULL);
+  self->sub_synth = (BseSource*) bse_container_new_child_bname (container, BSE_TYPE_SUB_SYNTH, "Track-Instrument",
+                                                                "in_port_1", "frequency",
+                                                                "in_port_2", "gate",
+                                                                "in_port_3", "velocity",
+                                                                "in_port_4", "aftertouch",
+                                                                "out_port_1", "left-audio",
+                                                                "out_port_2", "right-audio",
+                                                                "out_port_3", "unused",
+                                                                "out_port_4", "synth-done",
+                                                                "snet", self->snet,
+                                                                NULL);
   bse_item_set_internal (self->sub_synth, TRUE);
   
   /* voice input <-> sub-synth */
@@ -760,9 +758,9 @@ bse_track_add_modules (BseTrack        *self,
 			     self->voice_input, BSE_MIDI_VOICE_INPUT_OCHANNEL_VELOCITY);
   bse_source_must_set_input (self->sub_synth, 3,
 			     self->voice_input, BSE_MIDI_VOICE_INPUT_OCHANNEL_AFTERTOUCH);
-  
+
   /* midi voice switch */
-  self->voice_switch = bse_container_new_child (container, BSE_TYPE_MIDI_VOICE_SWITCH, NULL);
+  self->voice_switch = (BseSource*) bse_container_new_child (container, BSE_TYPE_MIDI_VOICE_SWITCH, NULL);
   bse_item_set_internal (self->voice_switch, TRUE);
   bse_midi_voice_input_set_voice_switch (BSE_MIDI_VOICE_INPUT (self->voice_input), BSE_MIDI_VOICE_SWITCH (self->voice_switch));
 
@@ -773,18 +771,18 @@ bse_track_add_modules (BseTrack        *self,
 			     self->sub_synth, 1);
   bse_source_must_set_input (self->voice_switch, BSE_MIDI_VOICE_SWITCH_ICHANNEL_DISCONNECT,
 			     self->sub_synth, 3);
-  
+
   /* midi voice switch <-> context merger */
   bse_source_must_set_input (BSE_SOURCE (self), 0,
 			     self->voice_switch, BSE_MIDI_VOICE_SWITCH_OCHANNEL_LEFT);
   bse_source_must_set_input (BSE_SOURCE (self), 1,
 			     self->voice_switch, BSE_MIDI_VOICE_SWITCH_OCHANNEL_RIGHT);
-  
+
   /* postprocess */
-  self->postprocess = bse_container_new_child_bname (container, BSE_TYPE_SUB_SYNTH, "Track-Postprocess", NULL);
+  self->postprocess = (BseSource*) bse_container_new_child_bname (container, BSE_TYPE_SUB_SYNTH, "Track-Postprocess", NULL);
   bse_item_set_internal (self->postprocess, TRUE);
   bse_sub_synth_set_null_shortcut (BSE_SUB_SYNTH (self->postprocess), TRUE);
-  
+
   /* context merger <-> postprocess */
   bse_source_must_set_input (self->postprocess, 0, BSE_SOURCE (self), 0);
   bse_source_must_set_input (self->postprocess, 1, BSE_SOURCE (self), 1);
@@ -939,7 +937,7 @@ part_link_resolved (gpointer        data,
   BseTrack *self = BSE_TRACK (from_item);
 
   if (error)
-    bse_storage_warn (storage, error);
+    bse_storage_warn (storage, "%s", error);
   else if (!BSE_IS_PART (to_item))
     bse_storage_warn (storage, "skipping invalid part reference: %s", bse_object_debug_name (to_item));
   else if (to_item->parent != from_item->parent)
@@ -965,16 +963,16 @@ bse_track_restore_private (BseObject  *object,
     {
       GTokenType token;
       guint tick;
-      
+
       g_scanner_get_next_token (scanner);       /* eat quark */
-      
+
       parse_or_return (scanner, G_TOKEN_INT);
       tick = scanner->value.v_int64;
       token = bse_storage_parse_item_link (storage, BSE_ITEM (self), part_link_resolved, GUINT_TO_POINTER (tick));
       if (token != G_TOKEN_NONE)
-	return token;
+	return SfiTokenType (token);
       parse_or_return (scanner, ')');
-      return G_TOKEN_NONE;
+      return SFI_TOKEN_NONE;
     }
   else /* chain parent class' handler */
     return BSE_OBJECT_CLASS (parent_class)->restore_private (object, storage, scanner);
@@ -987,9 +985,9 @@ bse_track_class_init (BseTrackClass *klass)
   BseObjectClass *object_class = BSE_OBJECT_CLASS (klass);
   BseItemClass *item_class = BSE_ITEM_CLASS (klass);
   BseSourceClass *source_class = BSE_SOURCE_CLASS (klass);
-  
-  parent_class = g_type_class_peek_parent (klass);
-  
+
+  parent_class = (GTypeClass*) g_type_class_peek_parent (klass);
+
   gobject_class->set_property = bse_track_set_property;
   gobject_class->get_property = bse_track_get_property;
   gobject_class->dispose = bse_track_dispose;
diff --git a/bse/bsetype.c b/bse/bsetype.cc
similarity index 87%
rename from bse/bsetype.c
rename to bse/bsetype.cc
index 9c091ff..3e3bcd4 100644
--- a/bse/bsetype.c
+++ b/bse/bsetype.cc
@@ -33,10 +33,10 @@ GType bse_type_id_packed_pointer = 0;
 
 
 /* --- functions --- */
-const gchar*
+const char*
 bse_type_get_options (GType   type)
 {
-  return g_type_get_qdata (type, quark_options);
+  return (const char*) g_type_get_qdata (type, quark_options);
 }
 
 void
@@ -50,19 +50,19 @@ bse_type_add_options (GType        type,
 const gchar*
 bse_type_get_blurb (GType   type)
 {
-  return g_type_get_qdata (type, quark_blurb);
+  return (const char*) g_type_get_qdata (type, quark_blurb);
 }
 
 const gchar*
 bse_type_get_file (GType   type)
 {
-  return g_type_get_qdata (type, quark_loc_file);
+  return (const char*) g_type_get_qdata (type, quark_loc_file);
 }
 
 guint
 bse_type_get_line (GType   type)
 {
-  return (guint) g_type_get_qdata (type, quark_loc_line);
+  return (size_t) g_type_get_qdata (type, quark_loc_line);
 }
 
 void
@@ -74,13 +74,13 @@ bse_type_add_blurb (GType        type,
   g_return_if_fail (bse_type_get_blurb (type) == NULL);
   g_type_set_qdata (type, quark_blurb, g_strdup (blurb));
   g_type_set_qdata (type, quark_loc_file, g_strdup (file));
-  g_type_set_qdata (type, quark_loc_line, (gpointer) line);
+  g_type_set_qdata (type, quark_loc_line, (void*) size_t (line));
 }
 
 const gchar*
 bse_type_get_authors (GType   type)
 {
-  return g_type_get_qdata (type, quark_authors);
+  return (const char*) g_type_get_qdata (type, quark_authors);
 }
 
 void
@@ -94,7 +94,7 @@ bse_type_add_authors (GType        type,
 const gchar*
 bse_type_get_license (GType   type)
 {
-  return g_type_get_qdata (type, quark_license);
+  return (const char*) g_type_get_qdata (type, quark_license);
 }
 
 void
@@ -125,7 +125,7 @@ bse_type_register_static (GType            parent_type,
       info = &tmp_info;
     }
 
-  const GType type = g_type_register_static (parent_type, type_name, info, 0);
+  const GType type = g_type_register_static (parent_type, type_name, info, GTypeFlags (0));
   bse_type_add_blurb (type, type_blurb, file, line);
 
   return type;
@@ -161,7 +161,7 @@ bse_type_register_dynamic (GType        parent_type,
 			   const gchar *type_name,
 			   GTypePlugin *plugin)
 {
-  GType type = g_type_register_dynamic (parent_type, type_name, plugin, 0);
+  GType type = g_type_register_dynamic (parent_type, type_name, plugin, GTypeFlags (0));
   return type;
 }
 
@@ -176,7 +176,7 @@ bse_boxed_value_free (GValue *value)
 {
   if (value->data[0].v_pointer && !(value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS))
     {
-      BseExportNodeBoxed *bnode = g_type_get_qdata (G_VALUE_TYPE (value), quark_boxed_export_node);
+      BseExportNodeBoxed *bnode = (BseExportNodeBoxed*) g_type_get_qdata (G_VALUE_TYPE (value), quark_boxed_export_node);
       if (bnode)
         bnode->free (value->data[0].v_pointer);
       else
@@ -191,7 +191,7 @@ bse_boxed_value_copy (const GValue *src_value,
   dest_value->data[0].v_pointer = NULL;
   if (src_value->data[0].v_pointer)
     {
-      BseExportNodeBoxed *bnode = g_type_get_qdata (G_VALUE_TYPE (src_value), quark_boxed_export_node);
+      BseExportNodeBoxed *bnode = (BseExportNodeBoxed*) g_type_get_qdata (G_VALUE_TYPE (src_value), quark_boxed_export_node);
       if (bnode)
         dest_value->data[0].v_pointer = bnode->copy (src_value->data[0].v_pointer);
       else
@@ -222,7 +222,7 @@ bse_boxed_collect_value (GValue      *value,
         }
       else
         {
-          BseExportNodeBoxed *bnode = g_type_get_qdata (G_VALUE_TYPE (value), quark_boxed_export_node);
+          BseExportNodeBoxed *bnode = (BseExportNodeBoxed*) g_type_get_qdata (G_VALUE_TYPE (value), quark_boxed_export_node);
           if (bnode)
             value->data[0].v_pointer = bnode->copy (collect_values[0].v_pointer);
           else
@@ -238,7 +238,7 @@ bse_boxed_lcopy_value (const GValue *value,
                        GTypeCValue  *collect_values,
                        guint         collect_flags)
 {
-  gpointer *boxed_p = collect_values[0].v_pointer;
+  gpointer *boxed_p = (void**) collect_values[0].v_pointer;
   if (!boxed_p)
     return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
   if (!value->data[0].v_pointer)
@@ -247,7 +247,7 @@ bse_boxed_lcopy_value (const GValue *value,
     *boxed_p = value->data[0].v_pointer;
   else
     {
-      BseExportNodeBoxed *bnode = g_type_get_qdata (G_VALUE_TYPE (value), quark_boxed_export_node);
+      BseExportNodeBoxed *bnode = (BseExportNodeBoxed*) g_type_get_qdata (G_VALUE_TYPE (value), quark_boxed_export_node);
       if (bnode)
         *boxed_p = bnode->copy (value->data[0].v_pointer);
       else
@@ -260,7 +260,7 @@ static void
 bse_boxed_to_record (const GValue *src_value,
                      GValue       *dest_value)
 {
-  BseExportNodeBoxed *bnode = g_type_get_qdata (G_VALUE_TYPE (src_value), quark_boxed_export_node);
+  BseExportNodeBoxed *bnode = (BseExportNodeBoxed*) g_type_get_qdata (G_VALUE_TYPE (src_value), quark_boxed_export_node);
   if (bnode)
     bnode->boxed2recseq (src_value, dest_value);
   else
@@ -271,7 +271,7 @@ static void
 bse_boxed_from_record (const GValue *src_value,
                        GValue       *dest_value)
 {
-  BseExportNodeBoxed *bnode = g_type_get_qdata (G_VALUE_TYPE (dest_value), quark_boxed_export_node);
+  BseExportNodeBoxed *bnode = (BseExportNodeBoxed*) g_type_get_qdata (G_VALUE_TYPE (dest_value), quark_boxed_export_node);
   if (bnode)
     bnode->seqrec2boxed (src_value, dest_value);
   else
@@ -287,9 +287,9 @@ bse_type_register_loadable_boxed (BseExportNodeBoxed *bnode,
     bse_boxed_value_free,
     bse_boxed_value_copy,
     bse_boxed_value_peek_pointer,
-    "p",
+    (gchar*) "p",
     bse_boxed_collect_value,
-    "p",
+    (gchar*) "p",
     bse_boxed_lcopy_value,
   };
   static const GTypeInfo info = {
@@ -310,8 +310,8 @@ bse_type_register_loadable_boxed (BseExportNodeBoxed *bnode,
   g_return_val_if_fail (bnode->free != NULL, 0);
   g_return_val_if_fail (bnode->node.ntype == BSE_EXPORT_NODE_RECORD || bnode->node.ntype == BSE_EXPORT_NODE_SEQUENCE, 0);
   g_return_val_if_fail (g_type_from_name (bnode->node.name) == 0, 0);
-  
-  type = g_type_register_static (G_TYPE_BOXED, bnode->node.name, &info, 0);
+
+  type = g_type_register_static (G_TYPE_BOXED, bnode->node.name, &info, GTypeFlags (0));
   if (bnode->boxed2recseq)
     g_value_register_transform_func (type,
                                      bnode->node.ntype == BSE_EXPORT_NODE_RECORD
@@ -381,13 +381,13 @@ bse_param_spec_enum (const gchar    *name,
    */
   if (default_value == 0)
     {
-      GEnumClass *enum_class = g_type_class_ref (enum_type);
+      GEnumClass *enum_class = (GEnumClass*) g_type_class_ref (enum_type);
       if (!g_enum_get_value (enum_class, default_value))
         default_value = enum_class->values[0].value;
       g_type_class_unref (enum_class);
     }
 
-  pspec = g_param_spec_enum (name, NULL_CHECKED (nick), NULL_CHECKED (blurb), enum_type, default_value, 0);
+  pspec = g_param_spec_enum (name, NULL_CHECKED (nick), NULL_CHECKED (blurb), enum_type, default_value, GParamFlags (0));
   sfi_pspec_set_options (pspec, hints);
 
   return pspec;
@@ -399,13 +399,6 @@ bse_param_spec_enum (const gchar    *name,
 #include        "bsegentypes.c"
 
 
-/* --- type initializations --- */
-/* FIXME: extern decls for other *.h files that implement fundamentals */
-extern void     bse_type_register_procedure_info        (GTypeInfo    *info);
-extern void     bse_type_register_object_info           (GTypeInfo    *info);
-extern void     bse_type_register_enums                 (void);
-extern void     bse_param_types_init			(void);
-
 void
 bse_type_init (void)
 {
@@ -414,11 +407,10 @@ bse_type_init (void)
     GType   *const type_p;
     GType   (*register_type) (void);
   } builtin_types[] = {
-    /* include class type id builtin variable declarations */
-#include "bsegentype_array.c"
+#include "bsegentype_array.c"   // include class type id builtin variable declarations
   };
   const guint n_builtin_types = sizeof (builtin_types) / sizeof (builtin_types[0]);
-  static GTypeFundamentalInfo finfo = { 0, };
+  static GTypeFundamentalInfo finfo = { GTypeFundamentalFlags (0), };
   guint i;
   
   g_return_if_fail (quark_blurb == 0);
@@ -443,17 +435,17 @@ bse_type_init (void)
   /* BSE_TYPE_PROCEDURE
    */
   memset (&finfo, 0, sizeof (finfo));
-  finfo.type_flags = G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_DERIVABLE;
+  finfo.type_flags = GTypeFundamentalFlags (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_DERIVABLE);
   memset (&info, 0, sizeof (info));
   bse_type_register_procedure_info (&info);
-  g_type_register_fundamental (BSE_TYPE_PROCEDURE, "BseProcedure", &info, &finfo, 0);
+  g_type_register_fundamental (BSE_TYPE_PROCEDURE, "BseProcedure", &info, &finfo, GTypeFlags (0));
   bse_type_add_blurb (BSE_TYPE_PROCEDURE, "BSE Procedure base type", __FILE__, __LINE__);
   g_assert (BSE_TYPE_PROCEDURE == g_type_from_name ("BseProcedure"));
 
   /* initialize extra types */
   {
     static const GTypeInfo dummy = { 0, };
-    bse_type_id_packed_pointer = g_type_register_static (G_TYPE_STRING, "BseTypePackedPointer", &dummy, 0);
+    bse_type_id_packed_pointer = g_type_register_static (G_TYPE_STRING, "BseTypePackedPointer", &dummy, GTypeFlags (0));
   }
 
   /* initialize builtin class types */
diff --git a/bse/bsetype.h b/bse/bsetype.h
index 562f8e2..4799251 100644
--- a/bse/bsetype.h
+++ b/bse/bsetype.h
@@ -84,8 +84,7 @@ void         bse_type_uninit_boxed              (BseExportNodeBoxed *bnode);
 #define	BSE_TYPE_ID(BseTypeName)	(bse_type_builtin_id_##BseTypeName)
 #ifdef BSE_COMPILATION
 #  define BSE_BUILTIN_PROTO(BseTypeName) GType bse_type_builtin_register_##BseTypeName (void)
-#  define BSE_BUILTIN_TYPE(BseTypeName)	 EXTERN_C BSE_BUILTIN_PROTO (BseTypeName); \
-                                         EXTERN_C GType bse_type_builtin_register_##BseTypeName (void)
+#  define BSE_BUILTIN_TYPE(BseTypeName)	 EXTERN_C BSE_BUILTIN_PROTO (BseTypeName); EXTERN_C BSE_BUILTIN_PROTO (BseTypeName)
 #  define BSE_DUMMY_TYPE(BseTypeName)	 EXTERN_C BSE_BUILTIN_PROTO (BseTypeName) { return 0; } \
                                          EXTERN_C BSE_BUILTIN_PROTO (BseTypeName)
 #endif /* BSE_COMPILATION */
@@ -99,6 +98,11 @@ GParamSpec*     bse_param_spec_enum (const gchar    *name,
                                      GType           enum_type,
                                      const gchar    *hints);
 
+// == type initializers ==
+void    bse_type_register_enums                 ();
+void    bse_type_register_procedure_info        (GTypeInfo *info);
+void    bse_type_register_object_info           (GTypeInfo *info);
+void    bse_param_types_init			();
 
 /* -- auto generated type ids --- */
 #include        <bse/bsegentypes.h>
diff --git a/bse/bsewave.c b/bse/bsewave.cc
similarity index 94%
rename from bse/bsewave.c
rename to bse/bsewave.cc
index bc60db5..7644bee 100644
--- a/bse/bsewave.c
+++ b/bse/bsewave.cc
@@ -173,8 +173,7 @@ bse_wave_lookup_chunk (BseWave *wave,
 }
 
 void
-bse_wave_remove_chunk (BseWave      *wave,
-		       GslWaveChunk *wchunk)
+bse_wave_remove_chunk (BseWave *wave, GslWaveChunk *wchunk)
 {
   g_return_if_fail (BSE_IS_WAVE (wave));
   g_return_if_fail (wchunk != NULL);
@@ -200,8 +199,8 @@ wchunk_cmp (gconstpointer a,
 	    gconstpointer b,
             gpointer      data)
 {
-  const GslWaveChunk *w1 = a;
-  const GslWaveChunk *w2 = b;
+  const GslWaveChunk *w1 = (const GslWaveChunk*) a;
+  const GslWaveChunk *w2 = (const GslWaveChunk*) b;
   
   return w1->osc_freq < w2->osc_freq ? -1 : w1->osc_freq > w2->osc_freq;
 }
@@ -247,9 +246,9 @@ bse_wave_clear (BseWave *wave)
 
   /* delete all wave chunks */
   while (wave->wave_chunks)
-    bse_wave_remove_chunk (wave, wave->wave_chunks->data);
+    bse_wave_remove_chunk (wave, (GslWaveChunk*) wave->wave_chunks->data);
   while (wave->open_handles)
-    gsl_data_handle_close (sfi_ring_pop_head (&wave->open_handles));
+    gsl_data_handle_close ((GslDataHandle*) sfi_ring_pop_head (&wave->open_handles));
 
   /* free fields */
   g_free (wave->file_name);
@@ -289,7 +288,7 @@ bse_wave_load_wave_file (BseWave      *self,
 
       for (walk = files; walk; walk = sfi_ring_walk (files, walk))
 	{
-	  char *fname = walk->data;
+          char *fname = (char*) walk->data;
 	  if (!fi)
 	    fi = bse_wave_file_info_load (fname, &error);
 	  g_free (fname);
@@ -386,7 +385,7 @@ bse_wave_store_private (BseObject  *object,
       SfiRing *ring;
       for (ring = wave->wave_chunks; ring; ring = sfi_ring_walk (ring, wave->wave_chunks))
         {
-          GslWaveChunk *wchunk = ring->data;
+          GslWaveChunk *wchunk = (GslWaveChunk*) ring->data;
           BseErrorType error = gsl_data_handle_open (wchunk->dcache->dhandle);
           if (error)
             {
@@ -438,38 +437,38 @@ parse_wave_chunk (BseWave         *wave,
       pwchunk->xinfos = NULL;
       GTokenType token = bse_storage_parse_xinfos (storage, &pwchunk->xinfos);
       if (token != G_TOKEN_NONE)
-        return token;
+        return SfiTokenType (token);
     }
   else if (bse_storage_match_data_handle (storage, quark))
     {
       guint expected_token;
       if (pwchunk->data_handle)
-	return bse_storage_warn_skip (storage, "duplicate wave data reference");
+	return (SfiTokenType) bse_storage_warn_skip (storage, "duplicate wave data reference");
       expected_token = bse_storage_parse_data_handle_rest (storage,
                                                            &pwchunk->data_handle,
                                                            &pwchunk->wh_n_channels,
                                                            &pwchunk->wh_mix_freq,
                                                            &pwchunk->wh_osc_freq);
       if (expected_token != G_TOKEN_NONE)
-	return expected_token;
+	return SfiTokenType (expected_token);
       if (!pwchunk->data_handle)
         bse_storage_warn (storage, "invalid wave data reference");
       /* closing brace already parsed by bse_storage_parse_data_handle_rest() */
-      return G_TOKEN_NONE;
+      return SFI_TOKEN_NONE;
     }
   else if (BSE_STORAGE_COMPAT (storage, 0, 5, 1) && quark == quark_wave_handle)
     {
       guint expected_token;
       g_scanner_get_next_token (scanner); /* eat identifier */
       if (pwchunk->data_handle)
-	return bse_storage_warn_skip (storage, "duplicate wave data reference");
+	return (SfiTokenType) bse_storage_warn_skip (storage, "duplicate wave data reference");
       expected_token = bse_storage_parse_data_handle (storage,
                                                       &pwchunk->data_handle,
                                                       &pwchunk->wh_n_channels,
                                                       &pwchunk->wh_mix_freq,
                                                       &pwchunk->wh_osc_freq);
       if (expected_token != G_TOKEN_NONE)
-	return expected_token;
+	return SfiTokenType (expected_token);
       if (!pwchunk->data_handle)
         bse_storage_warn (storage, "invalid wave data reference");
     }
@@ -495,7 +494,7 @@ parse_wave_chunk (BseWave         *wave,
     }
   else
     return SFI_TOKEN_UNMATCHED;
-  return g_scanner_get_next_token (scanner) == ')' ? G_TOKEN_NONE : ')';
+  return g_scanner_get_next_token (scanner) == ')' ? SFI_TOKEN_NONE : SfiTokenType (')');
 }
 
 static SfiTokenType
@@ -519,7 +518,7 @@ bse_wave_restore_private (BseObject  *object,
       gchar **xinfos = NULL;
       GTokenType token = bse_storage_parse_xinfos (storage, &xinfos);
       if (token != G_TOKEN_NONE)
-        return token;
+        return SfiTokenType (token);
       guint i = 0;
       for (i = 0; xinfos && xinfos[i]; i++)
         wave->xinfos = bse_xinfos_parse_assignment (wave->xinfos, xinfos[i]);
@@ -539,7 +538,7 @@ bse_wave_restore_private (BseObject  *object,
       if (g_scanner_get_next_token (scanner) != G_TOKEN_STRING)
 	{
 	  g_free (file_name);
-	  return G_TOKEN_STRING;
+	  return SfiTokenType (G_TOKEN_STRING);
 	}
       wave_name = g_strdup (scanner->value.v_string);
       skip_list = bse_freq_array_new (1024);
@@ -574,7 +573,7 @@ bse_wave_restore_private (BseObject  *object,
               }
             else
               {
-                expected_token = ')';
+                expected_token = GTokenType (')');
                 goto out_of_load_wave;
               }
           }
@@ -601,14 +600,14 @@ bse_wave_restore_private (BseObject  *object,
       if (g_scanner_get_next_token (scanner) != G_TOKEN_STRING)
 	{
 	  g_free (file_name);
-	  return G_TOKEN_STRING;
+	  return SfiTokenType (G_TOKEN_STRING);
 	}
       gchar *wave_name = g_strdup (scanner->value.v_string);
       if (g_scanner_get_next_token (scanner) != ')')
 	{
 	  g_free (file_name);
 	  g_free (wave_name);
-	  return ')';
+	  return SfiTokenType (')');
 	}
       // g_print ("set-locator \"%s\" \"%s\"\n", file_name, wave_name);
       bse_wave_set_locator (wave, file_name, wave_name);
@@ -688,9 +687,9 @@ bse_wave_restore_private (BseObject  *object,
       g_strfreev (parsed_wchunk.xinfos);
     }
   else /* chain parent class' handler */
-    expected_token = BSE_OBJECT_CLASS (parent_class)->restore_private (object, storage, scanner);
-  
-  return expected_token;
+    expected_token = (GTokenType) BSE_OBJECT_CLASS (parent_class)->restore_private (object, storage, scanner);
+
+  return SfiTokenType (expected_token);
 }
 
 void
@@ -708,20 +707,20 @@ bse_wave_get_index_for_modules (BseWave *wave)
 {
   g_return_val_if_fail (BSE_IS_WAVE (wave), NULL);
   g_return_val_if_fail (wave->request_count > 0, NULL);
-  
+
   if (!wave->n_wchunks)
     return NULL;
   if (wave->index_dirty || !wave->index_list)
     {
-      BseWaveIndex *index = g_malloc (sizeof (BseWaveIndex) + sizeof (index->entries[0]) * (wave->n_wchunks - 1));
+      BseWaveIndex *index = (BseWaveIndex*) g_malloc (sizeof (BseWaveIndex) + sizeof (index->entries[0]) * (wave->n_wchunks - 1));
       index->n_entries = 0;
       SfiRing *ring;
       for (ring = wave->wave_chunks; ring; ring = sfi_ring_walk (ring, wave->wave_chunks))
 	{
-	  BseErrorType error = gsl_wave_chunk_open (ring->data);
+	  BseErrorType error = gsl_wave_chunk_open ((GslWaveChunk*) ring->data);
 	  if (!error)
             {
-              index->entries[index->n_entries].wchunk = ring->data;
+              index->entries[index->n_entries].wchunk = (GslWaveChunk*) ring->data;
               index->entries[index->n_entries].osc_freq = index->entries[index->n_entries].wchunk->osc_freq;
               index->entries[index->n_entries].velocity = 1; // FIXME: velocity=1 hardcoded
               index->n_entries++;
@@ -731,7 +730,7 @@ bse_wave_get_index_for_modules (BseWave *wave)
       // FIXME: add dummy wave chunk if none was opened succesfully?
       wave->index_dirty = FALSE;
     }
-  return wave->index_list->data;
+  return (BseWaveIndex*) wave->index_list->data;
 }
 
 void
@@ -739,17 +738,16 @@ bse_wave_drop_index (BseWave *wave)
 {
   g_return_if_fail (BSE_IS_WAVE (wave));
   g_return_if_fail (wave->request_count > 0);
-  
+
   wave->request_count--;
   if (!wave->request_count)
     {
       while (wave->index_list)
 	{
 	  GSList *tmp = wave->index_list->next;
-	  BseWaveIndex *index = wave->index_list->data;
-	  guint i;
-	  
-	  for (i = 0; i < index->n_entries; i++)
+	  BseWaveIndex *index = (BseWaveIndex*) wave->index_list->data;
+
+	  for (uint i = 0; i < index->n_entries; i++)
 	    gsl_wave_chunk_close (index->entries[i].wchunk);
 	  g_free (index);
 	  g_slist_free_1 (wave->index_list);
@@ -817,9 +815,9 @@ bse_wave_class_init (BseWaveClass *klass)
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   BseObjectClass *object_class = BSE_OBJECT_CLASS (klass);
   BseItemClass *item_class = BSE_ITEM_CLASS (klass);
-  
-  parent_class = g_type_class_peek_parent (klass);
-  
+
+  parent_class = (GTypeClass*) g_type_class_peek_parent (klass);
+
   gobject_class->set_property = bse_wave_set_property;
   gobject_class->get_property = bse_wave_get_property;
   gobject_class->dispose = bse_wave_dispose;
diff --git a/bse/bsewaveosc.c b/bse/bsewaveosc.cc
similarity index 95%
rename from bse/bsewaveosc.c
rename to bse/bsewaveosc.cc
index 8ba2a66..c1156dd 100644
--- a/bse/bsewaveosc.c
+++ b/bse/bsewaveosc.cc
@@ -166,7 +166,7 @@ clear_wave_and_esample (BseWaveOsc *self)
           bse_engine_wait_on_trans ();
         }
       bse_wave_drop_index (wave);
-      g_object_notify (self, "wave");
+      g_object_notify ((GObject*) self, "wave");
     }
 
   if (self->esample_wchunk)
@@ -220,7 +220,7 @@ bse_wave_osc_set_property (GObject      *object,
     {
       BseWave *wave;
     case PARAM_WAVE:
-      wave = bse_value_get_object (value);
+      wave = (BseWave*) bse_value_get_object (value);
       if (wave != self->wave)
         {
           clear_wave_and_esample (self);
@@ -335,8 +335,8 @@ static void
 wosc_access (BseModule *module,
              gpointer   data)
 {
-  GslWaveOscData *wosc = module->user_data;
-  GslWaveOscConfig *config = data;
+  GslWaveOscData *wosc = (GslWaveOscData*) module->user_data;
+  GslWaveOscConfig *config = (GslWaveOscConfig*) data;
   
   /* this runs in the Gsl Engine threads */
   
@@ -348,7 +348,14 @@ wchunk_from_data (gpointer wchunk_data,
                   gfloat   freq,
                   gfloat   velocity)
 {
-  return wchunk_data;
+  return (GslWaveChunk*) wchunk_data;
+}
+
+static inline GslWaveChunk*
+wave_index_lookup_best (void *data, float freq, float vel)
+{
+  BseWaveIndex *wave = (BseWaveIndex*) data;
+  return bse_wave_index_lookup_best (wave, freq, vel);
 }
 
 static void
@@ -361,7 +368,7 @@ bse_wave_osc_update_config_wchunk (BseWaveOsc *self)
       BseWaveIndex *index = bse_wave_get_index_for_modules (self->wave);
       self->config.wchunk_data = index && index->n_entries ? index : NULL;
       if (self->config.wchunk_data)
-        self->config.lookup_wchunk = (gpointer) bse_wave_index_lookup_best;
+        self->config.lookup_wchunk = wave_index_lookup_best;
     }
   else if (self->esample_wchunk)
     {
@@ -385,8 +392,7 @@ static void
 wosc_free (gpointer        data,
            const BseModuleClass *klass)
 {
-  GslWaveOscData *wosc = data;
-  
+  GslWaveOscData *wosc = (GslWaveOscData*) data;
   gsl_wave_osc_shutdown (wosc);
   g_free (wosc);
 }
@@ -395,7 +401,7 @@ static void
 wosc_process (BseModule *module,
               guint      n_values)
 {
-  GslWaveOscData *wosc = module->user_data;
+  GslWaveOscData *wosc = (GslWaveOscData*) module->user_data;
   gfloat gate, done;
   
   gsl_wave_osc_process (wosc,
@@ -417,7 +423,7 @@ wosc_process (BseModule *module,
 static void
 wosc_reset (BseModule *module)
 {
-  GslWaveOscData *wosc = module->user_data;
+  GslWaveOscData *wosc = (GslWaveOscData*) module->user_data;
   gsl_wave_osc_reset (wosc);
 }
 
@@ -467,8 +473,8 @@ static void
 pcm_pos_access (BseModule *module,      /* EngineThread */
                 gpointer   data)
 {
-  GslWaveOscData *wosc = module->user_data;
-  PcmPos *pos = data;
+  GslWaveOscData *wosc = (GslWaveOscData*) module->user_data;
+  PcmPos *pos = (PcmPos*) data;
 
   pos->stamp = GSL_TICK_STAMP;
   pos->module_pcm_position = gsl_wave_osc_cur_pos (wosc);
@@ -483,7 +489,7 @@ pcm_pos_access (BseModule *module,      /* EngineThread */
 static void
 pcm_pos_access_free (gpointer data)     /* UserThread */
 {
-  PcmPos *pos = data;
+  PcmPos *pos = (PcmPos*) data;
   BseWaveOsc *self = pos->wosc;
   
   if (pos->perc < 0)
@@ -509,7 +515,7 @@ bse_wave_osc_mass_seek (guint              n_woscs,
         {
           PcmPos *pos = g_new (PcmPos, 1);
           pos->perc = perc;
-          pos->wosc = g_object_ref (wosc);
+          pos->wosc = (BseWaveOsc*) g_object_ref (wosc);
           bse_source_access_modules (BSE_SOURCE (pos->wosc),
                                      pcm_pos_access,
                                      pos,
@@ -529,7 +535,7 @@ bse_wave_osc_request_pcm_position (BseWaveOsc *self)
     {
       PcmPos *pos = g_new (PcmPos, 1);
       pos->perc = -1;
-      pos->wosc = g_object_ref (self);
+      pos->wosc = (BseWaveOsc*) g_object_ref (self);
       bse_source_access_modules (BSE_SOURCE (self),
                                  pcm_pos_access,
                                  pos,
diff --git a/bse/bsewaverepo.c b/bse/bsewaverepo.cc
similarity index 96%
rename from bse/bsewaverepo.c
rename to bse/bsewaverepo.cc
index ad5a88d..8bd92b5 100644
--- a/bse/bsewaverepo.c
+++ b/bse/bsewaverepo.cc
@@ -84,9 +84,9 @@ bse_wave_repo_class_init (BseWaveRepoClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   BseContainerClass *container_class = BSE_CONTAINER_CLASS (klass);
-  
-  parent_class = g_type_class_peek_parent (klass);
-  
+
+  parent_class = (GTypeClass*) g_type_class_peek_parent (klass);
+
   gobject_class->set_property = bse_wave_repo_set_property;
   gobject_class->get_property = bse_wave_repo_get_property;
   gobject_class->dispose = bse_wave_repo_dispose;
@@ -109,8 +109,8 @@ bse_wave_repo_release_children (BseContainer *container)
   BseWaveRepo *wrepo = BSE_WAVE_REPO (container);
 
   while (wrepo->waves)
-    bse_container_remove_item (container, wrepo->waves->data);
-  
+    bse_container_remove_item (container, (BseItem*) wrepo->waves->data);
+
   /* chain parent class' handler */
   BSE_CONTAINER_CLASS (parent_class)->release_children (container);
 }
@@ -177,13 +177,12 @@ bse_wave_repo_forall_items (BseContainer      *container,
 {
   BseWaveRepo *wrepo = BSE_WAVE_REPO (container);
   GList *list;
-  
+
   list = wrepo->waves;
   while (list)
     {
       BseItem *item;
-      
-      item = list->data;
+      item = (BseItem*) list->data;
       list = list->next;
       if (!func (item, data))
 	return;
diff --git a/bse/mktypes.pl b/bse/mktypes.pl
index 3836e5f..2b9c590 100755
--- a/bse/mktypes.pl
+++ b/bse/mktypes.pl
@@ -160,7 +160,7 @@ while (<>) {
     }
 
     if ($gen_export_proto) {
-	print "extern BSE_BUILTIN_PROTO ($type);\n";
+	print "extern \"C\" BSE_BUILTIN_PROTO ($type);\n";
     }
     
     if ($gen_interns) {
diff --git a/po/POTSCAN b/po/POTSCAN
index 92ad3a5..c9db215 100644
--- a/po/POTSCAN
+++ b/po/POTSCAN
@@ -91,18 +91,18 @@ bse/bsepcminput.cc
 bse/bsepcmoutput.cc
 bse/bseserver.cc
 bse/bsesnooper.c
-bse/bsesong.c
+bse/bsesong.cc
 bse/bsesong.proc
 bse/bsesource.proc
-bse/bsestandardosc.c
-bse/bsesubiport.c
-bse/bsesuboport.c
-bse/bsesubsynth.c
-bse/bsesuper.c
-bse/bsetrack.c
+bse/bsestandardosc.cc
+bse/bsesubiport.cc
+bse/bsesuboport.cc
+bse/bsesubsynth.cc
+bse/bsesuper.cc
+bse/bsetrack.cc
 bse/bsetrack.proc
-bse/bsewave.c
-bse/bsewaveosc.c
+bse/bsewave.cc
+bse/bsewaveosc.cc
 data/beast.desktop.in
 data/beast.xml.in
 data/bse.keys.in



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