mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 12:59:21 +08:00
Cygwin: avoid GCC 10 error with -Werror=narrowing
../../../../src/winsup/cygwin/fhandler_console.cc: In member function 'const unsigned char* fhandler_console::write_normal(const unsigned char*, const unsigned char*)': ../../../../src/winsup/cygwin/fhandler_console.cc:2782:8: error: narrowing conversion of '-2' from 'int' to 'long unsigned int' [-Wnarrowing] ../../../../src/winsup/cygwin/fhandler_console.cc:2786:8: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing] ../../../../src/winsup/cygwin/fhandler_console.cc:2836:8: error: narrowing conversion of '-2' from 'int' to 'long unsigned int' [-Wnarrowing] ../../../../src/winsup/cygwin/fhandler_console.cc:2840:8: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing] A mbtowc_p function returns an int, so that seems the correct type to use here.
This commit is contained in:
parent
3bb579a43c
commit
129c9844a6
@ -2759,7 +2759,7 @@ fhandler_console::write_normal (const unsigned char *src,
|
||||
DWORD done;
|
||||
DWORD buf_len;
|
||||
const unsigned char *found = src;
|
||||
size_t ret;
|
||||
int ret;
|
||||
mbstate_t ps;
|
||||
mbtowc_p f_mbtowc;
|
||||
|
||||
@ -2938,7 +2938,7 @@ do_print:
|
||||
{
|
||||
ret = __utf8_mbtowc (_REENT, NULL, (const char *) found + 1,
|
||||
end - found - 1, &ps);
|
||||
if (ret != (size_t) -1)
|
||||
if (ret != -1)
|
||||
while (ret-- > 0)
|
||||
{
|
||||
WCHAR w = *(found + 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user