Changeset 5270:e25346c13638 in roaraudio for libroaresd


Ignore:
Timestamp:
11/17/11 18:20:12 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fixed some gcc -Wextra warnings

Location:
libroaresd
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libroaresd/Makefile

    r4748 r5270  
    1111INCLUDE = -I../include -I../include/libroaresd 
    1212CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 
    13 LDFLAGS+= -g $(SHARED) $(LDPATH) -L../lib/ 
     13LDFLAGS+= -g -Wall $(SHARED) $(LDPATH) -L../lib/ 
    1414LIBS    = $(LIBROAR) 
    1515 
  • libroaresd/esdbasic.c

    r5226 r5270  
    6666/* send the authorization cookie, create one if needed */ 
    6767int esd_send_auth( int sock ) { 
     68 (void) sock; 
    6869 return 0; 
    6970} 
  • libroaresd/esdctl.c

    r5236 r5270  
    4545// so always return -1 
    4646int esd_lock( int esd ) { 
     47 (void)esd; 
     48 errno = ENOSYS; 
    4749 return -1; 
    4850} 
    4951int esd_unlock( int esd ) { 
     52 (void)esd; 
     53 errno = ENOSYS; 
    5054 return -1; 
    5155} 
     
    6670 
    6771 return roar_set_standby(&con, ROAR_STANDBY_INACTIVE); 
     72} 
     73 
     74static void _format2str(char * buf, size_t len, esd_format_t format) { 
     75 
     76 if ( (format & ESD_BITS16) == ESD_BITS16 ) { 
     77  roar_mm_strlcat(buf, "16 bit ", len); 
     78 } else { 
     79  roar_mm_strlcat(buf, "8 bit ", len); 
     80 } 
     81 
     82 if ( (format & ESD_STEREO) == ESD_STEREO ) { 
     83  roar_mm_strlcat(buf, "stereo ", len); 
     84 } else { 
     85  roar_mm_strlcat(buf, "mono ", len); 
     86 } 
    6887} 
    6988 
     
    7291 char buf[80] = ""; 
    7392 
    74  if ( server_info->format & ESD_BITS16 ) 
    75   strcat(buf, "16 bit "); 
    76  else 
    77   strcat(buf, "8 bit "); 
    78  
    79  if ( server_info->format & ESD_STEREO ) 
    80   strcat(buf, "stereo "); 
    81  else 
    82   strcat(buf, "mono "); 
     93 _format2str(buf, sizeof(buf), server_info->format); 
    8394 
    8495 printf("server version   = %i\n",        server_info->version); 
     
    8798} 
    8899 
    89  
    90100void esd_print_player_info( esd_player_info_t *player_info ) { 
    91101 char buf[80] = ""; 
    92102 
    93  if ( (player_info->format & ESD_BITS16) == ESD_BITS16 ) 
    94   strcat(buf, "16 bit "); 
    95  else 
    96   strcat(buf, "8 bit "); 
    97  
    98  if ( (player_info->format & ESD_STEREO) == ESD_STEREO ) 
    99   strcat(buf, "stereo "); 
    100  else 
    101   strcat(buf, "mono "); 
     103 _format2str(buf, sizeof(buf), player_info->format); 
    102104 
    103105 printf("player %i name    = %s\n",        player_info->source_id, player_info->name); 
     
    109111 
    110112void esd_print_sample_info( esd_sample_info_t *sample_info ) { 
     113 char buf[80] = ""; 
     114 
     115 _format2str(buf, sizeof(buf), sample_info->format); 
     116 
     117 printf("sample %i name    = %s\n",        sample_info->sample_id, sample_info->name); 
     118 printf("sample %i format  = 0x%08x %s\n", sample_info->sample_id, sample_info->format, buf); 
     119 printf("sample %i rate    = %i\n",        sample_info->sample_id, sample_info->rate); 
     120 printf("sample %i left    = %i\n",        sample_info->sample_id, sample_info->left_vol_scale); 
     121 printf("sample %i right   = %i\n",        sample_info->sample_id, sample_info->right_vol_scale); 
     122 printf("sample %i length  = %i\n",        sample_info->sample_id, sample_info->length); 
    111123} 
    112124 
     
    282294/* retrieve all information from server, and update until unsubsribed or closed */ 
    283295esd_info_t *esd_subscribe_all_info( int esd ) { 
     296 (void)esd; 
     297 errno = ENOSYS; 
    284298 return NULL; // Not yet implemented in upstream esd 
    285299} 
     
    288302esd_info_t *esd_update_info( int esd, esd_info_t *info, 
    289303                             esd_update_info_callbacks_t *callbacks ) { 
     304 (void)esd, (void)info, (void)callbacks; 
     305 errno = ENOSYS; 
    290306 return NULL; // Not yet implemented in upstream esd 
    291307} 
    292308 
    293309esd_info_t *esd_unsubscribe_info( int esd ) { 
     310 (void)esd; 
     311 errno = ENOSYS; 
    294312 return NULL; // Not yet implemented in upstream esd 
    295313} 
     
    362380int esd_set_default_sample_pan( int esd, int sample_id, 
    363381                                int left_scale, int right_scale ) { 
     382 // this is not yet implemented by the RA protocol. 
     383 (void)esd, (void)sample_id, (void)left_scale, (void)right_scale; 
     384 errno = ENOSYS; 
    364385 return -1; 
    365386} 
  • libroaresd/esdfile.c

    r4708 r5270  
    4747} 
    4848int esd_play_file( const char *name_prefix, const char *filename, int fallback ) { 
    49  // TODO: add support for fallback 
    50  return roar_simple_play_file((char*)filename, NULL, (char*)name_prefix) == -1 ? -1 : 0; 
     49 int ret = roar_simple_play_file(filename, NULL, name_prefix); 
     50 
     51 if ( ret != -1 ) 
     52  return 0; 
     53 
     54 if ( !fallback ) 
     55  return -1; 
     56 
     57 return roar_simple_play_file(filename, "+fork", name_prefix) == -1 ? -1 : 0; 
    5158} 
    5259int esd_file_cache( int esd, const char *name_prefix, const char *filename ) { 
Note: See TracChangeset for help on using the changeset viewer.