From: Rafaël Carré Date: Mon, 10 Mar 2008 23:18:30 +0000 (+0100) Subject: cleanup : remove useless headers, not used functions, msg_Err when we don't have... X-Git-Tag: 0.9.0-test0~2195 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1bbcb9f0db5392f291b31f03db9048e18db4e4bf;p=vlc cleanup : remove useless headers, not used functions, msg_Err when we don't have enough memory, add a declaration --- diff --git a/src/config/cmdline.c b/src/config/cmdline.c index d0df45822b..060b7efb15 100644 --- a/src/config/cmdline.c +++ b/src/config/cmdline.c @@ -28,14 +28,6 @@ #include #include "../libvlc.h" #include "vlc_keys.h" -#include "vlc_charset.h" - -#include /* errno */ -#include - -#ifdef HAVE_UNISTD_H -# include /* getuid() */ -#endif #ifdef HAVE_GETOPT_LONG # ifdef HAVE_GETOPT_H @@ -45,23 +37,6 @@ # include "../extras/getopt.h" #endif -#if defined(HAVE_GETPWUID) -# include /* getpwuid() */ -#endif - -#if defined( HAVE_SYS_STAT_H ) -# include -#endif -#if defined( HAVE_SYS_TYPES_H ) -# include -#endif -#if defined( WIN32 ) -# if !defined( UNDER_CE ) -# include -# endif -#include -#endif - #include "configuration.h" #include "modules/modules.h" @@ -132,7 +107,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, p_longopts = malloc( sizeof(struct option) * (i_opts + 1) ); if( p_longopts == NULL ) { - msg_Err( p_this, "out of memory" ); vlc_list_release( p_list ); return -1; } @@ -140,7 +114,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, psz_shortopts = malloc( sizeof( char ) * (2 * i_opts + 1) ); if( psz_shortopts == NULL ) { - msg_Err( p_this, "out of memory" ); free( p_longopts ); vlc_list_release( p_list ); return -1; @@ -154,7 +127,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, argv_copy = (const char**)malloc( *pi_argc * sizeof(char *) ); if( argv_copy == NULL ) { - msg_Err( p_this, "out of memory" ); free( psz_shortopts ); free( p_longopts ); vlc_list_release( p_list ); diff --git a/src/config/core.c b/src/config/core.c index 116f44257c..0241713a88 100644 --- a/src/config/core.c +++ b/src/config/core.c @@ -39,14 +39,6 @@ # include /* getuid() */ #endif -#ifdef HAVE_GETOPT_LONG -# ifdef HAVE_GETOPT_H -# include /* getopt() */ -# endif -#else -# include "../extras/getopt.h" -#endif - #if defined(HAVE_GETPWUID) # include /* getpwuid() */ #endif @@ -72,11 +64,6 @@ static inline char *strdupnull (const char *src) return src ? strdup (src) : NULL; } -static inline char *_strdupnull (const char *src) -{ - return src ? strdup (_(src)) : NULL; -} - /* Item types that use a string value (i.e. serialized in the module cache) */ int IsConfigStringType (int type) { @@ -729,6 +716,8 @@ char *config_GetHomeDir( void ) * - on windows that's the App Data directory; * - on other OSes it's the same as the home directory. */ +char *config_GetUserDir( void ); /* XXX why does gcc wants a declaration ? + * --funman */ char *config_GetUserDir( void ) { return GetDir( VLC_TRUE ); diff --git a/src/config/file.c b/src/config/file.c index 5a1286cf74..61ef356481 100644 --- a/src/config/file.c +++ b/src/config/file.c @@ -45,12 +45,6 @@ static inline char *strdupnull (const char *src) return src ? strdup (src) : NULL; } -static inline char *_strdupnull (const char *src) -{ - return src ? strdup (_(src)) : NULL; -} - - static FILE *config_OpenConfigFile( vlc_object_t *p_obj, const char *mode ) { char *psz_filename = p_obj->p_libvlc->psz_configfile;