From 642efc8d007d58a14990763c1f9fda0706841f5f Mon Sep 17 00:00:00 2001 From: Quentin Fiard Date: Mon, 4 Nov 2013 21:31:35 +0000 Subject: [PATCH] Fixed c++11-narrowing errors for C++11 compatibility char(0x80): constant expression evaluates to -128 which cannot be narrowed to type 'unsigned char' [-Wc++11-narrowing] --- src/convert/impl/ucs2_utf8.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/convert/impl/ucs2_utf8.cpp b/src/convert/impl/ucs2_utf8.cpp index 929b52ac..4b9f5d86 100644 --- a/src/convert/impl/ucs2_utf8.cpp +++ b/src/convert/impl/ucs2_utf8.cpp @@ -20,10 +20,10 @@ namespace { static const Tab tab[] = { - { char(0x80), char(0x00), 0*6, 0x7F, }, // 1 byte sequence - { char(0xE0), char(0xC0), 1*6, 0x7FF, }, // 2 byte sequence - { char(0xF0), char(0xE0), 2*6, 0xFFFF, }, // 3 byte sequence - { 0, 0, 0, 0, } // end of table + { (unsigned char)(0x80), (unsigned char)(0x00), 0*6, 0x7F, }, // 1 byte sequence + { (unsigned char)(0xE0), (unsigned char)(0xC0), 1*6, 0x7FF, }, // 2 byte sequence + { (unsigned char)(0xF0), (unsigned char)(0xE0), 2*6, 0xFFFF, }, // 3 byte sequence + { 0, 0, 0, 0, } // end of table }; } // namespace