Changeset 5162:85c55ccd12a9 in roaraudio


Ignore:
Timestamp:
10/16/11 20:12:40 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fixed some compiler warnings

Location:
roard
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r5155 r5162  
    570570    event = ROAR_NOTIFY_CMD2EVENT(m.cmd); 
    571571 
    572     roar_debug_message_print(&m); 
    573  
    574572    oldcmd = m.cmd; 
    575573 
  • roard/codecfilter_flac.c

    r5131 r5162  
    147147    continue; 
    148148 
    149    stream_meta_add(ROAR_STREAM(self->ss)->id, type, "", value); 
     149   if ( stream_meta_add(ROAR_STREAM(self->ss)->id, type, "", value) == -1 ) { 
     150    ROAR_WARN("cf_flac_cb_metadata(..., client_data=%p{ROAR_STREAM(.ss)->id=%i}): Can not add meta data: %s", 
     151              ROAR_STREAM(self->ss)->id, roar_error2str(roar_error)); 
     152   } 
    150153 
    151154    if ( strcmp(keycopy, "REPLAYGAIN_TRACK_PEAK") == 0 ) { 
     
    252255  stats.bytes = 0; 
    253256 } else { 
    254   roar_buffer_ring_stats(self->decoder.written, &stats); 
     257  if ( roar_buffer_ring_stats(self->decoder.written, &stats) == -1 ) 
     258   return -1; 
    255259 } 
    256260 
     
    275279   stats.bytes = 0; 
    276280  } else { 
    277    roar_buffer_ring_stats(self->decoder.written, &stats); 
     281   if ( roar_buffer_ring_stats(self->decoder.written, &stats) == -1 ) 
     282    return -1; 
    278283  } 
    279284 } 
  • roard/driver_dstr.c

    r4708 r5162  
    4949 
    5050 if ( sstream != NULL ) 
    51   roar_vio_ctl(inst, ROAR_VIO_CTL_SET_SSTREAM, sstream); 
     51  _LIBROAR_IGNORE_RET(roar_vio_ctl(inst, ROAR_VIO_CTL_SET_SSTREAM, sstream)); 
    5252 
    5353 return 0; 
  • roard/driver_esd.c

    r4763 r5162  
    5454 fh = esd_play_stream_fallback(format, info->rate, device, name); 
    5555 
    56  roar_vio_set_fh(inst, fh); 
    5756 
    5857 // test for error. 
    5958 if ( fh == -1 ) 
    6059  return -1; 
     60 
     61 roar_vio_open_fh_socket(inst, fh); 
    6162 
    6263 roar_vio_shutdown(inst, ROAR_VIO_SHUTDOWN_READ); 
  • roard/driver_raw.c

    r4708 r5162  
    3636 
    3737 if ( fh == -1 ) { 
    38   if ( (fh = open(device, O_CREAT|O_TRUNC|O_WRONLY, 0644)) == -1 ) { 
     38  if ( roar_vio_open_file(inst, device, O_CREAT|O_TRUNC|O_WRONLY, 0644) == -1 ) 
    3939   return -1; 
    40   } 
     40 } else { 
     41  if ( roar_vio_open_fh(inst, fh) == -1 ) 
     42   return -1; 
    4143 } 
    42  
    43  roar_vio_set_fh(inst, fh); 
    4444 
    4545 return 0; 
  • roard/driver_roar.c

    r5056 r5162  
    4848 if ( roar_vio_simple_stream(inst, info->rate, info->channels, info->bits, info->codec, device, dir, "roard") == -1 ) { 
    4949  if ( streams_get_flag(ROAR_STREAM(sstream)->id, ROAR_FLAG_AUTOCONF) ) { 
    50    roar_profile2info(info, "default"); 
     50   if ( roar_profile2info(info, "default") == -1 ) 
     51    return -1; 
     52 
    5153   if ( roar_vio_simple_stream(inst, info->rate, info->channels, info->bits, info->codec, device, dir, "roard") == -1 ) { 
    5254    return -1; 
  • roard/hwmixer_dstr.c

    r4752 r5162  
    2727 
    2828#ifndef ROAR_WITHOUT_DCOMP_MIXER 
     29 
     30/* 
     31 * This driver ignores errors on seeks: 
     32 * The writes ensure that if the seek back to begin of file 
     33 * does not work the records keep seperate and parsable. 
     34 * So it basically enters some kind of streaming mode. 
     35 */ 
    2936 
    3037//#define TEST_HWMIXER_SUBSTREAMS 
     
    6370 
    6471 roar_vio_printf(vio, "No data yet.\n"); 
    65  roar_vio_lseek(vio, 0, SEEK_SET); 
     72 _LIBROAR_IGNORE_RET(roar_vio_lseek(vio, 0, SEEK_SET)); 
    6673 roar_vio_sync(vio); 
    6774 
     
    113120 } 
    114121 
    115  roar_vio_lseek(vio, 0, SEEK_SET); 
     122 _LIBROAR_IGNORE_RET(roar_vio_lseek(vio, 0, SEEK_SET)); 
    116123 roar_vio_sync(vio); 
    117124 return 0; 
  • roard/include/meta.h

    r4708 r5162  
    3030 
    3131#ifdef ROAR_SUPPORT_META 
    32 int stream_meta_set     (int id, int type, char * name, char * val); 
    33 int stream_meta_add     (int id, int type, char * name, char * val); 
    34 int stream_meta_get     (int id, int type, char * name, char * val, size_t len); 
     32int stream_meta_set     (int id, int type, const char * name, const char * val); 
     33int stream_meta_add     (int id, int type, const char * name, const char * val); 
     34int stream_meta_get     (int id, int type, const char * name, char * val, size_t len); 
    3535int stream_meta_list    (int id, int * types, size_t len); 
    3636int stream_meta_clear   (int id); 
  • roard/meta.c

    r5135 r5162  
    2828#ifdef ROAR_SUPPORT_META 
    2929 
    30 int stream_meta_set   (int id, int type, char * name, char * val) { 
     30int stream_meta_set   (int id, int type, const char * name, const char * val) { 
    3131 int i; 
    3232 struct roar_stream_server * s = g_streams[id]; 
     
    4848} 
    4949 
    50 int stream_meta_add   (int id, int type, char * name, char * val) { 
     50int stream_meta_add   (int id, int type, const char * name, const char * val) { 
    5151 int i; 
    5252 char * c; 
     
    8585} 
    8686 
    87 int stream_meta_get   (int id, int type, char * name, char * val, size_t len) { 
     87int stream_meta_get   (int id, int type, const char * name, char * val, size_t len) { 
    8888 int i, vallen; 
    8989 struct roar_stream_server * s = g_streams[id]; 
  • roard/midi.c

    r5090 r5162  
    158158 
    159159 if ( roar_buffer_new_data(&b, MIDI_READ_SIZE, &buf) == -1 ) { 
    160   ROAR_ERR("midi_check_stream(*): Can not alloc buffer space!"); 
    161   ROAR_DBG("midi_check_stream(*) = -1"); 
     160  ROAR_ERR("midi_check_stream(id=%i): Can not alloc buffer space!", id); 
     161  ROAR_DBG("midi_check_stream(id=%i) = -1", id); 
    162162  return -1; 
    163163 } 
     
    169169 } 
    170170 
    171  roar_buffer_set_len(b, len); 
     171 if ( roar_buffer_set_len(b, len) == -1 ) { 
     172  ROAR_WARN("midi_check_stream(id=%i): Can not set buffer size. BAD.", id); 
     173  roar_buffer_free(b); 
     174  streams_delete(id); 
     175  return -1; 
     176 } 
    172177 
    173178 if ( stream_add_buffer(id, b) == -1 ) { 
     
    348353  } 
    349354 
    350   roar_buffer_next(&(ss->buffer)); 
     355  if ( roar_buffer_next(&(ss->buffer)) == -1 ) { 
     356   ROAR_WARN("midi_conv_midi2mes(id=%i): Can not move to next buffer segment. BAD.", id); 
     357   break; 
     358  } 
    351359 } 
    352360 
     
    672680 
    673681int midi_add_buf       (int id, struct roar_buffer * buf) { 
     682#ifdef DEBUG 
    674683 struct midi_message * mes; 
    675684 void * bufdata; 
     685#endif 
    676686 
    677687 if ( id == -1 || buf == NULL ) 
    678688  return -1; 
    679689 
     690#ifdef DEBUG 
    680691 if ( roar_buffer_get_data(buf, &bufdata) == -1 ) 
    681692  return -1; 
     
    688699 ROAR_DBG("midi_add_buf(*): flags=0x%.2X", mes->flags); 
    689700 ROAR_DBG("midi_add_buf(*): kk=0x%.2X, vv=0x%.2X", mes->kk, mes->vv); 
     701#endif 
    690702 
    691703 if ( g_midi_mess.buf == NULL ) { 
    692704  g_midi_mess.buf = buf; 
    693705 } else { 
    694   roar_buffer_add(g_midi_mess.buf, buf); 
     706  if ( roar_buffer_add(g_midi_mess.buf, buf) == -1 ) { 
     707   ROAR_DBG("midi_add_buf(*) = -1"); 
     708   return -1; 
     709  } 
    695710 } 
    696711 
  • roard/output.c

    r5063 r5162  
    454454 } 
    455455 
    456  roar_vio_ctl(&(ss->vio), ROAR_VIO_CTL_SET_SSTREAMID, &stream); // ignore errors here 
    457  roar_vio_ctl(&(ss->vio), ROAR_VIO_CTL_SET_SSTREAM,   s); // ignore errors here 
     456 _LIBROAR_IGNORE_RET(roar_vio_ctl(&(ss->vio), ROAR_VIO_CTL_SET_SSTREAMID, &stream)); // ignore errors here 
     457 _LIBROAR_IGNORE_RET(roar_vio_ctl(&(ss->vio), ROAR_VIO_CTL_SET_SSTREAM,   s)); // ignore errors here 
    458458 
    459459 if ( blocks != -1 ) 
  • roard/sample.c

    r4975 r5162  
    100100 struct roar_buffer * new; 
    101101 struct roar_sample * c = g_samples[id]; 
     102 int save_err; 
    102103 
    103104 if ( c == NULL ) 
     
    110111  c->data = new; 
    111112 } else { 
    112   roar_buffer_add(c->data, new); 
     113  if ( roar_buffer_add(c->data, new) == -1 ) { 
     114   save_err = roar_error; 
     115   roar_buffer_free(new); 
     116   roar_err_set(save_err); 
     117   return -1; 
     118  } 
    113119 } 
    114120 
  • roard/sources.c

    r4964 r5162  
    233233 } 
    234234 
    235  roar_vio_ctl(&(ss->vio), ROAR_VIO_CTL_SET_SSTREAMID, &stream); // ignore errors here 
    236  roar_vio_ctl(&(ss->vio), ROAR_VIO_CTL_SET_SSTREAM,   s); // ignore errors here 
     235 _LIBROAR_IGNORE_RET(roar_vio_ctl(&(ss->vio), ROAR_VIO_CTL_SET_SSTREAMID, &stream)); // ignore errors here 
     236 _LIBROAR_IGNORE_RET(roar_vio_ctl(&(ss->vio), ROAR_VIO_CTL_SET_SSTREAM,   s)); // ignore errors here 
    237237 
    238238 if ( f_sync ) { 
     
    251251 struct roar_stream_server * ss; 
    252252 
    253  if ( fh > -1 ) 
    254   return streams_set_fh(stream, fh); 
    255  
    256253 streams_get(stream, &ss); 
    257254 
    258  if ( roar_vio_open_file(&(ss->vio), device, O_RDONLY, 0644) == -1 ) 
    259   return -1; 
     255 if ( fh > -1 ) { 
     256  if ( roar_vio_open_fh(&(ss->vio), fh) == -1 ) 
     257   return -1; 
     258 } else { 
     259  if ( roar_vio_open_file(&(ss->vio), device, O_RDONLY, 0644) == -1 ) 
     260   return -1; 
     261 } 
    260262 
    261263 return streams_set_fh(stream, -2); 
Note: See TracChangeset for help on using the changeset viewer.