Changeset 7f42e055f359bbb4d136c1b5c554baa2b23b52a2

Show
Ignore:
Timestamp:
10/21/07 13:06:37 (11 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1192964797 +0000
git-parent:

[6ea1a2709641da5ec5c27367ff9110823fc08c82]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1192964797 +0000
Message:

Changing the order of parameters may be needed, but changing the parameters themselves is definitely not (it would crash in some cases anyway): add some const qualifiers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/main.h

    r6144922 r7f42e05  
    3838    /* Global properties */ 
    3939    int                    i_argc;           ///< command line arguments count 
    40     char **                ppsz_argv;        ///< command line arguments 
     40    const char **          ppsz_argv;        ///< command line arguments 
    4141 
    4242    char *                 psz_homedir;      ///< user's home directory 
  • include/vlc/vlc.h

    rf20aa2b r7f42e05  
    251251 *  \return VLC_SUCCESS on success 
    252252 */ 
    253 VLC_PUBLIC_API int     VLC_Init( int, int, char *[] ); 
     253VLC_PUBLIC_API int     VLC_Init( int, int, const char *[] ); 
    254254 
    255255/** 
  • src/control/core.c

    r7d25008 r7f42e05  
    9191    if( !p_new ) RAISENULL( "Out of memory" ); 
    9292 
     93    const char *my_argv[argc + 2]; 
     94 
     95    my_argv[0] = "libvlc"; /* dummy arg0, skipped by getopt() et al */ 
     96    for( int i = 0; i < argc; i++ ) 
     97         my_argv[i + 1] = argv[i]; 
     98    my_argv[argc + 1] = NULL; /* C calling conventions require a NULL */ 
     99 
    93100    /** \todo Look for interface settings. If we don't have any, add -I dummy */ 
    94101    /* Because we probably don't want a GUI by default */ 
    95102 
    96     if( libvlc_InternalInit( p_libvlc_int, argc, argv ) ) 
     103    if( libvlc_InternalInit( p_libvlc_int, argc + 1, my_argv ) ) 
    97104        RAISENULL( "VLC initialization failed" ); 
    98105 
  • src/control/libvlc_internal.h

    r7b32ae1 r7f42e05  
    4040 ***************************************************************************/ 
    4141VLC_EXPORT (libvlc_int_t *, libvlc_InternalCreate, ( void ) ); 
    42 VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, char *ppsz_argv[] ) ); 
     42VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, const char *ppsz_argv[] ) ); 
    4343VLC_EXPORT (int, libvlc_InternalCleanup, ( libvlc_int_t * ) ); 
    4444VLC_EXPORT (int, libvlc_InternalDestroy, ( libvlc_int_t *, vlc_bool_t ) ); 
  • src/libvlc-common.c

    r1995f88 r7f42e05  
    106106#endif 
    107107static inline int LoadMessages (void); 
    108 static int  GetFilenames  ( libvlc_int_t *, int, char *[] ); 
     108static int  GetFilenames  ( libvlc_int_t *, int, const char *[] ); 
    109109static void Help          ( libvlc_int_t *, char const *psz_help_name ); 
    110110static void Usage         ( libvlc_int_t *, char const *psz_module_name ); 
     
    236236 *  - configuration and commandline parsing 
    237237 */ 
    238 int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, char *ppsz_argv[] ) 
     238int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, 
     239                         const char *ppsz_argv[] ) 
    239240{ 
    240241    char         p_capabilities[200]; 
     
    12391240 * An option always follows its associated input and begins with a ":". 
    12401241 *****************************************************************************/ 
    1241 static int GetFilenames( libvlc_int_t *p_vlc, int i_argc, char *ppsz_argv[] ) 
     1242static int GetFilenames( libvlc_int_t *p_vlc, int i_argc, const char *ppsz_argv[] ) 
    12421243{ 
    12431244    int i_opt, i_options; 
     
    12601261 
    12611262        VLC_AddTarget( p_vlc->i_object_id, ppsz_argv[i_opt], 
    1262                        (char const **)( i_options ? &ppsz_argv[i_opt + 1] : 
     1263                       ( i_options ? &ppsz_argv[i_opt + 1] : 
    12631264                                        NULL ), i_options, 
    12641265                       PLAYLIST_INSERT, 0 ); 
  • src/libvlc.c

    r1502ec1 r7f42e05  
    116116 *  - configuration and commandline parsing 
    117117 *****************************************************************************/ 
    118 int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) 
     118int VLC_Init( int i_object, int i_argc, const char *ppsz_argv[] ) 
    119119{ 
    120120    int i_ret; 
  • src/modules/configuration.c

    rb3bc5c6 r7f42e05  
    14021402 * options used (ie. exported) by each module. 
    14031403 *****************************************************************************/ 
    1404 int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], 
     1404int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, 
     1405                          const char *ppsz_argv[], 
    14051406                          vlc_bool_t b_ignore_errors ) 
    14061407{ 
     
    14811482    if( b_ignore_errors ) 
    14821483    { 
    1483         ppsz_argv = (char**)malloc( *pi_argc * sizeof(char *) ); 
     1484        ppsz_argv = (const char**)malloc( *pi_argc * sizeof(char *) ); 
    14841485        if( ppsz_argv == NULL ) 
    14851486        { 
     
    15891590    opterr = 0; 
    15901591    optind = 0; /* set to 0 to tell GNU getopt to reinitialize */ 
    1591     while( ( i_cmd = getopt_long( *pi_argc, ppsz_argv, psz_shortopts, 
     1592    while( ( i_cmd = getopt_long( *pi_argc, (char **)ppsz_argv, psz_shortopts, 
    15921593                                  p_longopts, &i_index ) ) != -1 ) 
    15931594    { 
  • src/modules/configuration.h

    r62ffefd r7f42e05  
    4343#define config_LoadConfigFile(a,b) __config_LoadConfigFile(VLC_OBJECT(a),b) 
    4444 
    45 int __config_LoadCmdLine   ( vlc_object_t *, int *, char *[], vlc_bool_t ); 
     45int __config_LoadCmdLine   ( vlc_object_t *, int *, const char *[], vlc_bool_t ); 
    4646char *config_GetHomeDir    ( void ); 
    4747char *config_GetConfigDir  ( libvlc_int_t * ); 
  • src/vlc.c

    r892e5a5 r7f42e05  
    6060 * main: parse command line, start interface and spawn threads. 
    6161 *****************************************************************************/ 
    62 int main( int i_argc, char *ppsz_argv[] ) 
     62int main( int i_argc, const char *ppsz_argv[] ) 
    6363{ 
    6464    int i_ret;