ICU-4988 Fix some MSVC 2005 compiler errors.
X-SVN-Rev: 20771
This commit is contained in:
parent
53a924446c
commit
a7bee7b08c
@ -189,69 +189,70 @@ public:
|
||||
ucol_closeElements(iter);
|
||||
}
|
||||
CmdIterAll(UErrorCode & status, UCollator * col, int32_t count, UChar * data, CALL call,int32_t,int32_t)
|
||||
:count(count),data(data){
|
||||
exec_count = 0;
|
||||
if (call == forward_null || call == backward_null) {
|
||||
iter = ucol_openElements(col, data, -1, &status);
|
||||
} else {
|
||||
iter = ucol_openElements(col, data, count, &status);
|
||||
}
|
||||
|
||||
if (call == forward_null || call == forward_len){
|
||||
fn = icu_forward_all;
|
||||
} else {
|
||||
fn = icu_backward_all;
|
||||
}
|
||||
}
|
||||
virtual long getOperationsPerIteration(){return exec_count ? exec_count : 1;}
|
||||
|
||||
virtual void call(UErrorCode* status){
|
||||
(this->*fn)(status);
|
||||
:count(count),data(data)
|
||||
{
|
||||
exec_count = 0;
|
||||
if (call == forward_null || call == backward_null) {
|
||||
iter = ucol_openElements(col, data, -1, &status);
|
||||
} else {
|
||||
iter = ucol_openElements(col, data, count, &status);
|
||||
}
|
||||
|
||||
void icu_forward_all(UErrorCode* status){
|
||||
int strlen = count - 5;
|
||||
int count5 = 5;
|
||||
int strindex = 0;
|
||||
ucol_setOffset(iter, strindex, status);
|
||||
while (TRUE) {
|
||||
if (ucol_next(iter, status) == UCOL_NULLORDER) {
|
||||
if (call == forward_null || call == forward_len){
|
||||
fn = &CmdIterAll::icu_forward_all;
|
||||
} else {
|
||||
fn = &CmdIterAll::icu_backward_all;
|
||||
}
|
||||
}
|
||||
virtual long getOperationsPerIteration(){return exec_count ? exec_count : 1;}
|
||||
|
||||
virtual void call(UErrorCode* status){
|
||||
(this->*fn)(status);
|
||||
}
|
||||
|
||||
void icu_forward_all(UErrorCode* status){
|
||||
int strlen = count - 5;
|
||||
int count5 = 5;
|
||||
int strindex = 0;
|
||||
ucol_setOffset(iter, strindex, status);
|
||||
while (TRUE) {
|
||||
if (ucol_next(iter, status) == UCOL_NULLORDER) {
|
||||
break;
|
||||
}
|
||||
exec_count++;
|
||||
count5 --;
|
||||
if (count5 == 0) {
|
||||
strindex += 10;
|
||||
if (strindex > strlen) {
|
||||
break;
|
||||
}
|
||||
exec_count++;
|
||||
count5 --;
|
||||
if (count5 == 0) {
|
||||
strindex += 10;
|
||||
if (strindex > strlen) {
|
||||
break;
|
||||
}
|
||||
ucol_setOffset(iter, strindex, status);
|
||||
count5 = 5;
|
||||
}
|
||||
ucol_setOffset(iter, strindex, status);
|
||||
count5 = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void icu_backward_all(UErrorCode* status){
|
||||
int strlen = count;
|
||||
int count5 = 5;
|
||||
int strindex = 5;
|
||||
ucol_setOffset(iter, strindex, status);
|
||||
while (TRUE) {
|
||||
if (ucol_previous(iter, status) == UCOL_NULLORDER) {
|
||||
void icu_backward_all(UErrorCode* status){
|
||||
int strlen = count;
|
||||
int count5 = 5;
|
||||
int strindex = 5;
|
||||
ucol_setOffset(iter, strindex, status);
|
||||
while (TRUE) {
|
||||
if (ucol_previous(iter, status) == UCOL_NULLORDER) {
|
||||
break;
|
||||
}
|
||||
exec_count++;
|
||||
count5 --;
|
||||
if (count5 == 0) {
|
||||
strindex += 10;
|
||||
if (strindex > strlen) {
|
||||
break;
|
||||
}
|
||||
exec_count++;
|
||||
count5 --;
|
||||
if (count5 == 0) {
|
||||
strindex += 10;
|
||||
if (strindex > strlen) {
|
||||
break;
|
||||
}
|
||||
ucol_setOffset(iter, strindex, status);
|
||||
count5 = 5;
|
||||
}
|
||||
ucol_setOffset(iter, strindex, status);
|
||||
count5 = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@ -670,7 +671,7 @@ public:
|
||||
int temp = 0;
|
||||
|
||||
#define TEST_KEYGEN(testname, func)\
|
||||
TEST(testname, CmdKeyGen, col, win_langid, count, rnd_index, CmdKeyGen::func, 0)
|
||||
TEST(testname, CmdKeyGen, col, win_langid, count, rnd_index, &CmdKeyGen::func, 0)
|
||||
TEST_KEYGEN(TestIcu_KeyGen_null, icu_key_null);
|
||||
TEST_KEYGEN(TestIcu_KeyGen_len, icu_key_len);
|
||||
TEST_KEYGEN(TestPosix_KeyGen_null, posix_key_null);
|
||||
@ -678,7 +679,7 @@ public:
|
||||
TEST_KEYGEN(TestWin_KeyGen_len, win_key_len);
|
||||
|
||||
#define TEST_ITER(testname, func)\
|
||||
TEST(testname, CmdIter, col, count, icu_data, CmdIter::func,0,0)
|
||||
TEST(testname, CmdIter, col, count, icu_data, &CmdIter::func,0,0)
|
||||
TEST_ITER(TestIcu_ForwardIter_null, icu_forward_null);
|
||||
TEST_ITER(TestIcu_ForwardIter_len, icu_forward_len);
|
||||
TEST_ITER(TestIcu_BackwardIter_null, icu_backward_null);
|
||||
@ -703,7 +704,7 @@ public:
|
||||
TEST_QSORT(TestWin_qsort_usekey, win_cmpkey);
|
||||
|
||||
#define TEST_BIN(testname, func)\
|
||||
TEST(testname, CmdBinSearch, col, win_langid, count, rnd_index, ord_icu_key,CmdBinSearch::func)
|
||||
TEST(testname, CmdBinSearch, col, win_langid, count, rnd_index, ord_icu_key, &CmdBinSearch::func)
|
||||
TEST_BIN(TestIcu_BinarySearch_strcoll_null, icu_strcoll_null);
|
||||
TEST_BIN(TestIcu_BinarySearch_strcoll_len, icu_strcoll_len);
|
||||
TEST_BIN(TestIcu_BinarySearch_usekey, icu_cmpkey);
|
||||
|
@ -186,7 +186,7 @@ public:
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
/* get the charset info */
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
|
||||
uiCodePage = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
|
||||
}
|
||||
virtual void call(UErrorCode* status){
|
||||
@ -240,7 +240,7 @@ public:
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
/* get the charset info */
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
|
||||
uiCodePage = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
|
||||
}
|
||||
virtual void call(UErrorCode* status){
|
||||
@ -303,7 +303,7 @@ public:
|
||||
tenc++;
|
||||
}
|
||||
/* get the charset info */
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
|
||||
pMulti->CreateConvertCharset(mimeInfo.uiCodePage, 1200 /*unicode*/, (DWORD)0,&pConvToUni);
|
||||
getErr(err,status);
|
||||
src = source;
|
||||
@ -359,7 +359,7 @@ public:
|
||||
tenc++;
|
||||
}
|
||||
/* get the charset info */
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
|
||||
pMulti->CreateConvertCharset(1200 /*unicode*/, mimeInfo.uiCodePage, (DWORD)0,&pConvFromUni);
|
||||
getErr(err,status);
|
||||
src = source;
|
||||
@ -416,7 +416,7 @@ public:
|
||||
MIMECSETINFO mimeInfo;
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
|
||||
dwEnc = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
|
||||
}
|
||||
|
||||
@ -472,7 +472,7 @@ public:
|
||||
mimeInfo.uiCodePage = 0;
|
||||
mimeInfo.uiInternetEncoding =0;
|
||||
|
||||
pMulti->GetCharsetInfo(bEnc,&mimeInfo);
|
||||
pMulti->GetCharsetInfo((wchar_t *)bEnc,&mimeInfo);
|
||||
dwEnc = (mimeInfo.uiInternetEncoding==0)?mimeInfo.uiCodePage:mimeInfo.uiInternetEncoding;
|
||||
}
|
||||
|
||||
|
@ -100,17 +100,17 @@ public:
|
||||
virtual UPerfFunction* runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ){
|
||||
switch (index) {
|
||||
case 0: name = "titlecase_letter_add";
|
||||
if (exec) return new CmdOp(U_TITLECASE_LETTER, CmdOp::add) ; break;
|
||||
if (exec) return new CmdOp(U_TITLECASE_LETTER, &CmdOp::add) ; break;
|
||||
case 1: name = "titlecase_letter_contains";
|
||||
if (exec) return new CmdOp(U_TITLECASE_LETTER, CmdOp::contains) ; break;
|
||||
if (exec) return new CmdOp(U_TITLECASE_LETTER, &CmdOp::contains) ; break;
|
||||
case 2: name = "titlecase_letter_iterator";
|
||||
if (exec) return new CmdOp(U_TITLECASE_LETTER, CmdOp::iterator) ; break;
|
||||
if (exec) return new CmdOp(U_TITLECASE_LETTER, &CmdOp::iterator) ; break;
|
||||
case 3: name = "unassigned_add";
|
||||
if (exec) return new CmdOp(U_UNASSIGNED, CmdOp::add) ; break;
|
||||
if (exec) return new CmdOp(U_UNASSIGNED, &CmdOp::add) ; break;
|
||||
case 4: name = "unassigned_contains";
|
||||
if (exec) return new CmdOp(U_UNASSIGNED, CmdOp::contains) ; break;
|
||||
if (exec) return new CmdOp(U_UNASSIGNED, &CmdOp::contains) ; break;
|
||||
case 5: name = "unassigned_iterator";
|
||||
if (exec) return new CmdOp(U_UNASSIGNED, CmdOp::iterator) ; break;
|
||||
if (exec) return new CmdOp(U_UNASSIGNED, &CmdOp::iterator) ; break;
|
||||
case 6: name = "pattern1";
|
||||
if (exec) return new CmdPattern(PAT[0]) ; break;
|
||||
case 7: name = "pattern2";
|
||||
|
Loading…
Reference in New Issue
Block a user