* Fix a couple of const, static and other warnings
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 14 Dec 2006 00:14:37 +0000 (00:14 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 14 Dec 2006 00:14:37 +0000 (00:14 +0000)
src/audio_output/input.c
src/misc/image.c
src/misc/threads.c
src/stream_output/profiles.c
src/stream_output/stream_output.c
src/text/charset.c

index 192ac94..47d3417 100644 (file)
@@ -650,8 +650,8 @@ static void inputFailure( aout_instance_t * p_aout, aout_input_t * p_input,
     p_input->b_error = 1;
 }
 
-static int ChangeFiltersString( aout_instance_t * p_aout, char* psz_variable,
-                                 char *psz_name, vlc_bool_t b_add )
+static int ChangeFiltersString( aout_instance_t * p_aout, const char* psz_variable,
+                                 const char *psz_name, vlc_bool_t b_add )
 {
     vlc_value_t val;
     char *psz_parser;
index e5b3266..a751a8d 100644 (file)
@@ -242,7 +242,7 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
  *
  */
 
-void PicRelease( picture_t *p_pic ){};
+static void PicRelease( picture_t *p_pic ){};
 
 static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic,
                             video_format_t *p_fmt_in,
@@ -500,7 +500,7 @@ static picture_t *ImageFilter( image_handler_t *p_image, picture_t *p_pic,
 static struct
 {
     vlc_fourcc_t i_codec;
-    char *psz_ext;
+    const char *psz_ext;
 
 } ext_table[] =
 {
index c2c8ef9..da17ec9 100644 (file)
@@ -332,7 +332,7 @@ int __vlc_mutex_destroy( const char * psz_file, int i_line, vlc_mutex_t *p_mutex
     i_result = pthread_mutex_destroy( &p_mutex->mutex );
     if( i_result )
     {
-        i_thread = (int)pthread_self();
+        i_thread = CAST_PTHREAD_TO_INT(pthread_self());
         psz_error = strerror(i_result);
     }
 
@@ -482,7 +482,7 @@ int __vlc_cond_destroy( const char * psz_file, int i_line, vlc_cond_t *p_condvar
     i_result = pthread_cond_destroy( &p_condvar->cond );
     if( i_result )
     {
-        i_thread = (int)pthread_self();
+        i_thread = CAST_PTHREAD_TO_INT(pthread_self());
         psz_error = strerror(i_result);
     }
 
index 7dc344e..9a1a32b 100644 (file)
@@ -441,7 +441,8 @@ static char * ChainToPsz( sout_chain_t *p_chain, vlc_bool_t b_root )
     char psz_output[MAX_CHAIN];
     char psz_temp[MAX_CHAIN];
     if( b_root ) sprintf( psz_output, "#" );
-    else sprintf( psz_output, "" );
+    else psz_output[0] = '\0';
+
     for( i = 0 ; i< p_chain->i_modules; i++ )
     {
         sout_module_t *p_module = p_chain->pp_modules[i];
index ed37472..adbb23d 100644 (file)
@@ -62,7 +62,7 @@ typedef struct
 } mrl_t;
 
 /* mrl_Parse: parse psz_mrl and fill p_mrl */
-static int  mrl_Parse( mrl_t *p_mrl, char *psz_mrl );
+static int  mrl_Parse( mrl_t *p_mrl, const char *psz_mrl );
 /* mrl_Clean: clean p_mrl  after a call to mrl_Parse */
 static void mrl_Clean( mrl_t *p_mrl );
 
@@ -605,13 +605,13 @@ void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
 /*****************************************************************************
  *
  *****************************************************************************/
-static int mrl_Parse( mrl_t *p_mrl, char *psz_mrl )
+static int mrl_Parse( mrl_t *p_mrl, const char *psz_mrl )
 {
     char * psz_dup = strdup( psz_mrl );
     char * psz_parser = psz_dup;
-    char * psz_access = "";
-    char * psz_way = "";
-    char * psz_name = "";
+    char * psz_access;
+    char * psz_way;
+    char * psz_name;
 
     /* *** first parse psz_dest */
     while( *psz_parser && *psz_parser != ':' )
index 5d11911..8f0a4ac 100644 (file)
@@ -365,9 +365,8 @@ char *vlc_fix_readdir( const char *psz_string )
         *psz_out = '\0';
         return psz_utf8;
     }
-#else
-    return strdup( psz_string );
 #endif
+    return strdup( psz_string );
 }