]> git.sesse.net Git - vlc/commitdiff
system_Init(): remove unused arguments
authorRafaël Carré <rafael.carre@gmail.com>
Wed, 15 Jun 2011 04:29:25 +0000 (00:29 -0400)
committerRafaël Carré <rafael.carre@gmail.com>
Wed, 15 Jun 2011 21:09:56 +0000 (17:09 -0400)
darwin relied on argv[0] as a fallback to retrieve executable name,
but this can't work anymore as:
- libvlc_new() can be given anything as argc/argv
- libvlc_new() inserts "libvlc" at position 0 anyway

src/libvlc.c
src/libvlc.h
src/posix/darwin_specific.c
src/posix/linux_specific.c
src/posix/specific.c
src/win32/specific.c

index 6097529d069020467fa11de3a42959df6b43e81b..c53d6be958b7d1be8d1a5b57673e94a045d6ec0c 100644 (file)
@@ -268,7 +268,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
 #endif
 
     /* System specific initialization code */
-    system_Init( p_libvlc, &i_argc, ppsz_argv );
+    system_Init();
 
     /*
      * Support for gettext
index 99fc643f4f1975324651ad3f1405824994e69831..c702cc04a8084ecb039961367da1b54f527f6f06 100644 (file)
@@ -37,7 +37,7 @@ size_t vlc_towc (const char *str, uint32_t *restrict pwc);
 /*
  * OS-specific initialization
  */
-void system_Init      ( libvlc_int_t *, int *, const char *[] );
+void system_Init      ( void );
 void system_Configure ( libvlc_int_t *, int, const char *const [] );
 void system_End       ( libvlc_int_t * );
 
index 810bd1b27ae175a7935d64dddd90eff13edf6154..9dead944acbb58eb1ae504538ba499b64e16abb9 100644 (file)
 /*****************************************************************************
  * system_Init: fill in program path & retrieve language
  *****************************************************************************/
-void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
+void system_Init(void)
 {
-    VLC_UNUSED(p_this);
     char i_dummy;
     char *p_char = NULL;
     char *p_oldchar = &i_dummy;
     unsigned int i;
-    (void)pi_argc;
 
     /* Get the full program path and name */
     /* First try to see if we are linked to the framework */
@@ -107,11 +105,6 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
         if ( !_NSGetExecutablePath(path, &path_len) )
             p_char = strdup(path);
     }
-    if( !p_char )
-    {
-        /* We are not linked to the VLC.framework, return the executable path */
-        p_char = strdup( ppsz_argv[ 0 ] );
-    }
 
     free(psz_vlcpath);
     psz_vlcpath = p_char;
index 1644ce62133cdbeca5c8f16b97e3ace0b0df2cf4..11dd6d66c0563255ff36106fecc93ec48340de0a 100644 (file)
@@ -88,7 +88,7 @@ static struct
 # include <stdlib.h>
 #endif
 
-void system_Init (libvlc_int_t *libvlc, int *argc, const char *argv[])
+void system_Init (void)
 {
 #ifdef __GLIBC__
     const char *glcv = gnu_get_libc_version ();
@@ -111,8 +111,6 @@ void system_Init (libvlc_int_t *libvlc, int *argc, const char *argv[])
     if (once.refs++ == 0)
         set_libvlc_path ();
     vlc_mutex_unlock (&once.lock);
-
-    (void)libvlc; (void)argc; (void)argv;
 }
 
 void system_Configure (libvlc_int_t *libvlc,
index df917c1ef32d74b6b4caf1ea9a1f6554bdb2e5eb..cd53a96e7fdabde0fe6239cb2bbe687ba89a63a0 100644 (file)
@@ -31,12 +31,11 @@ static void set_libvlc_path (void)
     psz_vlcpath = (char *)PKGLIBDIR;
 }
 
-void system_Init (libvlc_int_t *libvlc, int *argc, const char *argv[])
+void system_Init (void)
 {
     pthread_once_t once = PTHREAD_ONCE_INIT;
 
     pthread_once (&once, set_libvlc_path);
-    (void)libvlc; (void)argc; (void)argv;
 }
 
 void system_Configure (libvlc_int_t *libvlc,
index 7a47e82453486d7b98fd8d5873b6bd7f8d12dccf..3a4d0a15926aba909e5ac78b4720b75dc6a68edb 100644 (file)
@@ -44,9 +44,8 @@
 /*****************************************************************************
  * system_Init: initialize winsock and misc other things.
  *****************************************************************************/
-void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
+void system_Init( void )
 {
-    VLC_UNUSED( p_this ); VLC_UNUSED( pi_argc ); VLC_UNUSED( ppsz_argv );
     WSADATA Data;
     MEMORY_BASIC_INFORMATION mbi;