mirror of https://github.com/mpv-player/mpv
remove all setlocale calls, they break the behaviour of sscanf and
strcasecmp, especially with tr_TR locale - and do not seem to be good for anything. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14543 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
6974dfae6b
commit
6e450282a6
20
Gui/cfg.c
20
Gui/cfg.c
|
@ -10,10 +10,6 @@
|
||||||
#include "../m_config.h"
|
#include "../m_config.h"
|
||||||
#include "../m_option.h"
|
#include "../m_option.h"
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../../libvo/video_out.h"
|
#include "../../libvo/video_out.h"
|
||||||
|
|
||||||
#include "cfg.h"
|
#include "cfg.h"
|
||||||
|
@ -208,10 +204,6 @@ int cfg_read( void )
|
||||||
char * cfg = get_path( "gui.conf" );
|
char * cfg = get_path( "gui.conf" );
|
||||||
FILE * f;
|
FILE * f;
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_ALL,"C" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// -- read configuration
|
// -- read configuration
|
||||||
mp_msg( MSGT_GPLAYER,MSGL_V,"[cfg] reading config file: %s\n",cfg );
|
mp_msg( MSGT_GPLAYER,MSGL_V,"[cfg] reading config file: %s\n",cfg );
|
||||||
gui_conf=m_config_new();
|
gui_conf=m_config_new();
|
||||||
|
@ -272,10 +264,6 @@ int cfg_read( void )
|
||||||
}
|
}
|
||||||
free( cfg );
|
free( cfg );
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_ALL,"" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,10 +273,6 @@ int cfg_write( void )
|
||||||
FILE * f;
|
FILE * f;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_ALL,"C" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// -- save configuration
|
// -- save configuration
|
||||||
if ( (f=fopen( cfg,"wt+" )) )
|
if ( (f=fopen( cfg,"wt+" )) )
|
||||||
{
|
{
|
||||||
|
@ -348,10 +332,6 @@ int cfg_write( void )
|
||||||
}
|
}
|
||||||
free( cfg );
|
free( cfg );
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_ALL,"" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1382,7 +1382,6 @@ _shm=auto
|
||||||
_linux_devfs=no
|
_linux_devfs=no
|
||||||
_i18n=auto
|
_i18n=auto
|
||||||
_dynamic_plugins=no
|
_dynamic_plugins=no
|
||||||
_setlocale=auto
|
|
||||||
_crash_debug=auto
|
_crash_debug=auto
|
||||||
_sighandler=yes
|
_sighandler=yes
|
||||||
_libdv=auto
|
_libdv=auto
|
||||||
|
@ -1428,8 +1427,6 @@ for ac_option do
|
||||||
--disable-i18n) _i18n=no ;;
|
--disable-i18n) _i18n=no ;;
|
||||||
--enable-dynamic-plugins) _dynamic_plugins=yes ;;
|
--enable-dynamic-plugins) _dynamic_plugins=yes ;;
|
||||||
--disable-dynamic-plugins) _dynamic_plugins=no ;;
|
--disable-dynamic-plugins) _dynamic_plugins=no ;;
|
||||||
--enable-setlocale) _setlocale=yes ;;
|
|
||||||
--disable-setlocale) _setlocale=no ;;
|
|
||||||
--enable-x11) _x11=yes ;;
|
--enable-x11) _x11=yes ;;
|
||||||
--disable-x11) _x11=no ;;
|
--disable-x11) _x11=no ;;
|
||||||
--enable-xv) _xv=yes ;;
|
--enable-xv) _xv=yes ;;
|
||||||
|
@ -2179,26 +2176,6 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Checking for setlocale() ...
|
|
||||||
# CSAK EGY MARADHAT - A HEGYLAKO
|
|
||||||
# Nemnem. a TV Maci !
|
|
||||||
echocheck "setlocale()"
|
|
||||||
if test "$_setlocale" = auto ; then
|
|
||||||
cat > $TMPC <<EOF
|
|
||||||
#include <locale.h>
|
|
||||||
int main(void) { setlocale( LC_ALL,"" ); return 0; }
|
|
||||||
EOF
|
|
||||||
_setlocale=no
|
|
||||||
cc_check && _setlocale=yes
|
|
||||||
fi
|
|
||||||
if test "$_setlocale" = yes ; then
|
|
||||||
_def_setlocale='#define USE_SETLOCALE 1'
|
|
||||||
else
|
|
||||||
_def_setlocale='#undef USE_SETLOCALE'
|
|
||||||
fi
|
|
||||||
echores "$_setlocale"
|
|
||||||
|
|
||||||
|
|
||||||
echocheck "iconv"
|
echocheck "iconv"
|
||||||
if test "$_iconv" = auto ; then
|
if test "$_iconv" = auto ; then
|
||||||
_iconv_tmp='#include <iconv.h>'
|
_iconv_tmp='#include <iconv.h>'
|
||||||
|
@ -6834,9 +6811,6 @@ $_def_i18n
|
||||||
# define MAP_FAILED ((void *) -1)
|
# define MAP_FAILED ((void *) -1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* use setlocale() function */
|
|
||||||
$_def_setlocale
|
|
||||||
|
|
||||||
/* Runtime CPU detection */
|
/* Runtime CPU detection */
|
||||||
$_def_runtime_cpudetection
|
$_def_runtime_cpudetection
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,6 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "mouse.h"
|
#include "mouse.h"
|
||||||
#ifdef MP_DEBUG
|
#ifdef MP_DEBUG
|
||||||
|
@ -599,14 +595,7 @@ mp_input_parse_cmd(char* str) {
|
||||||
break;
|
break;
|
||||||
case MP_CMD_ARG_FLOAT:
|
case MP_CMD_ARG_FLOAT:
|
||||||
errno = 0;
|
errno = 0;
|
||||||
/* <olo@altkom.com.pl> Use portable C locale for parsing floats: */
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale(LC_NUMERIC, "C");
|
|
||||||
#endif
|
|
||||||
cmd->args[i].v.f = atof(ptr);
|
cmd->args[i].v.f = atof(ptr);
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale(LC_NUMERIC, "");
|
|
||||||
#endif
|
|
||||||
if(errno != 0) {
|
if(errno != 0) {
|
||||||
mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s: argument %d isn't a float.\n",cmd_def->name,i+1);
|
mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s: argument %d isn't a float.\n",cmd_def->name,i+1);
|
||||||
ptr = NULL;
|
ptr = NULL;
|
||||||
|
|
|
@ -8,10 +8,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "ad_internal.h"
|
#include "ad_internal.h"
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_OGGVORBIS
|
#ifdef HAVE_OGGVORBIS
|
||||||
|
|
||||||
static ad_info_t info =
|
static ad_info_t info =
|
||||||
|
@ -50,13 +46,7 @@ static int read_vorbis_comment( char* ptr, char* comment, char* format, ... ) {
|
||||||
|
|
||||||
va_start( va, format );
|
va_start( va, format );
|
||||||
clen = strlen( comment );
|
clen = strlen( comment );
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_NUMERIC, "C" );
|
|
||||||
#endif
|
|
||||||
ret = strncasecmp( ptr, comment, clen) == 0 ? vsscanf( ptr+clen, format, va ) : 0;
|
ret = strncasecmp( ptr, comment, clen) == 0 ? vsscanf( ptr+clen, format, va ) : 0;
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_NUMERIC, "" );
|
|
||||||
#endif
|
|
||||||
va_end( va );
|
va_end( va );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -23,10 +23,6 @@
|
||||||
#include "mp_image.h"
|
#include "mp_image.h"
|
||||||
#include "vf.h"
|
#include "vf.h"
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LUT16
|
#define LUT16
|
||||||
|
|
||||||
/* Per channel parameters */
|
/* Per channel parameters */
|
||||||
|
@ -481,15 +477,9 @@ int open (vf_instance_t *vf, char *args)
|
||||||
par[5] = 1.0;
|
par[5] = 1.0;
|
||||||
par[6] = 1.0;
|
par[6] = 1.0;
|
||||||
par[7] = 1.0;
|
par[7] = 1.0;
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale (LC_NUMERIC, "C");
|
|
||||||
#endif
|
|
||||||
sscanf (args, "%lf:%lf:%lf:%lf:%lf:%lf:%lf:%lf",
|
sscanf (args, "%lf:%lf:%lf:%lf:%lf:%lf:%lf:%lf",
|
||||||
par, par + 1, par + 2, par + 3, par + 4, par + 5, par + 6, par + 7
|
par, par + 1, par + 2, par + 3, par + 4, par + 5, par + 6, par + 7
|
||||||
);
|
);
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale (LC_NUMERIC, "");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
eq2->rgamma = par[4];
|
eq2->rgamma = par[4];
|
||||||
eq2->ggamma = par[5];
|
eq2->ggamma = par[5];
|
||||||
|
|
|
@ -25,10 +25,6 @@
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#include "../mp_msg.h"
|
#include "../mp_msg.h"
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_MALLOC_H
|
#ifdef HAVE_MALLOC_H
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -235,9 +231,6 @@ static int open(vf_instance_t *vf, char* args){
|
||||||
|
|
||||||
if(args==NULL) return 0;
|
if(args==NULL) return 0;
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_NUMERIC, "C" );
|
|
||||||
#endif
|
|
||||||
e=sscanf(args, "%f:%f:%d:%f:%f:%d",
|
e=sscanf(args, "%f:%f:%d:%f:%f:%d",
|
||||||
&vf->priv->luma.radius,
|
&vf->priv->luma.radius,
|
||||||
&vf->priv->luma.strength,
|
&vf->priv->luma.strength,
|
||||||
|
@ -246,9 +239,6 @@ static int open(vf_instance_t *vf, char* args){
|
||||||
&vf->priv->chroma.strength,
|
&vf->priv->chroma.strength,
|
||||||
&vf->priv->chroma.threshold
|
&vf->priv->chroma.threshold
|
||||||
);
|
);
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_NUMERIC, "" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
|
vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,6 @@
|
||||||
#include "../mp_msg.h"
|
#include "../mp_msg.h"
|
||||||
#include "../cpudetect.h"
|
#include "../cpudetect.h"
|
||||||
|
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_MALLOC_H
|
#ifdef HAVE_MALLOC_H
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -267,13 +263,7 @@ static void parse( FilterParam *fp, char* args ) {
|
||||||
|
|
||||||
// parse amount
|
// parse amount
|
||||||
pos = strchr( pos+1, ':' );
|
pos = strchr( pos+1, ':' );
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_NUMERIC, "C" );
|
|
||||||
#endif
|
|
||||||
fp->amount = ( pos && pos+1<max ) ? atof( pos+1 ) : 0;
|
fp->amount = ( pos && pos+1<max ) ? atof( pos+1 ) : 0;
|
||||||
#ifdef USE_SETLOCALE
|
|
||||||
setlocale( LC_NUMERIC, "" );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================//
|
//===========================================================================//
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#ifdef USE_LANGINFO
|
#ifdef USE_LANGINFO
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
#endif
|
#endif
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
|
@ -535,11 +534,10 @@ int asf_mmst_streaming_start(stream_t *stream)
|
||||||
|
|
||||||
/* prepare for the url encoding conversion */
|
/* prepare for the url encoding conversion */
|
||||||
#ifdef USE_ICONV
|
#ifdef USE_ICONV
|
||||||
setlocale(LC_CTYPE, "");
|
|
||||||
#ifdef USE_LANGINFO
|
#ifdef USE_LANGINFO
|
||||||
url_conv = iconv_open("UTF-16LE",nl_langinfo(CODESET));
|
url_conv = iconv_open("UTF-16LE",nl_langinfo(CODESET));
|
||||||
#else
|
#else
|
||||||
url_conv = iconv_open("UTF-16LE",setlocale(LC_CTYPE, NULL));
|
url_conv = iconv_open("UTF-16LE", NULL);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
1
mp_msg.c
1
mp_msg.c
|
@ -36,7 +36,6 @@ void mp_msg_init(){
|
||||||
fprintf(stdout, "Original domain: %s\n", textdomain(NULL));
|
fprintf(stdout, "Original domain: %s\n", textdomain(NULL));
|
||||||
fprintf(stdout, "Original dirname: %s\n", bindtextdomain(textdomain(NULL),NULL));
|
fprintf(stdout, "Original dirname: %s\n", bindtextdomain(textdomain(NULL),NULL));
|
||||||
#endif
|
#endif
|
||||||
setlocale(LC_ALL, ""); /* set from the environment variables */
|
|
||||||
bindtextdomain("mplayer", PREFIX"/share/locale");
|
bindtextdomain("mplayer", PREFIX"/share/locale");
|
||||||
textdomain("mplayer");
|
textdomain("mplayer");
|
||||||
#ifdef MP_DEBUG
|
#ifdef MP_DEBUG
|
||||||
|
|
1
mp_msg.h
1
mp_msg.h
|
@ -108,7 +108,6 @@ int mp_msg_test(int mod, int lev);
|
||||||
|
|
||||||
#ifdef USE_I18N
|
#ifdef USE_I18N
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
#include <locale.h>
|
|
||||||
#define mp_gettext(String) gettext(String)
|
#define mp_gettext(String) gettext(String)
|
||||||
#else
|
#else
|
||||||
#define mp_gettext(String) String
|
#define mp_gettext(String) String
|
||||||
|
|
Loading…
Reference in New Issue