forked from OSchip/llvm-project
Corrected some int -> char narrowing conversions
llvm-svn: 111849
This commit is contained in:
parent
d41b53c037
commit
01f586ca2c
|
@ -31,7 +31,7 @@ int main()
|
|||
typedef std::codecvt_utf16<wchar_t> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -70,7 +70,7 @@ int main()
|
|||
typedef std::codecvt_utf16<wchar_t, 0x1000> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -109,7 +109,7 @@ int main()
|
|||
typedef std::codecvt_utf16<wchar_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[6] = {0xFE, 0xFF, 0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[6] = {char(0xFE), char(0xFF), char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -148,7 +148,7 @@ int main()
|
|||
typedef std::codecvt_utf16<wchar_t, 0x10ffff, std::little_endian> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -187,7 +187,7 @@ int main()
|
|||
typedef std::codecvt_utf16<wchar_t, 0x1000, std::little_endian> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -228,7 +228,7 @@ int main()
|
|||
std::little_endian)> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[6] = {0xFF, 0xFE, 0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[6] = {char(0xFF), char(0xFE), char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -267,7 +267,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char32_t> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -306,7 +306,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char32_t, 0x1000> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -345,7 +345,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char32_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[6] = {0xFE, 0xFF, 0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[6] = {char(0xFE), char(0xFF), char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -384,7 +384,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char32_t, 0x10ffff, std::little_endian> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -423,7 +423,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char32_t, 0x1000, std::little_endian> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -464,7 +464,7 @@ int main()
|
|||
std::little_endian)> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[6] = {0xFF, 0xFE, 0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[6] = {char(0xFF), char(0xFE), char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -504,7 +504,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char16_t> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -543,7 +543,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char16_t, 0x1000> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -582,7 +582,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char16_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[6] = {0xFE, 0xFF, 0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[6] = {char(0xFE), char(0xFF), char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -621,7 +621,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char16_t, 0x10ffff, std::little_endian> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -660,7 +660,7 @@ int main()
|
|||
typedef std::codecvt_utf16<char16_t, 0x1000, std::little_endian> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -701,7 +701,7 @@ int main()
|
|||
std::little_endian)> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[6] = {0xFF, 0xFE, 0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[6] = {char(0xFF), char(0xFE), char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
|
|
@ -28,7 +28,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<wchar_t> C;
|
||||
C c;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 4);
|
||||
|
@ -51,7 +51,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<wchar_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -74,7 +74,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<wchar_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char n[6] = {0xFE, 0xFF, 0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[6] = {char(0xFE), char(0xFF), char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+6, 2);
|
||||
assert(r == 6);
|
||||
|
@ -97,7 +97,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<wchar_t, 0x10ffff, std::little_endian> C;
|
||||
C c;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 4);
|
||||
|
@ -120,7 +120,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<wchar_t, 0x1000, std::little_endian> C;
|
||||
C c;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -145,7 +145,7 @@ int main()
|
|||
std::consume_header |
|
||||
std::little_endian)> C;
|
||||
C c;
|
||||
char n[6] = {0xFF, 0xFE, 0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[6] = {char(0xFF), char(0xFE), char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+6, 2);
|
||||
assert(r == 6);
|
||||
|
@ -168,7 +168,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char32_t> C;
|
||||
C c;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 4);
|
||||
|
@ -191,7 +191,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char32_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -214,7 +214,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char32_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char n[6] = {0xFE, 0xFF, 0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[6] = {char(0xFE), char(0xFF), char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+6, 2);
|
||||
assert(r == 6);
|
||||
|
@ -237,7 +237,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char32_t, 0x10ffff, std::little_endian> C;
|
||||
C c;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 4);
|
||||
|
@ -260,7 +260,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char32_t, 0x1000, std::little_endian> C;
|
||||
C c;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -285,7 +285,7 @@ int main()
|
|||
std::consume_header |
|
||||
std::little_endian)> C;
|
||||
C c;
|
||||
char n[6] = {0xFF, 0xFE, 0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[6] = {char(0xFF), char(0xFE), char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+6, 2);
|
||||
assert(r == 6);
|
||||
|
@ -309,7 +309,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char16_t> C;
|
||||
C c;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -332,7 +332,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char16_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[4] = {char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -355,7 +355,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char16_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char n[6] = {0xFE, 0xFF, 0xD8, 0xC0, 0xDC, 0x03};
|
||||
char n[6] = {char(0xFE), char(0xFF), char(0xD8), char(0xC0), char(0xDC), char(0x03)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+6, 2);
|
||||
assert(r == 2);
|
||||
|
@ -378,7 +378,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char16_t, 0x10ffff, std::little_endian> C;
|
||||
C c;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -401,7 +401,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf16<char16_t, 0x1000, std::little_endian> C;
|
||||
C c;
|
||||
char n[4] = {0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[4] = {char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -426,7 +426,7 @@ int main()
|
|||
std::consume_header |
|
||||
std::little_endian)> C;
|
||||
C c;
|
||||
char n[6] = {0xFF, 0xFE, 0xC0, 0xD8, 0x03, 0xDC};
|
||||
char n[6] = {char(0xFF), char(0xFE), char(0xC0), char(0xD8), char(0x03), char(0xDC)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+6, 2);
|
||||
assert(r == 2);
|
||||
|
|
|
@ -31,7 +31,7 @@ int main()
|
|||
typedef std::codecvt_utf8<wchar_t> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -70,7 +70,7 @@ int main()
|
|||
typedef std::codecvt_utf8<wchar_t, 0x1000> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -109,7 +109,7 @@ int main()
|
|||
typedef std::codecvt_utf8<wchar_t, 0xFFFFFFFF, std::consume_header> C;
|
||||
C c;
|
||||
wchar_t w = 0;
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -151,7 +151,7 @@ int main()
|
|||
typedef std::codecvt_utf8<char32_t> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -190,7 +190,7 @@ int main()
|
|||
typedef std::codecvt_utf8<char32_t, 0x1000> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -229,7 +229,7 @@ int main()
|
|||
typedef std::codecvt_utf8<char32_t, 0xFFFFFFFF, std::consume_header> C;
|
||||
C c;
|
||||
char32_t w = 0;
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -271,7 +271,7 @@ int main()
|
|||
typedef std::codecvt_utf8<char16_t> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[3] = {0xE1, 0x80, 0x85};
|
||||
char n[3] = {char(0xE1), char(0x80), char(0x85)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -301,7 +301,7 @@ int main()
|
|||
typedef std::codecvt_utf8<char16_t, 0x1000> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[3] = {0xE1, 0x80, 0x85};
|
||||
char n[3] = {char(0xE1), char(0x80), char(0x85)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -331,7 +331,7 @@ int main()
|
|||
typedef std::codecvt_utf8<char16_t, 0xFFFFFFFF, std::consume_header> C;
|
||||
C c;
|
||||
char16_t w = 0;
|
||||
char n[6] = {0xEF, 0xBB, 0xBF, 0xE1, 0x80, 0x85};
|
||||
char n[6] = {char(0xEF), char(0xBB), char(0xBF), char(0xE1), char(0x80), char(0x85)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
|
|
@ -28,7 +28,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<wchar_t> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 1);
|
||||
assert(r == 4);
|
||||
|
@ -51,7 +51,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<wchar_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 1);
|
||||
assert(r == 0);
|
||||
|
@ -74,7 +74,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<wchar_t, 0xFFFFFFFF, std::consume_header> C;
|
||||
C c;
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+7, 1);
|
||||
assert(r == 7);
|
||||
|
@ -100,7 +100,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<char32_t> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 1);
|
||||
assert(r == 4);
|
||||
|
@ -123,7 +123,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<char32_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 1);
|
||||
assert(r == 0);
|
||||
|
@ -146,7 +146,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<char32_t, 0xFFFFFFFF, std::consume_header> C;
|
||||
C c;
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+7, 1);
|
||||
assert(r == 7);
|
||||
|
@ -172,7 +172,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<char16_t> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 1);
|
||||
assert(r == 0);
|
||||
|
@ -195,7 +195,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<char16_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 1);
|
||||
assert(r == 0);
|
||||
|
@ -218,7 +218,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8<char16_t, 0xFFFFFFFF, std::consume_header> C;
|
||||
C c;
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+7, 1);
|
||||
assert(r == 3);
|
||||
|
|
|
@ -31,7 +31,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<wchar_t> C;
|
||||
C c;
|
||||
wchar_t w[2] = {0};
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -70,7 +70,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<wchar_t, 0x1000> C;
|
||||
C c;
|
||||
wchar_t w[2] = {0};
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -106,7 +106,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<wchar_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
wchar_t w[2] = {0};
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
wchar_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -145,7 +145,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<char32_t> C;
|
||||
C c;
|
||||
char32_t w[2] = {0};
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -184,7 +184,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<char32_t, 0x1000> C;
|
||||
C c;
|
||||
char32_t w[2] = {0};
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -220,7 +220,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<char32_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char32_t w[2] = {0};
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char32_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -259,7 +259,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<char16_t> C;
|
||||
C c;
|
||||
char16_t w[2] = {0};
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -298,7 +298,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<char16_t, 0x1000> C;
|
||||
C c;
|
||||
char16_t w[2] = {0};
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
@ -334,7 +334,7 @@ int main()
|
|||
typedef std::codecvt_utf8_utf16<char16_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char16_t w[2] = {0};
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
char16_t* wp = nullptr;
|
||||
std::mbstate_t m;
|
||||
const char* np = nullptr;
|
||||
|
|
|
@ -28,7 +28,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<wchar_t> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 4);
|
||||
|
@ -51,7 +51,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<wchar_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -74,7 +74,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<wchar_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+7, 2);
|
||||
assert(r == 7);
|
||||
|
@ -97,7 +97,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<char32_t> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 4);
|
||||
|
@ -120,7 +120,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<char32_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -143,7 +143,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<char32_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+7, 2);
|
||||
assert(r == 7);
|
||||
|
@ -166,7 +166,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<char16_t> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 4);
|
||||
|
@ -189,7 +189,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<char16_t, 0x1000> C;
|
||||
C c;
|
||||
char n[4] = {0xF1, 0x80, 0x80, 0x83};
|
||||
char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+4, 2);
|
||||
assert(r == 0);
|
||||
|
@ -212,7 +212,7 @@ int main()
|
|||
{
|
||||
typedef std::codecvt_utf8_utf16<char16_t, 0x10ffff, std::consume_header> C;
|
||||
C c;
|
||||
char n[7] = {0xEF, 0xBB, 0xBF, 0xF1, 0x80, 0x80, 0x83};
|
||||
char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
|
||||
std::mbstate_t m;
|
||||
int r = c.length(m, n, n+7, 2);
|
||||
assert(r == 7);
|
||||
|
|
Loading…
Reference in New Issue