Changeset 1a4ae5679d635d3393cdd9747ce42730c15d20f0

Show
Ignore:
Timestamp:
06/08/05 21:09:54 (3 years ago)
Author:
Cyril Deguet <asmax@videolan.org>
git-committer:
Cyril Deguet <asmax@videolan.org> 1123355394 +0000
git-parent:

[9bcabfdad2c9d6a9a6da67e9395367da180c7b78]

git-author:
Cyril Deguet <asmax@videolan.org> 1123355394 +0000
Message:
  • charset.c: don't return a pointer to a buffer allocated on the stack!
  • all: removed some warnings
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/skins2/controls/ctrl_list.cpp

    rfe087a3 r1a4ae56  
    4040#endif 
    4141 
    42 #define SCROLL_STEP 0.05 
     42#define SCROLL_STEP 0.05f 
    4343#define LINE_INTERVAL 1  // Number of pixels inserted between 2 lines 
    4444 
  • modules/gui/skins2/controls/ctrl_slider.cpp

    rfe087a3 r1a4ae56  
    3636 
    3737#define RANGE 40 
    38 #define SCROLL_STEP 0.05 
     38#define SCROLL_STEP 0.05f 
    3939 
    4040 
  • modules/gui/skins2/src/skin_common.hpp

    rfe087a3 r1a4ae56  
    4545#ifndef M_PI 
    4646#   define M_PI 3.14159265358979323846 
     47#endif 
     48 
     49#ifdef _MSC_VER 
     50// turn off 'warning C4355: 'this' : used in base member initializer list' 
     51#pragma warning ( disable:4355 ) 
    4752#endif 
    4853 
  • src/extras/getopt.c

    r22f2fa6 r1a4ae56  
    216216/* Avoid depending on library functions or files 
    217217   whose names are inconsistent.  */ 
    218  
    219 char *getenv(); 
    220218 
    221219static char * 
  • src/libvlc.c

    r9bcabfd r1a4ae56  
    259259    playlist_t  *p_playlist; 
    260260    vlc_value_t  val; 
     261#if defined( ENABLE_NLS ) \ 
     262     && ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) ) 
    261263    char *       psz_language; 
     264#endif 
    262265 
    263266    if( !p_vlc ) 
  • src/misc/charset.c

    rf9d13dd r1a4ae56  
    204204/* Returns charset from "language_COUNTRY.charset@modifier" string */ 
    205205#if defined WIN32 || defined OS2 || !HAVE_LANGINFO_CODESET 
    206 static const char *vlc_encoding_from_locale( char *psz_locale
     206static void vlc_encoding_from_locale( char *psz_locale, char *psz_charset
    207207{ 
    208208    char *psz_dot = strchr( psz_locale, '.' ); 
     
    211211    { 
    212212        const char *psz_modifier; 
    213         char buf[2 + 10 + 1]; 
    214213 
    215214        psz_dot++; 
     
    219218 
    220219        if( psz_modifier == NULL ) 
    221             return psz_dot; 
     220        { 
     221            strcpy( psz_charset, psz_dot ); 
     222            return; 
     223        } 
    222224        if( 0 < ( psz_modifier - psz_dot ) 
    223              && ( psz_modifier - psz_dot ) < sizeof( buf )
    224         { 
    225             memcpy( buf, psz_dot, psz_modifier - psz_dot ); 
    226             buf[ psz_modifier - psz_dot ] = '\0'; 
    227             return buf
     225             && ( psz_modifier - psz_dot ) < 2 + 10 + 1
     226        { 
     227            memcpy( psz_charset, psz_dot, psz_modifier - psz_dot ); 
     228            psz_charset[ psz_modifier - psz_dot ] = '\0'; 
     229            return
    228230        } 
    229231    } 
    230232    /* try language mapping */ 
    231     return vlc_encoding_from_language( psz_locale ); 
     233    strcpy( psz_charset, vlc_encoding_from_language( psz_locale ) ); 
    232234} 
    233235#endif 
     
    245247    /* On old systems which lack it, use setlocale or getenv.  */ 
    246248    const char *psz_locale = NULL; 
     249    char buf[2 + 10 + 1]; 
    247250 
    248251    /* But most old systems don't have a complete set of locales.  Some 
     
    266269    /* On some old systems, one used to set locale = "iso8859_1". On others, 
    267270     * you set it to "language_COUNTRY.charset". Darwin only has LANG :( */ 
    268     psz_codeset = vlc_encoding_from_locale( (char *)psz_locale ); 
     271    vlc_encoding_from_locale( (char *)psz_locale, buf ); 
     272    psz_codeset =  buf; 
    269273# endif /* HAVE_LANGINFO_CODESET */ 
    270274 
     
    299303    } 
    300304    if( psz_locale != NULL && psz_locale[0] != '\0' ) 
    301         psz_codeset = vlc_encoding_from_locale( psz_locale ); 
     305        vlc_encoding_from_locale( psz_locale, buf ); 
     306        psz_codeset = buf; 
    302307    else 
    303308    {