Commit 1bbcb9f0 authored by Rafaël Carré's avatar Rafaël Carré

cleanup : remove useless headers, not used functions, msg_Err when we don't...

cleanup : remove useless headers, not used functions, msg_Err when we don't have enough memory, add a declaration
parent 13e1b6f4
...@@ -28,14 +28,6 @@ ...@@ -28,14 +28,6 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include "../libvlc.h" #include "../libvlc.h"
#include "vlc_keys.h" #include "vlc_keys.h"
#include "vlc_charset.h"
#include <errno.h> /* errno */
#include <limits.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h> /* getuid() */
#endif
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
# ifdef HAVE_GETOPT_H # ifdef HAVE_GETOPT_H
...@@ -45,23 +37,6 @@ ...@@ -45,23 +37,6 @@
# include "../extras/getopt.h" # include "../extras/getopt.h"
#endif #endif
#if defined(HAVE_GETPWUID)
# include <pwd.h> /* getpwuid() */
#endif
#if defined( HAVE_SYS_STAT_H )
# include <sys/stat.h>
#endif
#if defined( HAVE_SYS_TYPES_H )
# include <sys/types.h>
#endif
#if defined( WIN32 )
# if !defined( UNDER_CE )
# include <direct.h>
# endif
#include <tchar.h>
#endif
#include "configuration.h" #include "configuration.h"
#include "modules/modules.h" #include "modules/modules.h"
...@@ -132,7 +107,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, ...@@ -132,7 +107,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
p_longopts = malloc( sizeof(struct option) * (i_opts + 1) ); p_longopts = malloc( sizeof(struct option) * (i_opts + 1) );
if( p_longopts == NULL ) if( p_longopts == NULL )
{ {
msg_Err( p_this, "out of memory" );
vlc_list_release( p_list ); vlc_list_release( p_list );
return -1; return -1;
} }
...@@ -140,7 +114,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, ...@@ -140,7 +114,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
psz_shortopts = malloc( sizeof( char ) * (2 * i_opts + 1) ); psz_shortopts = malloc( sizeof( char ) * (2 * i_opts + 1) );
if( psz_shortopts == NULL ) if( psz_shortopts == NULL )
{ {
msg_Err( p_this, "out of memory" );
free( p_longopts ); free( p_longopts );
vlc_list_release( p_list ); vlc_list_release( p_list );
return -1; return -1;
...@@ -154,7 +127,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, ...@@ -154,7 +127,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
argv_copy = (const char**)malloc( *pi_argc * sizeof(char *) ); argv_copy = (const char**)malloc( *pi_argc * sizeof(char *) );
if( argv_copy == NULL ) if( argv_copy == NULL )
{ {
msg_Err( p_this, "out of memory" );
free( psz_shortopts ); free( psz_shortopts );
free( p_longopts ); free( p_longopts );
vlc_list_release( p_list ); vlc_list_release( p_list );
......
...@@ -39,14 +39,6 @@ ...@@ -39,14 +39,6 @@
# include <unistd.h> /* getuid() */ # include <unistd.h> /* getuid() */
#endif #endif
#ifdef HAVE_GETOPT_LONG
# ifdef HAVE_GETOPT_H
# include <getopt.h> /* getopt() */
# endif
#else
# include "../extras/getopt.h"
#endif
#if defined(HAVE_GETPWUID) #if defined(HAVE_GETPWUID)
# include <pwd.h> /* getpwuid() */ # include <pwd.h> /* getpwuid() */
#endif #endif
...@@ -72,11 +64,6 @@ static inline char *strdupnull (const char *src) ...@@ -72,11 +64,6 @@ static inline char *strdupnull (const char *src)
return src ? strdup (src) : NULL; 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) */ /* Item types that use a string value (i.e. serialized in the module cache) */
int IsConfigStringType (int type) int IsConfigStringType (int type)
{ {
...@@ -729,6 +716,8 @@ char *config_GetHomeDir( void ) ...@@ -729,6 +716,8 @@ char *config_GetHomeDir( void )
* - on windows that's the App Data directory; * - on windows that's the App Data directory;
* - on other OSes it's the same as the home 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 ) char *config_GetUserDir( void )
{ {
return GetDir( VLC_TRUE ); return GetDir( VLC_TRUE );
......
...@@ -45,12 +45,6 @@ static inline char *strdupnull (const char *src) ...@@ -45,12 +45,6 @@ static inline char *strdupnull (const char *src)
return src ? strdup (src) : NULL; 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 ) static FILE *config_OpenConfigFile( vlc_object_t *p_obj, const char *mode )
{ {
char *psz_filename = p_obj->p_libvlc->psz_configfile; char *psz_filename = p_obj->p_libvlc->psz_configfile;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment