From aa85336fc128350d25e21ac22d22b35ce9ce9472 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 5 Dec 2000 01:31:06 +0000 Subject: [PATCH] ICU-535 Fixed some compiler warnings. X-SVN-Rev: 3129 --- icu4c/source/test/intltest/testutil.cpp | 100 +++++++++++++----------- icu4c/source/test/intltest/testutil.h | 11 +-- 2 files changed, 56 insertions(+), 55 deletions(-) diff --git a/icu4c/source/test/intltest/testutil.cpp b/icu4c/source/test/intltest/testutil.cpp index 12e8524b8a5..d7fc06e3e4d 100644 --- a/icu4c/source/test/intltest/testutil.cpp +++ b/icu4c/source/test/intltest/testutil.cpp @@ -19,13 +19,64 @@ int8_t TestUtility::getScript(int8_t block) { return blockToScript[block]; } +struct Split { + UChar ch; + int8_t i1; + int8_t i2; +}; + +static const Split gTestUtilitySplit[] = { + {0x0250, 4, 5}, // -1 + {0x02B0, 5, 6}, // -2 + {0x0370, 7, 8}, // -3 + {0x0530, 0, 10}, // -4 + {0x0590, 10, 11}, // -5 + {0x0750, 13, 0}, // -6 + {0x07C0, 14, 0}, // -7 + {0x10A0, 28, 29}, // -8 + {0x13A0, 0, 32}, // -9 + {0x16A0, 34, 35}, // -10 + {0x18B0, 37, 0}, // -11 + {0x2070, 40, 41}, // -12 + {0x20A0, 41, -31}, // -13 + {0x2150, 44, 45}, // -14 + {0x2190, 45, 46}, // -15 + {0x2440, 49, -32}, // -16 + {0x25A0, 53, 54}, // -17 + {0x27C0, 56, 0}, // -18 + {0x2FE0, 59, -33}, // -19 + {0x3040, 61, 62}, // -20 + {0x30A0, 62, 63}, // -21 + {0x3130, 64, 65}, // -22 + {0x3190, 65, -34}, // -23 + {0x4DB6, 70, 0}, // -24 + {0xA490, 72, -35}, // -25 + {0xD7A4, 74, 0}, // -26 + {0xFB50, 80, 81}, // -27 + {0xFE20, 0, -36}, // -28 + {0xFEFF, 85, 86}, // -29 + {0xFFF0, 87, -37}, // -30 + {0x20D0, 42, 43}, // -31 + {0x2460, 50, 51}, // -32 + {0x2FF0, 0, 60}, // -33 + {0x31A0, 66, -38}, // -34 + {0xA4D0, 73, 0}, //-35 + {0xFE30, 82, -39}, //-36 + {0xFFFE, 88, 0}, //-37 + {0x31C0, 67, 0}, // -38 + {0xFE50, 83, -40}, //-39 + {0xFE70, 84, 85} // -40 +}; + int8_t TestUtility::getBlock(UChar c) { int32_t index = c >> 7; int8_t block = charToBlock[index]; while (block < 0) { // take care of exceptions, blocks split across 128 boundaries - const Split tuple = split[-block-1]; - if (c < tuple.ch) block = tuple.i1; - else block = tuple.i2; + const Split tuple = gTestUtilitySplit[-block-1]; + if (c < tuple.ch) + block = tuple.i1; + else + block = tuple.i2; } return block; } @@ -159,49 +210,6 @@ const int8_t TestUtility::blockToScript[] = { COMMON_SCRIPT, // 88, SPECIALS }; -const TestUtility::Split TestUtility::split[] = { - {0x0250, 4, 5}, // -1 - {0x02B0, 5, 6}, // -2 - {0x0370, 7, 8}, // -3 - {0x0530, 0, 10}, // -4 - {0x0590, 10, 11}, // -5 - {0x0750, 13, 0}, // -6 - {0x07C0, 14, 0}, // -7 - {0x10A0, 28, 29}, // -8 - {0x13A0, 0, 32}, // -9 - {0x16A0, 34, 35}, // -10 - {0x18B0, 37, 0}, // -11 - {0x2070, 40, 41}, // -12 - {0x20A0, 41, -31}, // -13 - {0x2150, 44, 45}, // -14 - {0x2190, 45, 46}, // -15 - {0x2440, 49, -32}, // -16 - {0x25A0, 53, 54}, // -17 - {0x27C0, 56, 0}, // -18 - {0x2FE0, 59, -33}, // -19 - {0x3040, 61, 62}, // -20 - {0x30A0, 62, 63}, // -21 - {0x3130, 64, 65}, // -22 - {0x3190, 65, -34}, // -23 - {0x4DB6, 70, 0}, // -24 - {0xA490, 72, -35}, // -25 - {0xD7A4, 74, 0}, // -26 - {0xFB50, 80, 81}, // -27 - {0xFE20, 0, -36}, // -28 - {0xFEFF, 85, 86}, // -29 - {0xFFF0, 87, -37}, // -30 - {0x20D0, 42, 43}, // -31 - {0x2460, 50, 51}, // -32 - {0x2FF0, 0, 60}, // -33 - {0x31A0, 66, -38}, // -34 - {0xA4D0, 73, 0}, //-35 - {0xFE30, 82, -39}, //-36 - {0xFFFE, 88, 0}, //-37 - {0x31C0, 67, 0}, // -38 - {0xFE50, 83, -40}, //-39 - {0xFE70, 84, 85} // -40 -}; - const int8_t TestUtility::charToBlock[] = { 1, 2, 3, 4, -1, -2, -3, 8, 9, 9, -4, -5, 12, 12, -6, -7, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 27, diff --git a/icu4c/source/test/intltest/testutil.h b/icu4c/source/test/intltest/testutil.h index 7f3113c0a05..1fd2b82a54a 100644 --- a/icu4c/source/test/intltest/testutil.h +++ b/icu4c/source/test/intltest/testutil.h @@ -167,18 +167,11 @@ public: SPECIALS = 86, HALFWIDTH_AND_FULLWIDTH_FORMS = 87 }; - + private: static const int8_t blockToScript[]; - - struct Split { - UChar ch; - int8_t i1; - int8_t i2; - }; - static const Split split[]; - + static const int8_t charToBlock[]; TestUtility() {} // Prevent instantiation