mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-22721 Delete unused variables.
This commit is contained in:
parent
a7e23a531c
commit
ec57da8651
11 changed files with 15 additions and 32 deletions
|
@ -415,10 +415,8 @@ le_uint32 PortableFontInstance::getRawChecksum() const
|
|||
// now, calculate
|
||||
fseek(fFile, 0L, SEEK_SET);
|
||||
int r;
|
||||
int count =0;
|
||||
while((r = fgetc(fFile)) != EOF) {
|
||||
chksum += r;
|
||||
count ++;
|
||||
}
|
||||
return (le_uint32) chksum; // cast to signed
|
||||
}
|
||||
|
|
|
@ -104,9 +104,8 @@ le_int32 getLanguageCode(const char *lang)
|
|||
return -1;
|
||||
}
|
||||
|
||||
LETag langTag = (LETag) ((lang[0] << 24) + (lang[1] << 16) + (lang[2] << 8) + 0x20);
|
||||
|
||||
#ifndef USING_ICULEHB
|
||||
LETag langTag = (LETag) ((lang[0] << 24) + (lang[1] << 16) + (lang[2] << 8) + 0x20);
|
||||
for (le_int32 i = 0; i < languageCodeCount; i += 1) {
|
||||
if (langTag == OpenTypeLayoutEngine::languageTags[i]) {
|
||||
return i;
|
||||
|
|
|
@ -292,7 +292,6 @@ public:
|
|||
void call(UErrorCode* /*status*/) override
|
||||
{
|
||||
Locale loc(locale);
|
||||
UErrorCode status2 = U_ZERO_ERROR;
|
||||
DateFormat *fmt = DateFormat::createDateTimeInstance(
|
||||
DateFormat::kShort, DateFormat::kFull, loc);
|
||||
for(int j = 0; j < num; j++) {
|
||||
|
@ -707,8 +706,7 @@ class StdioNumFmtFunction : public UPerfFunction
|
|||
void call(UErrorCode* status2) override
|
||||
{
|
||||
Locale loc(locale);
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
|
||||
// Parse a string. The string uses the digits '0' through '9'
|
||||
// and the decimal separator '.', standard in the US locale
|
||||
|
||||
|
|
|
@ -97,7 +97,6 @@ unsigned long timeGetTime() {
|
|||
inline int LCMapStringW(DWORD, DWORD, char16_t *, int, char16_t *, int) {return 0;}
|
||||
const int LCMAP_SORTKEY = 0;
|
||||
#define MAKELCID(a,b) 0
|
||||
const int SORT_DEFAULT = 0;
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -947,7 +946,6 @@ void doForwardIterTest(UBool haslen) {
|
|||
printf("elapsedTime %ld\n", elapsedTime);
|
||||
|
||||
// empty loop recalculation
|
||||
int tempgCount = 0;
|
||||
count = 0;
|
||||
startTime = timeGetTime();
|
||||
while (count < opt_loopCount) {
|
||||
|
@ -955,7 +953,6 @@ void doForwardIterTest(UBool haslen) {
|
|||
strindex = 0;
|
||||
ucol_setOffset(iter, strindex, &error);
|
||||
while (true) {
|
||||
tempgCount ++;
|
||||
count5 --;
|
||||
if (count5 == 0) {
|
||||
strindex += 10;
|
||||
|
@ -1111,14 +1108,12 @@ void doBackwardIterTest(UBool haslen) {
|
|||
|
||||
// empty loop recalculation
|
||||
count = 0;
|
||||
int tempgCount = 0;
|
||||
startTime = timeGetTime();
|
||||
while (count < opt_loopCount) {
|
||||
int count5 = 5;
|
||||
strindex = 5;
|
||||
ucol_setOffset(iter, strindex, &error);
|
||||
while (true) {
|
||||
tempgCount ++;
|
||||
count5 --;
|
||||
if (count5 == 0) {
|
||||
strindex += 10;
|
||||
|
|
|
@ -188,7 +188,6 @@ public:
|
|||
class CmdIterAll : public UPerfFunction {
|
||||
typedef void (CmdIterAll::* Func)(UErrorCode* status);
|
||||
int32_t count;
|
||||
char16_t * data;
|
||||
Func fn;
|
||||
UCollationElements *iter;
|
||||
int32_t exec_count;
|
||||
|
@ -200,7 +199,7 @@ public:
|
|||
ucol_closeElements(iter);
|
||||
}
|
||||
CmdIterAll(UErrorCode & status, UCollator * col, int32_t count, char16_t * data, CALL call,int32_t,int32_t)
|
||||
:count(count),data(data)
|
||||
:count(count)
|
||||
{
|
||||
exec_count = 0;
|
||||
if (call == forward_null || call == backward_null) {
|
||||
|
|
|
@ -310,15 +310,14 @@ void GetSortKey::call(UErrorCode* status)
|
|||
if (U_FAILURE(*status)) return;
|
||||
|
||||
uint8_t key[KEY_BUF_SIZE];
|
||||
int32_t len;
|
||||
|
||||
if (useLen) {
|
||||
for (int32_t i = 0; i < source->count; i++) {
|
||||
len = ucol_getSortKey(coll, source->dataOf(i), source->lengthOf(i), key, KEY_BUF_SIZE);
|
||||
ucol_getSortKey(coll, source->dataOf(i), source->lengthOf(i), key, KEY_BUF_SIZE);
|
||||
}
|
||||
} else {
|
||||
for (int32_t i = 0; i < source->count; i++) {
|
||||
len = ucol_getSortKey(coll, source->dataOf(i), -1, key, KEY_BUF_SIZE);
|
||||
ucol_getSortKey(coll, source->dataOf(i), -1, key, KEY_BUF_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -314,10 +314,9 @@ public:
|
|||
}
|
||||
}
|
||||
int32_t run() override {
|
||||
double trial=0.0;
|
||||
int i;
|
||||
for(i=0;i<U_LOTS_OF_TIMES;i++){
|
||||
trial = unum_parse(fFmt,fStr,fLen, nullptr, &setupStatus);
|
||||
unum_parse(fFmt,fStr,fLen, nullptr, &setupStatus);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
@ -692,13 +691,13 @@ static char16_t strbeng[] = {0x09E8,0x09E8,0x09E8,0x09E8, 0 };
|
|||
UNumberFormat *NumParseTest_fmt;
|
||||
|
||||
// TODO: de-uglify.
|
||||
QuickTest(NumParseTest,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; static char16_t str[] = { 0x31 };double val; for(i=0;i<U_LOTS_OF_TIMES;i++) { val=unum_parse(NumParseTest_fmt,str,1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
QuickTest(NumParseTest,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; static char16_t str[] = { 0x31 }; for(i=0;i<U_LOTS_OF_TIMES;i++) { unum_parse(NumParseTest_fmt,str,1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
|
||||
QuickTest(NumParseTestdot,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; double val; for(i=0;i<U_LOTS_OF_TIMES;i++) { val=unum_parse(NumParseTest_fmt,strdot,1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
QuickTest(NumParseTestspc,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; double val; for(i=0;i<U_LOTS_OF_TIMES;i++) { val=unum_parse(NumParseTest_fmt,strspc,1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
QuickTest(NumParseTestgrp,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; double val; for(i=0;i<U_LOTS_OF_TIMES;i++) { val=unum_parse(NumParseTest_fmt,strgrp,-1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
QuickTest(NumParseTestdot,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; for(i=0;i<U_LOTS_OF_TIMES;i++) { unum_parse(NumParseTest_fmt,strdot,1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
QuickTest(NumParseTestspc,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; for(i=0;i<U_LOTS_OF_TIMES;i++) { unum_parse(NumParseTest_fmt,strspc,1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
QuickTest(NumParseTestgrp,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; for(i=0;i<U_LOTS_OF_TIMES;i++) { unum_parse(NumParseTest_fmt,strgrp,-1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
|
||||
QuickTest(NumParseTestbeng,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; double val; for(i=0;i<U_LOTS_OF_TIMES;i++) { val=unum_parse(NumParseTest_fmt,strbeng,-1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
QuickTest(NumParseTestbeng,{ static char16_t pattern[] = { 0x23 }; NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL, pattern, 1, TEST_LOCALE, 0, &setupStatus); },{ int32_t i; for(i=0;i<U_LOTS_OF_TIMES;i++) { unum_parse(NumParseTest_fmt,strbeng,-1,nullptr,&setupStatus); } return i; },{unum_close(NumParseTest_fmt);})
|
||||
|
||||
UDateFormat *DateFormatTest_fmt = nullptr;
|
||||
UDate sometime = 100000000.0;
|
||||
|
|
|
@ -423,10 +423,8 @@ le_uint32 PortableFontInstance::getRawChecksum() const
|
|||
// now, calculate
|
||||
fseek(fFile, 0L, SEEK_SET);
|
||||
int r;
|
||||
int count =0;
|
||||
while((r = fgetc(fFile)) != EOF) {
|
||||
chksum += r;
|
||||
count ++;
|
||||
}
|
||||
return (le_uint32) chksum; // cast to signed
|
||||
}
|
||||
|
|
|
@ -180,7 +180,6 @@ void readTestFile(const char *testFilePath, TestCaseCallback callback)
|
|||
const UXMLElement *element;
|
||||
int32_t ec = 0;
|
||||
int32_t charCount = 0;
|
||||
int32_t typoFlags = 3; // kerning + ligatures...
|
||||
UScriptCode scriptCode;
|
||||
le_int32 languageCode = -1;
|
||||
UnicodeString text, glyphs, indices, positions;
|
||||
|
|
|
@ -90,11 +90,10 @@ public:
|
|||
}
|
||||
|
||||
// Set up rule equivalency test range
|
||||
UDate low, high;
|
||||
cal->set(1900, UCAL_JANUARY, 1);
|
||||
low = cal->getTime(*status);
|
||||
cal->getTime(*status);
|
||||
cal->set(2040, UCAL_JANUARY, 1);
|
||||
high = cal->getTime(*status);
|
||||
cal->getTime(*status);
|
||||
if (U_FAILURE(*status)) {
|
||||
//errln("getTime failed");
|
||||
return;
|
||||
|
|
|
@ -443,7 +443,7 @@ inline void catenate(const char16_t* src,int32_t srcLen, UnicodeString s0)
|
|||
*catICU += s0;
|
||||
|
||||
utimer_getTime(&mystop);
|
||||
double mytime = utimer_getDeltaSeconds(&mystart,&mystop);
|
||||
utimer_getDeltaSeconds(&mystart,&mystop);
|
||||
|
||||
*catICU += uCatenate_STR;
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ inline void StdLibCatenate(const wchar_t* src,int32_t srcLen, stlstring s0)
|
|||
*catStd += sCatenate_STR;
|
||||
|
||||
utimer_getTime(&mystop);
|
||||
double mytime = utimer_getDeltaSeconds(&mystart,&mystop);
|
||||
utimer_getDeltaSeconds(&mystart,&mystop);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue