Fix a bunch of warnings and errors
authorClément Stenac <zorglub@videolan.org>
Thu, 3 Aug 2006 16:58:10 +0000 (16:58 +0000)
committerClément Stenac <zorglub@videolan.org>
Thu, 3 Aug 2006 16:58:10 +0000 (16:58 +0000)
modules/control/http/macro.c
modules/control/http/rpn.c
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.h
modules/demux/playlist/dvb.c
modules/demux/playlist/gvp.c
modules/demux/playlist/shoutcast.c
modules/misc/freetype.c
modules/misc/logger.c
modules/misc/rtsp.c
modules/video_chroma/i420_rgb8.c

index bab1964..41c239f 100644 (file)
@@ -725,7 +725,7 @@ void E_(MacroDo)( httpd_file_sys_t *p_args,
                 case MVLC_FLOAT:
                     f = config_GetFloat( p_intf, m->param1 );
                     div = lldiv( f * 1000000 , 1000000 );
-                    sprintf( value, I64Fd".%06u", div.quot,
+                    sprintf( value, "%lld.%06u", div.quot,
                             (unsigned int)div.rem );
                     break;
                 case MVLC_STRING:
index 0bf7e10..57ae1ab 100644 (file)
@@ -698,7 +698,7 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
                 {
                     char psz_value[20];
                     lldiv_t value = lldiv( val.f_float * 1000000, 1000000 );
-                    snprintf( psz_value, sizeof(psz_value), I64Fd".%06u",
+                    snprintf( psz_value, sizeof(psz_value), "%lld.%06u",
                                     value.quot, (unsigned int)value.rem );
                     E_(SSPush)( st, psz_value );
                     break;
@@ -795,7 +795,7 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
                 char psz_string[20];
                 lldiv_t value = lldiv( config_GetFloat( p_intf, psz_variable )
                                        * 1000000, 1000000 );
-                snprintf( psz_string, sizeof(psz_string), I64Fd".%06u",
+                snprintf( psz_string, sizeof(psz_string), "%lld.%06u",
                           value.quot, (unsigned int)value.rem );
                 E_(SSPush)( st, psz_string );
                 break;
@@ -988,7 +988,7 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
                     psz_val = vlc_input_item_GetInfo( p_item,
                                 _(VLC_META_INFO_CAT), _(VLC_META_TITLE) );
                     if( psz_val == NULL )
-                        psz_val == strdup( p_item->psz_name );
+                        psz_val = strdup( p_item->psz_name );
                 }
                 else if( !strcmp( psz_meta, "ALBUM" ) )
                 {
index 89de164..9325943 100644 (file)
@@ -67,9 +67,9 @@
 #define MP4_GETSTRINGZ( p_str ) \
     if( ( i_read > 0 )&&(p_peek[0] ) ) \
     { \
-        p_str = calloc( sizeof( char ), __MIN( strlen( p_peek ), i_read )+1);\
-        memcpy( p_str, p_peek, __MIN( strlen( p_peek ), i_read ) ); \
-        p_str[__MIN( strlen( p_peek ), i_read )] = 0; \
+        p_str = calloc( sizeof( char ), __MIN( strlen( (char*)p_peek ), i_read )+1);\
+        memcpy( p_str, p_peek, __MIN( strlen( (char*)p_peek ), i_read ) ); \
+        p_str[__MIN( strlen( (char*)p_peek ), i_read )] = 0; \
         p_peek += strlen( p_str ) + 1; \
         i_read -= strlen( p_str ) + 1; \
     } \
 
 
 #define MP4_READBOX_ENTER( MP4_Box_data_TYPE_t ) \
-    int64_t  i_read = p_box->i_size; \
+    uint64_t  i_read = p_box->i_size; \
     uint8_t *p_peek, *p_buff; \
-    i_read = p_box->i_size; \
+    int i_actually_read; \
     if( !( p_peek = p_buff = malloc( i_read ) ) ) \
     { \
         return( 0 ); \
     } \
-    if( stream_Read( p_stream, p_peek, i_read ) < i_read )\
+    i_actually_read = stream_Read( p_stream, p_peek, i_read ); \
+    if( i_actually_read < 0 || (uint64_t)i_actually_read < i_read )\
     { \
         free( p_buff ); \
         return( 0 ); \
@@ -817,7 +818,7 @@ static void MP4_FreeBox_ctts( MP4_Box_t *p_box )
     FREENULL( p_box->data.p_ctts->i_sample_offset );
 }
 
-static int MP4_ReadLengthDescriptor( uint8_t **pp_peek, int64_t  *i_read )
+static int MP4_ReadLengthDescriptor( uint8_t **pp_peek, uint64_t  *i_read )
 {
     unsigned int i_b;
     unsigned int i_len = 0;
@@ -2070,7 +2071,7 @@ static int MP4_ReadBox_drms( stream_t *p_stream, MP4_Box_t *p_box )
 
 static int MP4_ReadBox_0xa9xxx( stream_t *p_stream, MP4_Box_t *p_box )
 {
-    int16_t i_length, i_dummy;
+    uint16_t i_length, i_dummy;
 
     MP4_READBOX_ENTER( MP4_Box_data_0xa9xxx_t );
 
index a0d4186..e60618a 100644 (file)
@@ -349,7 +349,7 @@ typedef struct MP4_Box_data_url_s
     uint8_t  i_version;
     uint32_t i_flags;
 
-    unsigned char *psz_location;
+    char *psz_location;
 
 } MP4_Box_data_url_t;
 
@@ -358,8 +358,8 @@ typedef struct MP4_Box_data_urn_s
     uint8_t  i_version;
     uint32_t i_flags;
 
-    unsigned char *psz_name;
-    unsigned char *psz_location;
+    char *psz_name;
+    char *psz_location;
 
 } MP4_Box_data_urn_t;
 
@@ -651,7 +651,7 @@ typedef struct MP4_Box_data_cprt_s
     /* 1 pad bit */
     unsigned char i_language[3];
 
-    unsigned char *psz_notice;
+    char *psz_notice;
 } MP4_Box_data_cprt_t;
 
 
index cc4d905..403d5e3 100644 (file)
@@ -99,7 +99,6 @@ static int Demux( demux_t *p_demux )
 
     while( (psz_line = stream_ReadLine( p_demux->s )) )
     {
-        playlist_item_t *p_item;
         char **ppsz_options = NULL;
         int  i, i_options = 0;
         char *psz_name = NULL;
index 2d7efaf..8064cde 100644 (file)
@@ -66,7 +66,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
 int E_(Import_GVP)( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    int i_size;
     byte_t *p_peek;
 
     CHECK_PEEK( p_peek, 12 );
index 36986aa..d47e413 100644 (file)
@@ -395,7 +395,6 @@ static int DemuxStation( demux_t *p_demux )
                     ( psz_base || ( psz_rt && psz_load &&
                     ( p_sys->b_adult || strcmp( psz_rt, "NC17" ) ) ) ) )
                 {
-                    playlist_item_t *p_item;
                     char *psz_mrl = NULL;
                     if( psz_rt || psz_load )
                     {
index 0f0869f..691c597 100644 (file)
@@ -754,12 +754,12 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
     }
 
     {
-        char *p_in_buffer, *p_out_buffer;
+        char *p_out_buffer;
+        const char *p_in_buffer = psz_string;
         size_t i_in_bytes, i_out_bytes, i_out_bytes_left, i_ret;
         i_in_bytes = strlen( psz_string );
         i_out_bytes = i_in_bytes * sizeof( uint32_t );
         i_out_bytes_left = i_out_bytes;
-        p_in_buffer = psz_string;
         p_out_buffer = (char *)psz_unicode;
         i_ret = vlc_iconv( iconv_handle, &p_in_buffer, &i_in_bytes,
                            &p_out_buffer, &i_out_bytes_left );
index 8a0ee53..d9c7dc1 100644 (file)
@@ -449,7 +449,7 @@ static void DoRRD( intf_thread_t *p_intf )
         lldiv_t dout = lldiv( p_playlist->p_stats->f_output_bitrate * 1000000,
                              1000 );
         fprintf( p_intf->p_sys->p_rrd,
-                   I64Fi":"I64Fd".%03u:"I64Fd".%03u:"I64Fd".%03u\n",
+                   I64Fi":%lld.%03u:%lld.%03u:%lld.%03u\n",
                    p_intf->p_sys->last_update/1000000,
                    din.quot, (unsigned int)din.rem,
                    ddm.quot, (unsigned int)ddm.rem,
index f2ec341..ac1ae92 100644 (file)
@@ -1291,7 +1291,7 @@ static char *SDPGenerate( const vod_media_t *p_media, httpd_client_t *cl )
     if( p_media->i_length > 0 )
     {
         lldiv_t d = lldiv( p_media->i_length / 1000, 1000 );
-        p += sprintf( p, "a=range:npt=0-"I64Fd".%03u\r\n", d.quot,
+        p += sprintf( p, "a=range:npt=0-%lld.%03u\r\n", d.quot,
                       (unsigned)d.rem );
     }
 
index fd47756..e5fae8f 100644 (file)
@@ -47,7 +47,7 @@ void E_(I420_RGB8)( vout_thread_t *p_vout, picture_t *p_src, picture_t *p_dest )
     uint8_t *p_v   = p_src->V_PIXELS;
 
     vlc_bool_t  b_hscale;                         /* horizontal scaling type */
-    unsigned int i_vscale;                          /* vertical scaling type */
+    int i_vscale;                                 /* vertical scaling type */
     unsigned int i_x, i_y;                /* horizontal and vertical indexes */
     unsigned int i_real_y;                                          /* y % 4 */
     int          i_right_margin;