Index: roard/beep.c
===================================================================
--- roard/beep.c	(revision 3764)
+++ roard/beep.c	(revision 4521)
@@ -28,4 +28,6 @@
 // TODO: FIXME: move them out of here into libroar:
 static ssize_t beep_read    (struct roar_vio_calls * vio, void *buf, size_t count) {
+ struct roar_buffer * rbuf;
+
  ROAR_DBG("beep_read(vio=%p, buf=%p, count=%llu) = ?", vio, buf, (long long unsigned int)count);
 
@@ -33,6 +35,10 @@
   return 0;
 
- if ( roar_buffer_shift_out(&(vio->inst), buf, &count) == -1 )
+ rbuf = vio->inst;
+
+ if ( roar_buffer_shift_out(&rbuf, buf, &count) == -1 )
   return -1;
+
+ vio->inst = rbuf;
 
  return count;
@@ -67,4 +73,5 @@
  size_t mod     = info->rate / beep->freq;
  char                        * data;
+ void                        * bufdata;
  char   val;
  size_t pos;
@@ -73,8 +80,10 @@
  ROAR_DBG("beep_fill_buffer(beep=%p, info=%p) = ?", beep, info);
 
- if ( roar_buffer_new_data(&buf, samples, &data) == -1 ) {
+ if ( roar_buffer_new_data(&buf, samples, &bufdata) == -1 ) {
   ROAR_DBG("beep_fill_buffer(beep=%p, info=%p) = NULL", beep, info);
   return NULL;
  }
+
+ data = (char*)bufdata;
 
  for (pos = 0; pos < frames; pos++) {
Index: roard/include/streams.h
===================================================================
--- roard/include/streams.h	(revision 4379)
+++ roard/include/streams.h	(revision 4521)
@@ -142,4 +142,5 @@
 int streams_set_null_io(int id);
 int streams_get        (int id, struct roar_stream_server ** stream);
+int streams_get_clientobj (int id, struct roar_stream        ** stream);
 
 int streams_set_socktype (int id, int socktype);
Index: roard/midi.c
===================================================================
--- roard/midi.c	(revision 3764)
+++ roard/midi.c	(revision 4521)
@@ -136,5 +136,5 @@
  struct roar_stream_server *  ss;
  struct roar_buffer        *   b;
- char                      * buf;
+ void                      * buf;
  ssize_t                     len;
 
@@ -157,5 +157,5 @@
  }
 
- if ( roar_buffer_new_data(&b, MIDI_READ_SIZE, (void**)&buf) == -1 ) {
+ if ( roar_buffer_new_data(&b, MIDI_READ_SIZE, &buf) == -1 ) {
   ROAR_ERR("midi_check_stream(*): Can not alloc buffer space!");
   ROAR_DBG("midi_check_stream(*) = -1");
@@ -213,4 +213,5 @@
 
 int midi_conv_midi2mes (int id) {
+ void          * bufdata;
  unsigned char * data;
  struct roar_stream        *   s;
@@ -229,8 +230,10 @@
 
  while (ss->buffer != NULL && alive) {
-  if ( roar_buffer_get_data(ss->buffer, (void**)&data) == -1 ) {
+  if ( roar_buffer_get_data(ss->buffer, &bufdata) == -1 ) {
    alive = 0;
    continue;
   }
+
+  data = bufdata;
 
   if ( roar_buffer_get_len(ss->buffer, &have) == -1 ) {
@@ -375,4 +378,5 @@
  struct roar_buffer        * buf = g_midi_mess.buf;
  struct midi_message       * mes = NULL;
+ void                      * bufdata;
  unsigned char               data[3];
  unsigned char             * d;
@@ -390,7 +394,9 @@
 
  while (buf != NULL) {
-  if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) {
+  if ( roar_buffer_get_data(buf, &bufdata) == -1 ) {
    return -1;
   }
+
+  mes = bufdata;
 
   if (mes->type == MIDI_TYPE_CLOCK_TICK || mes->type == MIDI_TYPE_CLOCK_START || mes->type == MIDI_TYPE_CLOCK_STOP ) {
@@ -455,9 +461,12 @@
  struct roar_buffer        * buf = g_midi_mess.buf;
  struct midi_message       * mes = NULL;
+ void                      * bufdata;
 
  while (buf != NULL) {
-  if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) {
+  if ( roar_buffer_get_data(buf, &bufdata) == -1 ) {
    return -1;
   }
+
+  mes = bufdata;
 
   if ( ssynth_eval_message(mes) == -1 )
@@ -492,10 +501,13 @@
 int midi_add_buf       (int id, struct roar_buffer * buf) {
  struct midi_message * mes;
+ void * bufdata;
 
  if ( id == -1 || buf == NULL )
   return -1;
 
- if ( roar_buffer_get_data(buf, (void**)&mes) == -1 )
-  return -1;
+ if ( roar_buffer_get_data(buf, &bufdata) == -1 )
+  return -1;
+
+ mes = bufdata;
 
  ROAR_DBG("midi_add_buf(id=%i, buf=%p) = ?", id, buf);
@@ -803,4 +815,5 @@
  struct roar_buffer        * buf = g_midi_mess.buf;
  struct midi_message       * mes = NULL;
+ void                      * bufdata;
 
  ROAR_DBG("midi_cb_readbuf(void) = ?");
@@ -809,7 +822,9 @@
   ROAR_DBG("midi_cb_readbuf(void): buf=%p", buf);
 
-  if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) {
+  if ( roar_buffer_get_data(buf, &bufdata) == -1 ) {
    return -1;
   }
+
+  mes = bufdata;
 
   switch (mes->type) {
Index: roard/req.c
===================================================================
--- roard/req.c	(revision 4505)
+++ roard/req.c	(revision 4521)
@@ -149,5 +149,5 @@
 
  ROAR_DBG("req_on_new_stream(client=%i, ...): getting stream...", client);
- if ( streams_get(stream, (struct roar_stream_server **)&s) == -1 ) {
+ if ( streams_get_clientobj(stream, &s) == -1 ) {
   streams_delete(stream);
   return -1;
@@ -235,5 +235,5 @@
     }
 
-    if ( streams_get(ROAR_STREAM(s)->pos_rel_id, (struct roar_stream_server **)&source_stream) == -1 ) {
+    if ( streams_get_clientobj(ROAR_STREAM(s)->pos_rel_id, &source_stream) == -1 ) {
      streams_delete(stream);
      return -1;
@@ -256,5 +256,5 @@
      source_info = g_sa;
     } else {
-     if ( streams_get(ROAR_STREAM(s)->pos_rel_id, (struct roar_stream_server **)&source_stream) == -1 ) {
+     if ( streams_get_clientobj(ROAR_STREAM(s)->pos_rel_id, &source_stream) == -1 ) {
       streams_delete(stream);
       return -1;
@@ -606,5 +606,5 @@
    *data = NULL;
 
-   if ( roar_server_info_to_mes(mes, &info, data) == -1 )
+   if ( roar_server_info_to_mes(mes, &info, (void**)data) == -1 )
     return -1;
 
@@ -1421,7 +1421,7 @@
 int req_on_add_data (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_buffer * b;
- char               * buf;
-
- if ( roar_buffer_new_data(&b, mes->datalen, (void **)&buf) == -1 ) {
+ void               * buf;
+
+ if ( roar_buffer_new_data(&b, mes->datalen, &buf) == -1 ) {
   ROAR_ERR("req_on_add_data(*): Can not alloc buffer space!");
   ROAR_DBG("req_on_add_data(*) = -1");
Index: roard/sources.c
===================================================================
--- roard/sources.c	(revision 4419)
+++ roard/sources.c	(revision 4521)
@@ -271,5 +271,5 @@
  }
 
- streams_get(stream, (struct roar_stream_server **)&s);
+ streams_get_clientobj(stream, &s);
 
  memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info));
@@ -313,5 +313,5 @@
  }
 
- streams_get(stream, (struct roar_stream_server **)&s);
+ streams_get_clientobj(stream, &s);
 
  memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info));
@@ -408,5 +408,5 @@
  }
 
- streams_get(stream, (struct roar_stream_server **)&s);
+ streams_get_clientobj(stream, &s);
 
  memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info));
Index: roard/streams.c
===================================================================
--- roard/streams.c	(revision 4516)
+++ roard/streams.c	(revision 4521)
@@ -709,4 +709,12 @@
 }
 
+int streams_get_clientobj (int id, struct roar_stream        ** stream) {
+ _CHECK_SID(id);
+
+ *stream = ROAR_STREAM(g_streams[id]);
+
+ return 0;
+}
+
 int streams_set_socktype (int id, int socktype) {
  _CHECK_SID(id);
