Changeset 4521:4277b6a0c8a1 in roaraudio


Ignore:
Timestamp:
10/16/10 17:09:23 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fixed a lot compiler warnings

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r4516 r4521  
    1111        * Changed SONAME version to 1. 
    1212        * Changed buffer interface, no public struct anymore. 
     13        * Fixed lots of compiler warnings 
    1314 
    1415v. 0.4beta0 - Fri Oct 01 2010 13:36 CEST 
  • roard/beep.c

    r3764 r4521  
    2828// TODO: FIXME: move them out of here into libroar: 
    2929static ssize_t beep_read    (struct roar_vio_calls * vio, void *buf, size_t count) { 
     30 struct roar_buffer * rbuf; 
     31 
    3032 ROAR_DBG("beep_read(vio=%p, buf=%p, count=%llu) = ?", vio, buf, (long long unsigned int)count); 
    3133 
     
    3335  return 0; 
    3436 
    35  if ( roar_buffer_shift_out(&(vio->inst), buf, &count) == -1 ) 
     37 rbuf = vio->inst; 
     38 
     39 if ( roar_buffer_shift_out(&rbuf, buf, &count) == -1 ) 
    3640  return -1; 
     41 
     42 vio->inst = rbuf; 
    3743 
    3844 return count; 
     
    6773 size_t mod     = info->rate / beep->freq; 
    6874 char                        * data; 
     75 void                        * bufdata; 
    6976 char   val; 
    7077 size_t pos; 
     
    7380 ROAR_DBG("beep_fill_buffer(beep=%p, info=%p) = ?", beep, info); 
    7481 
    75  if ( roar_buffer_new_data(&buf, samples, &data) == -1 ) { 
     82 if ( roar_buffer_new_data(&buf, samples, &bufdata) == -1 ) { 
    7683  ROAR_DBG("beep_fill_buffer(beep=%p, info=%p) = NULL", beep, info); 
    7784  return NULL; 
    7885 } 
     86 
     87 data = (char*)bufdata; 
    7988 
    8089 for (pos = 0; pos < frames; pos++) { 
  • roard/include/streams.h

    r4379 r4521  
    142142int streams_set_null_io(int id); 
    143143int streams_get        (int id, struct roar_stream_server ** stream); 
     144int streams_get_clientobj (int id, struct roar_stream        ** stream); 
    144145 
    145146int streams_set_socktype (int id, int socktype); 
  • roard/midi.c

    r3764 r4521  
    136136 struct roar_stream_server *  ss; 
    137137 struct roar_buffer        *   b; 
    138  char                      * buf; 
     138 void                      * buf; 
    139139 ssize_t                     len; 
    140140 
     
    157157 } 
    158158 
    159  if ( roar_buffer_new_data(&b, MIDI_READ_SIZE, (void**)&buf) == -1 ) { 
     159 if ( roar_buffer_new_data(&b, MIDI_READ_SIZE, &buf) == -1 ) { 
    160160  ROAR_ERR("midi_check_stream(*): Can not alloc buffer space!"); 
    161161  ROAR_DBG("midi_check_stream(*) = -1"); 
     
    213213 
    214214int midi_conv_midi2mes (int id) { 
     215 void          * bufdata; 
    215216 unsigned char * data; 
    216217 struct roar_stream        *   s; 
     
    229230 
    230231 while (ss->buffer != NULL && alive) { 
    231   if ( roar_buffer_get_data(ss->buffer, (void**)&data) == -1 ) { 
     232  if ( roar_buffer_get_data(ss->buffer, &bufdata) == -1 ) { 
    232233   alive = 0; 
    233234   continue; 
    234235  } 
     236 
     237  data = bufdata; 
    235238 
    236239  if ( roar_buffer_get_len(ss->buffer, &have) == -1 ) { 
     
    375378 struct roar_buffer        * buf = g_midi_mess.buf; 
    376379 struct midi_message       * mes = NULL; 
     380 void                      * bufdata; 
    377381 unsigned char               data[3]; 
    378382 unsigned char             * d; 
     
    390394 
    391395 while (buf != NULL) { 
    392   if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) { 
     396  if ( roar_buffer_get_data(buf, &bufdata) == -1 ) { 
    393397   return -1; 
    394398  } 
     399 
     400  mes = bufdata; 
    395401 
    396402  if (mes->type == MIDI_TYPE_CLOCK_TICK || mes->type == MIDI_TYPE_CLOCK_START || mes->type == MIDI_TYPE_CLOCK_STOP ) { 
     
    455461 struct roar_buffer        * buf = g_midi_mess.buf; 
    456462 struct midi_message       * mes = NULL; 
     463 void                      * bufdata; 
    457464 
    458465 while (buf != NULL) { 
    459   if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) { 
     466  if ( roar_buffer_get_data(buf, &bufdata) == -1 ) { 
    460467   return -1; 
    461468  } 
     469 
     470  mes = bufdata; 
    462471 
    463472  if ( ssynth_eval_message(mes) == -1 ) 
     
    492501int midi_add_buf       (int id, struct roar_buffer * buf) { 
    493502 struct midi_message * mes; 
     503 void * bufdata; 
    494504 
    495505 if ( id == -1 || buf == NULL ) 
    496506  return -1; 
    497507 
    498  if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) 
    499   return -1; 
     508 if ( roar_buffer_get_data(buf, &bufdata) == -1 ) 
     509  return -1; 
     510 
     511 mes = bufdata; 
    500512 
    501513 ROAR_DBG("midi_add_buf(id=%i, buf=%p) = ?", id, buf); 
     
    803815 struct roar_buffer        * buf = g_midi_mess.buf; 
    804816 struct midi_message       * mes = NULL; 
     817 void                      * bufdata; 
    805818 
    806819 ROAR_DBG("midi_cb_readbuf(void) = ?"); 
     
    809822  ROAR_DBG("midi_cb_readbuf(void): buf=%p", buf); 
    810823 
    811   if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) { 
     824  if ( roar_buffer_get_data(buf, &bufdata) == -1 ) { 
    812825   return -1; 
    813826  } 
     827 
     828  mes = bufdata; 
    814829 
    815830  switch (mes->type) { 
  • roard/req.c

    r4505 r4521  
    149149 
    150150 ROAR_DBG("req_on_new_stream(client=%i, ...): getting stream...", client); 
    151  if ( streams_get(stream, (struct roar_stream_server **)&s) == -1 ) { 
     151 if ( streams_get_clientobj(stream, &s) == -1 ) { 
    152152  streams_delete(stream); 
    153153  return -1; 
     
    235235    } 
    236236 
    237     if ( streams_get(ROAR_STREAM(s)->pos_rel_id, (struct roar_stream_server **)&source_stream) == -1 ) { 
     237    if ( streams_get_clientobj(ROAR_STREAM(s)->pos_rel_id, &source_stream) == -1 ) { 
    238238     streams_delete(stream); 
    239239     return -1; 
     
    256256     source_info = g_sa; 
    257257    } else { 
    258      if ( streams_get(ROAR_STREAM(s)->pos_rel_id, (struct roar_stream_server **)&source_stream) == -1 ) { 
     258     if ( streams_get_clientobj(ROAR_STREAM(s)->pos_rel_id, &source_stream) == -1 ) { 
    259259      streams_delete(stream); 
    260260      return -1; 
     
    606606   *data = NULL; 
    607607 
    608    if ( roar_server_info_to_mes(mes, &info, data) == -1 ) 
     608   if ( roar_server_info_to_mes(mes, &info, (void**)data) == -1 ) 
    609609    return -1; 
    610610 
     
    14211421int req_on_add_data (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 
    14221422 struct roar_buffer * b; 
    1423  char               * buf; 
    1424  
    1425  if ( roar_buffer_new_data(&b, mes->datalen, (void **)&buf) == -1 ) { 
     1423 void               * buf; 
     1424 
     1425 if ( roar_buffer_new_data(&b, mes->datalen, &buf) == -1 ) { 
    14261426  ROAR_ERR("req_on_add_data(*): Can not alloc buffer space!"); 
    14271427  ROAR_DBG("req_on_add_data(*) = -1"); 
  • roard/sources.c

    r4419 r4521  
    271271 } 
    272272 
    273  streams_get(stream, (struct roar_stream_server **)&s); 
     273 streams_get_clientobj(stream, &s); 
    274274 
    275275 memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info)); 
     
    313313 } 
    314314 
    315  streams_get(stream, (struct roar_stream_server **)&s); 
     315 streams_get_clientobj(stream, &s); 
    316316 
    317317 memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info)); 
     
    408408 } 
    409409 
    410  streams_get(stream, (struct roar_stream_server **)&s); 
     410 streams_get_clientobj(stream, &s); 
    411411 
    412412 memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info)); 
  • roard/streams.c

    r4516 r4521  
    709709} 
    710710 
     711int streams_get_clientobj (int id, struct roar_stream        ** stream) { 
     712 _CHECK_SID(id); 
     713 
     714 *stream = ROAR_STREAM(g_streams[id]); 
     715 
     716 return 0; 
     717} 
     718 
    711719int streams_set_socktype (int id, int socktype) { 
    712720 _CHECK_SID(id); 
Note: See TracChangeset for help on using the changeset viewer.