[MPlayer-dev-eng] [PATCH]Win32: correct the encoding of filename in console message
zhuhai
zhuhai.mail at 163.com
Sat Aug 15 20:24:20 CEST 2015
On 2015/08/16 01:34, compn wrote:
> On Sun, 9 Aug 2015 02:20:57 +0800 (CST)
> Zhu Hai <zhuhai.mail at 163.com> wrote:
>
> hello! sorry, your patch was stuck in the moderation queue.
>
>> - if (!mp_msg_charset ||
>> - !strcasecmp(mp_msg_charset, MSG_CHARSET) ||
>> - !strcasecmp(mp_msg_charset, "noconv"))
>> + if (!from || !to ||
>> + !strcasecmp(from, to) ||
>> + !strcasecmp(from, "noconv"))
>> return filename;
>> if (inv_msgiconv == (iconv_t)(-1)) {
>> - inv_msgiconv = iconv_open(MSG_CHARSET, mp_msg_charset);
>> + inv_msgiconv = iconv_open(to, from);
>
> changing functions to "from" and "to" looks weird to me.
The parameter "from" and "to" comes from declaration of iconv_open:
iconv_t iconv_open(const char *tocode, const char *fromcode);
>
>
>> - HMODULE kernel32 = GetModuleHandle("Kernel32.dll");
>> + HMODULE kernel32;
>> +
>> + if (!win32_use_utf8) goto fallback;
>> +
>> + kernel32 = GetModuleHandle("Kernel32.dll");
> why the kernel32 change?
just want to avoid unnecessary call of 'GetModuleHandle' and also avoid
compile warning like :
"... ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement] "
if put the 'if' statement before declaration of kernel32.
>
> -compn
More information about the MPlayer-dev-eng
mailing list