Changeset 178

Show
Ignore:
Timestamp:
07/14/08 11:03:13 (2 months ago)
Author:
sam
Message:
  • Fix a bunch of warnings, mostly due to missing or invalid prototypes.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/examples/connect.c

    r167 r178  
    4444#include <netinet/udp.h> 
    4545#include <arpa/inet.h> 
     46 
     47#include "connect.h" 
    4648 
    4749int create_tcp_connection( const char *ipaddress, int port ) 
  • trunk/examples/decode_mpeg.c

    r175 r178  
    138138 * Local prototypes 
    139139 *****************************************************************************/ 
    140 void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt); 
     140static void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt); 
    141141 
    142142/***************************************************************************** 
    143143 * ReadPacket 
    144144 *****************************************************************************/ 
    145 int ReadPacket( int i_fd, uint8_t* p_dst ) 
     145static int ReadPacket( int i_fd, uint8_t* p_dst ) 
    146146{ 
    147147    int i = 187; 
     
    165165 
    166166#ifdef HAVE_SYS_SOCKET_H 
    167 int ReadPacketFromSocket( int i_socket, uint8_t* p_dst, size_t i_size) 
     167static int ReadPacketFromSocket( int i_socket, uint8_t* p_dst, size_t i_size) 
    168168{ 
    169169    int i_rc = -1; 
     
    173173    if( i_rc < 0 ) printf( "READ INTERRUPTED BY SIGNAL\n" ); 
    174174    if( i_rc == 0 ) printf( "READ RETURNS 0\n" ); 
    175     return (i_rc <= i_size ) ? 1 : 0; 
     175    return (i_rc <= (int)i_size ) ? 1 : 0; 
    176176} 
    177177#endif 
     
    180180 * DumpPAT 
    181181 *****************************************************************************/ 
    182 void DumpPAT(void* p_data, dvbpsi_pat_t* p_pat) 
     182static void DumpPAT(void* p_data, dvbpsi_pat_t* p_pat) 
    183183{ 
    184184    dvbpsi_pat_program_t* p_program = p_pat->p_first_program; 
     
    212212 * GetTypeName 
    213213 *****************************************************************************/ 
    214 char* GetTypeName(uint8_t type) 
     214static char const* GetTypeName(uint8_t type) 
    215215{ 
    216216  switch (type) 
     
    257257 * DumpMaxBitrateDescriptor 
    258258 *****************************************************************************/ 
    259 void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor) 
     259static void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor) 
    260260{ 
    261261  printf("Bitrate: %d\n", bitrate_descriptor->i_max_bitrate); 
     
    265265 * DumpSystemClockDescriptor 
    266266 *****************************************************************************/ 
    267 void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor) 
     267static void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor) 
    268268{ 
    269269  printf("External clock: %s, Accuracy: %E\n", 
     
    276276 * DumpStreamIdentifierDescriptor 
    277277 *****************************************************************************/ 
    278 void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor) 
     278static void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor) 
    279279{ 
    280280  printf("Component tag: %d\n", 
     
    285285 * DumpSubtitleDescriptor 
    286286 *****************************************************************************/ 
    287 void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor) 
     287static void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor) 
    288288{ 
    289289  int a; 
     
    305305 * DumpDescriptors 
    306306 *****************************************************************************/ 
    307 void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 
     307static void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 
    308308{ 
    309309  int i; 
     
    339339 * DumpPMT 
    340340 *****************************************************************************/ 
    341 void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt) 
     341static void DumpPMT(void* p_data, dvbpsi_pmt_t* p_pmt) 
    342342{ 
    343343    dvbpsi_pmt_es_t* p_es = p_pmt->p_first_es; 
     
    368368 * usage 
    369369 *****************************************************************************/ 
    370 void usage( char *name ) 
     370static void usage( char *name ) 
    371371{ 
    372372#ifdef HAVE_SYS_SOCKET_H 
  • trunk/examples/decode_pat.c

    r104 r178  
    5454 * ReadPacket 
    5555 *****************************************************************************/ 
    56 int ReadPacket(int i_fd, uint8_t* p_dst) 
     56static int ReadPacket(int i_fd, uint8_t* p_dst) 
    5757{ 
    5858  int i = 187; 
     
    8080 * DumpPAT 
    8181 *****************************************************************************/ 
    82 void DumpPAT(void* p_zero, dvbpsi_pat_t* p_pat) 
     82static void DumpPAT(void* p_zero, dvbpsi_pat_t* p_pat) 
    8383{ 
    8484  dvbpsi_pat_program_t* p_program = p_pat->p_first_program; 
  • trunk/examples/decode_pmt.c

    r134 r178  
    6363 * ReadPacket 
    6464 *****************************************************************************/ 
    65 int ReadPacket(int i_fd, uint8_t* p_dst) 
     65static int ReadPacket(int i_fd, uint8_t* p_dst) 
    6666{ 
    6767  int i = 187; 
     
    8888 * GetTypeName 
    8989 *****************************************************************************/ 
    90 char* GetTypeName(uint8_t type) 
     90static char* GetTypeName(uint8_t type) 
    9191{ 
    9292  switch (type) 
     
    133133 * DumpMaxBitrateDescriptor 
    134134 *****************************************************************************/ 
    135 void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor) 
     135static void DumpMaxBitrateDescriptor(dvbpsi_max_bitrate_dr_t* bitrate_descriptor) 
    136136{ 
    137137  printf("Bitrate: %d\n", bitrate_descriptor->i_max_bitrate); 
     
    141141 * DumpSystemClockDescriptor 
    142142 *****************************************************************************/ 
    143 void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor) 
     143static void DumpSystemClockDescriptor(dvbpsi_system_clock_dr_t* p_clock_descriptor) 
    144144{ 
    145145  printf("External clock: %s, Accuracy: %E\n", 
     
    152152 * DumpStreamIdentifierDescriptor 
    153153 *****************************************************************************/ 
    154 void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor) 
     154static void DumpStreamIdentifierDescriptor(dvbpsi_stream_identifier_dr_t* p_si_descriptor) 
    155155{ 
    156156  printf("Component tag: %d\n", 
     
    161161 * DumpSubtitleDescriptor 
    162162 *****************************************************************************/ 
    163 void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor) 
     163static void DumpSubtitleDescriptor(dvbpsi_subtitling_dr_t* p_subtitle_descriptor) 
    164164{ 
    165165  int a; 
     
    181181 * DumpDescriptors 
    182182 *****************************************************************************/ 
    183 void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 
     183static void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 
    184184{ 
    185185  int i; 
     
    216216 * DumpPMT 
    217217 *****************************************************************************/ 
    218 void DumpPMT(void* p_zero, dvbpsi_pmt_t* p_pmt) 
     218static void DumpPMT(void* p_zero, dvbpsi_pmt_t* p_pmt) 
    219219{ 
    220220  dvbpsi_pmt_es_t* p_es = p_pmt->p_first_es; 
  • trunk/examples/decode_sdt.c

    r88 r178  
    5959 * ReadPacket 
    6060 *****************************************************************************/ 
    61 int ReadPacket(int i_fd, uint8_t* p_dst) 
     61static int ReadPacket(int i_fd, uint8_t* p_dst) 
    6262{ 
    6363  int i = 187; 
     
    8585 * DumpDescriptors 
    8686 *****************************************************************************/ 
    87 void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 
     87static void DumpDescriptors(const char* str, dvbpsi_descriptor_t* p_descriptor) 
    8888{ 
    8989  while(p_descriptor) 
     
    102102 * DumpSDT 
    103103 *****************************************************************************/ 
    104 void DumpSDT(void* p_zero, dvbpsi_sdt_t* p_sdt) 
     104static void DumpSDT(void* p_zero, dvbpsi_sdt_t* p_sdt) 
    105105{ 
    106106  dvbpsi_sdt_service_t* p_service = p_sdt->p_first_service; 
     
    127127 * NewSubtable 
    128128 *****************************************************************************/ 
    129 void NewSubtable(void * p_zero, dvbpsi_handle h_dvbpsi, 
     129static void NewSubtable(void * p_zero, dvbpsi_handle h_dvbpsi, 
    130130                 uint8_t i_table_id, uint16_t i_extension) 
    131131{ 
  • trunk/misc/gen_crc.c

    r88 r178  
    3939 * main 
    4040 *****************************************************************************/ 
    41 int main(
     41int main(void
    4242{ 
    4343  uint32_t table[256]; 
  • trunk/misc/gen_pat.c

    r88 r178  
    5151 * writePSI 
    5252 *****************************************************************************/ 
    53 void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section) 
     53static void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section) 
    5454{ 
    5555  p_packet[0] = 0x47; 
  • trunk/misc/gen_pmt.c

    r149 r178  
    5353 * writePSI 
    5454 *****************************************************************************/ 
    55 void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section) 
     55static void writePSI(uint8_t* p_packet, dvbpsi_psi_section_t* p_section) 
    5656{ 
    5757  p_packet[0] = 0x47; 
  • trunk/misc/test_dr.c

    r137 r178  
    2626#include "test_dr.h" 
    2727 
    28    
     28 
    2929/* video stream (b_mpeg2 = false) */ 
    30 int main_vstream_1(
     30static int main_vstream_1(void
    3131{ 
    3232  BOZO_VARS(vstream); 
    3333  BOZO_START(video stream (b_mpeg2 = false)); 
    3434 
    35    
     35 
    3636  /* check b_multiple_frame_rate */ 
    3737  BOZO_init_boolean(b_multiple_frame_rate, 0); 
     
    8989 
    9090/* video stream (b_mpeg2 = true) */ 
    91 int main_vstream_2(
     91static int main_vstream_2(void
    9292{ 
    9393  BOZO_VARS(vstream); 
    9494  BOZO_START(video stream (b_mpeg2 = true)); 
    9595 
    96    
     96 
    9797  /* check b_multiple_frame_rate */ 
    9898  BOZO_init_boolean(b_multiple_frame_rate, 0); 
     
    207207 
    208208/* audio stream */ 
    209 int main_astream_(
     209static int main_astream_(void
    210210{ 
    211211  BOZO_VARS(astream); 
    212212  BOZO_START(audio stream); 
    213213 
    214    
     214 
    215215  /* check b_free_format */ 
    216216  BOZO_init_boolean(b_free_format, 0); 
     
    250250 
    251251/* hierarchy */ 
    252 int main_hierarchy_(
     252static int main_hierarchy_(void
    253253{ 
    254254  BOZO_VARS(hierarchy); 
    255255  BOZO_START(hierarchy); 
    256256 
    257    
     257 
    258258  /* check i_h_type */ 
    259259  BOZO_init_integer(i_h_type, 0); 
     
    307307 
    308308/* registration */ 
    309 int main_registration_(
     309static int main_registration_(void
    310310{ 
    311311  BOZO_VARS(registration); 
    312312  BOZO_START(registration); 
    313313 
    314    
     314 
    315315  /* check i_format_identifier */ 
    316316  s_decoded.i_additional_length = 0; 
     
    329329 
    330330/* data stream alignment */ 
    331 int main_ds_alignment_(
     331static int main_ds_alignment_(void
    332332{ 
    333333  BOZO_VARS(ds_alignment); 
    334334  BOZO_START(data stream alignment); 
    335335 
    336    
     336 
    337337  /* check i_alignment_type */ 
    338338  BOZO_init_integer(i_alignment_type, 0); 
     
    350350 
    351351/* target background grid */ 
    352 int main_target_bg_grid_(
     352static int main_target_bg_grid_(void
    353353{ 
    354354  BOZO_VARS(target_bg_grid); 
    355355  BOZO_START(target background grid); 
    356356 
    357    
     357 
    358358  /* check i_horizontal_size */ 
    359359  BOZO_init_integer(i_horizontal_size, 0); 
     
    393393 
    394394/* video window */ 
    395 int main_vwindow_(
     395static int main_vwindow_(void
    396396{ 
    397397  BOZO_VARS(vwindow); 
    398398  BOZO_START(video window); 
    399399 
    400    
     400 
    401401  /* check i_horizontal_offset */ 
    402402  BOZO_init_integer(i_horizontal_offset, 0); 
     
    436436 
    437437/* conditional access */ 
    438 int main_ca_(
     438static int main_ca_(void
    439439{ 
    440440  BOZO_VARS(ca); 
    441441  BOZO_START(conditional access); 
    442442 
    443    
     443 
    444444  /* check i_ca_system_id */ 
    445445  s_decoded.i_private_length = 0; 
     
    469469 
    470470/* system clock */ 
    471 int main_system_clock_(
     471static int main_system_clock_(void
    472472{ 
    473473  BOZO_VARS(system_clock); 
    474474  BOZO_START(system clock); 
    475475 
    476    
     476 
    477477  /* check b_external_clock_ref */ 
    478478  BOZO_init_boolean(b_external_clock_ref, 0); 
     
    512512 
    513513/* multiplex buffer utilization */ 
    514 int main_mx_buff_utilization_(
     514static int main_mx_buff_utilization_(void
    515515{ 
    516516  BOZO_VARS(mx_buff_utilization); 
    517517  BOZO_START(multiplex buffer utilization); 
    518518 
    519    
     519 
    520520  /* check b_mdv_valid */ 
    521521  BOZO_init_boolean(b_mdv_valid, 0); 
     
    555555 
    556556/* copyright */ 
    557 int main_copyright_(
     557static int main_copyright_(void
    558558{ 
    559559  BOZO_VARS(copyright); 
    560560  BOZO_START(copyright); 
    561561 
    562    
     562 
    563563  /* check i_copyright_identifier */ 
    564564  s_decoded.i_additional_length = 0; 
     
    577577 
    578578/* maximum bitrate */ 
    579 int main_max_bitrate_(
     579static int main_max_bitrate_(void
    580580{ 
    581581  BOZO_VARS(max_bitrate); 
    582582  BOZO_START(maximum bitrate); 
    583583 
    584    
     584 
    585585  /* check i_max_bitrate */ 
    586586  BOZO_init_integer(i_max_bitrate, 0); 
     
    598598 
    599599/* private data indicator */ 
    600 int main_private_data_(
     600static int main_private_data_(void
    601601{ 
    602602  BOZO_VARS(private_data); 
    603603  BOZO_START(private data indicator); 
    604604 
    605    
     605 
    606606  /* check i_private_data */ 
    607607  BOZO_init_integer(i_private_data, 0); 
     
    619619 
    620620/* service */ 
    621 int main_service_(
     621static int main_service_(void
    622622{ 
    623623  BOZO_VARS(service); 
    624624  BOZO_START(service); 
    625625 
    626    
     626 
    627627  /* check i_service_type */ 
    628628  s_decoded.i_service_provider_name_length = 0; 
     
    643643 
    644644/* main function */ 
    645 int main(
     645int main(void
    646646{ 
    647647  int i_err = 0; 
    648    
     648 
    649649  i_err |= main_vstream_1(); 
    650650  i_err |= main_vstream_2(); 
  • trunk/src/descriptors/dr_4e.c

    r105 r178  
    131131  { 
    132132    uint8_t *p = &p_descriptor->p_data[0]; 
    133     int i; 
    134133 
    135134    /* Encode data */ 
  • trunk/src/tables/cat.c

    r146 r178  
    335335      if(p_cat_decoder->i_last_section_number) 
    336336      { 
    337         for(i = 0; i <= p_cat_decoder->i_last_section_number - 1; i++) 
     337        for(i = 0; (int)i <= p_cat_decoder->i_last_section_number - 1; i++) 
    338338          p_cat_decoder->ap_sections[i]->p_next = 
    339339                                        p_cat_decoder->ap_sections[i + 1]; 
  • trunk/src/tables/eit.c

    r144 r178  
    531531      uint8_t i_running_status = (uint8_t)(p_byte[10]) >> 5; 
    532532      int b_free_ca = (int)(p_byte[10] & 0x10) >> 4; 
    533       uint16_t i_length = ((uint16_t)(p_byte[10] & 0xf) << 8) | p_byte[11]; 
     533      uint16_t i_ev_length = ((uint16_t)(p_byte[10] & 0xf) << 8) | p_byte[11]; 
    534534      dvbpsi_eit_event_t* p_event = dvbpsi_EITAddEvent(p_eit, 
    535535          i_event_id, i_start_time, i_duration, 
     
    537537      /* Event descriptors */ 
    538538      p_byte += 12; 
    539       p_end = p_byte + i_length; 
     539      p_end = p_byte + i_ev_length; 
    540540      while(p_byte + 2 <= p_end) 
    541541      { 
  • trunk/src/tables/nit.c

    r170 r178  
    463463      if(p_nit_decoder->i_last_section_number) 
    464464      { 
    465         for(i = 0; i <= p_nit_decoder->i_last_section_number - 1; i++) 
     465        for(i = 0; (int)i <= p_nit_decoder->i_last_section_number - 1; i++) 
    466466          p_nit_decoder->ap_sections[i]->p_next = 
    467467                                        p_nit_decoder->ap_sections[i + 1]; 
     
    527527      uint16_t i_ts_id = ((uint16_t)p_byte[0] << 8) | p_byte[1]; 
    528528      uint16_t i_orig_network_id = ((uint16_t)p_byte[2] << 8) | p_byte[3]; 
    529       uint16_t i_length = ((uint16_t)(p_byte[4] & 0x0f) << 8) | p_byte[5]; 
     529      uint16_t i_ts_length = ((uint16_t)(p_byte[4] & 0x0f) << 8) | p_byte[5]; 
    530530      dvbpsi_nit_ts_t* p_ts = dvbpsi_NITAddTS(p_nit, i_ts_id, i_orig_network_id); 
    531531      /* - TS descriptors */ 
    532532      p_byte += 6; 
    533       p_end2 = p_byte + i_length; 
     533      p_end2 = p_byte + i_ts_length; 
    534534      if( p_end2 > p_section->p_payload_end ) 
    535535      { 
  • trunk/src/tables/pat.c

    r108 r178  
    353353      if(p_pat_decoder->i_last_section_number) 
    354354      { 
    355         for(i = 0; i <= p_pat_decoder->i_last_section_number - 1; i++) 
     355        for(i = 0; (int)i <= p_pat_decoder->i_last_section_number - 1; i++) 
    356356          p_pat_decoder->ap_sections[i]->p_next = 
    357357                                        p_pat_decoder->ap_sections[i + 1]; 
  • trunk/src/tables/pmt.c

    r108 r178  
    428428      if(p_pmt_decoder->i_last_section_number) 
    429429      { 
    430         for(i = 0; i <= p_pmt_decoder->i_last_section_number - 1; i++) 
     430        for(i = 0; (int)i <= p_pmt_decoder->i_last_section_number - 1; i++) 
    431431          p_pmt_decoder->ap_sections[i]->p_next = 
    432432                                        p_pmt_decoder->ap_sections[i + 1]; 
     
    483483      uint8_t i_type = p_byte[0]; 
    484484      uint16_t i_pid = ((uint16_t)(p_byte[1] & 0x1f) << 8) | p_byte[2]; 
    485       uint16_t i_length = ((uint16_t)(p_byte[3] & 0x0f) << 8) | p_byte[4]; 
     485      uint16_t i_es_length = ((uint16_t)(p_byte[3] & 0x0f) << 8) | p_byte[4]; 
    486486      dvbpsi_pmt_es_t* p_es = dvbpsi_PMTAddES(p_pmt, i_type, i_pid); 
    487487      /* - ES descriptors */ 
    488488      p_byte += 5; 
    489       p_end = p_byte + i_length; 
     489      p_end = p_byte + i_es_length; 
    490490      if( p_end > p_section->p_payload_end ) 
    491491      { 
  • trunk/src/tables/sdt.c

    r110 r178  
    429429      if(p_sdt_decoder->i_last_section_number) 
    430430      { 
    431         for(i = 0; i <= p_sdt_decoder->i_last_section_number - 1; i++) 
     431        for(i = 0; (int)i <= p_sdt_decoder->i_last_section_number - 1; i++) 
    432432          p_sdt_decoder->ap_sections[i]->p_next = 
    433433                                        p_sdt_decoder->ap_sections[i + 1]; 
     
    474474      uint8_t i_running_status = (uint8_t)(p_byte[3]) >> 5; 
    475475      int b_free_ca = (int)((p_byte[3] & 0x10) >> 4); 
    476       uint16_t i_length = ((uint16_t)(p_byte[3] & 0xf) <<8) | p_byte[4]; 
     476      uint16_t i_srv_length = ((uint16_t)(p_byte[3] & 0xf) <<8) | p_byte[4]; 
    477477      dvbpsi_sdt_service_t* p_service = dvbpsi_SDTAddService(p_sdt, 
    478478          i_service_id, b_eit_schedule, b_eit_present, 
     
    481481      /* Service descriptors */ 
    482482      p_byte += 5; 
    483       p_end = p_byte + i_length; 
     483      p_end = p_byte + i_srv_length; 
    484484      if( p_end > p_section->p_payload_end ) break; 
    485485 
  • trunk/src/tables/tot_private.h

    r170 r178  
    5454 
    5555/***************************************************************************** 
     56 * dvbpsi_ValidTOTSection 
     57 ***************************************************************************** 
     58 * Check the CRC_32 if the section has b_syntax_indicator set. 
     59 *****************************************************************************/ 
     60int dvbpsi_ValidTOTSection(dvbpsi_psi_section_t* p_section); 
     61 
     62/***************************************************************************** 
    5663 * dvbpsi_DecodeTOTSections 
    5764 *****************************************************************************