This adds a separate CI build that enables -Werror for clang.
This also fixes all of the -Wall -Wextra warnings in the tests, and all the
-Wextra-semi warnings as well.
CC: clang
CXX: clang++
#-------------------------------------------------------------------------
+- job: ICU4C_Clang_Ubuntu_1604_WarningsAsErrors
+ displayName: 'C: Linux Clang WarningsAsErrors (Ubuntu 16.04)'
+ timeoutInMinutes: 30
+ pool:
+ vmImage: 'Ubuntu 16.04'
+ steps:
+ - script: |
+ export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi" && cd icu4c/source && ./runConfigureICU Linux && make -j2 tests
+ displayName: 'Build only (WarningsAsErrors)'
+ env:
+ CC: clang
+ CXX: clang++
+#-------------------------------------------------------------------------
- job: ICU4C_Clang_Ubuntu_DataFilter_1604
displayName: 'C: Linux Clang DataFilter (Ubuntu 16.04)'
timeoutInMinutes: 30
public:
Mutex(UMutex *mutex = nullptr) : fMutex(mutex) {
umtx_lock(fMutex);
- };
+ }
~Mutex() {
umtx_unlock(fMutex);
- };
+ }
Mutex(const Mutex &other) = delete; // forbid assigning of this class
Mutex &operator=(const Mutex &other) = delete; // forbid copying of this class
if (m == nullptr) { m = getMutex(); }
m->lock();
}
- void unlock() { fMutex.load(std::memory_order_relaxed)->unlock(); };
+ void unlock() { fMutex.load(std::memory_order_relaxed)->unlock(); }
static void cleanup();
static char* U_EXPORT2 ucol_sortKeyToString(const UCollator *coll, const uint8_t *sortkey, char *buffer, uint32_t len) {
+ (void)coll; // suppress compiler warnings about unused variable
uint32_t position = 0;
uint8_t b;
}
while (TRUE) {
/* testing with en since thai has its own tailoring */
- uint32_t ce = ucol_next(iter1, &status);
- uint32_t ce2 = ucol_next(iter2, &status);
+ int32_t ce = ucol_next(iter1, &status);
+ int32_t ce2 = ucol_next(iter2, &status);
if(U_FAILURE(status)) {
log_err("ERROR: CollationElement iterator creation failed.: %s\n", myErrorName(status));
return;
};
struct teststruct tests[] = {
- {"\\u010CAKI MIHALJ" } ,
- {"\\u010CAKI MIHALJ" } ,
- {"\\u010CAKI PIRO\\u0160KA" },
- {"\\u010CABAI ANDRIJA" } ,
- {"\\u010CABAI LAJO\\u0160" } ,
- {"\\u010CABAI MARIJA" } ,
- {"\\u010CABAI STEVAN" } ,
- {"\\u010CABAI STEVAN" } ,
- {"\\u010CABARKAPA BRANKO" } ,
- {"\\u010CABARKAPA MILENKO" } ,
- {"\\u010CABARKAPA MIROSLAV" } ,
- {"\\u010CABARKAPA SIMO" } ,
- {"\\u010CABARKAPA STANKO" } ,
- {"\\u010CABARKAPA TAMARA" } ,
- {"\\u010CABARKAPA TOMA\\u0160" } ,
- {"\\u010CABDARI\\u0106 NIKOLA" } ,
- {"\\u010CABDARI\\u0106 ZORICA" } ,
- {"\\u010CABI NANDOR" } ,
- {"\\u010CABOVI\\u0106 MILAN" } ,
- {"\\u010CABRADI AGNEZIJA" } ,
- {"\\u010CABRADI IVAN" } ,
- {"\\u010CABRADI JELENA" } ,
- {"\\u010CABRADI LJUBICA" } ,
- {"\\u010CABRADI STEVAN" } ,
- {"\\u010CABRDA MARTIN" } ,
- {"\\u010CABRILO BOGDAN" } ,
- {"\\u010CABRILO BRANISLAV" } ,
- {"\\u010CABRILO LAZAR" } ,
- {"\\u010CABRILO LJUBICA" } ,
- {"\\u010CABRILO SPASOJA" } ,
- {"\\u010CADE\\u0160 ZDENKA" } ,
- {"\\u010CADESKI BLAGOJE" } ,
- {"\\u010CADOVSKI VLADIMIR" } ,
- {"\\u010CAGLJEVI\\u0106 TOMA" } ,
- {"\\u010CAGOROVI\\u0106 VLADIMIR" } ,
- {"\\u010CAJA VANKA" } ,
- {"\\u010CAJI\\u0106 BOGOLJUB" } ,
- {"\\u010CAJI\\u0106 BORISLAV" } ,
- {"\\u010CAJI\\u0106 RADOSLAV" } ,
- {"\\u010CAK\\u0160IRAN MILADIN" } ,
- {"\\u010CAKAN EUGEN" } ,
- {"\\u010CAKAN EVGENIJE" } ,
- {"\\u010CAKAN IVAN" } ,
- {"\\u010CAKAN JULIJAN" } ,
- {"\\u010CAKAN MIHAJLO" } ,
- {"\\u010CAKAN STEVAN" } ,
- {"\\u010CAKAN VLADIMIR" } ,
- {"\\u010CAKAN VLADIMIR" } ,
- {"\\u010CAKAN VLADIMIR" } ,
- {"\\u010CAKARA ANA" } ,
- {"\\u010CAKAREVI\\u0106 MOMIR" } ,
- {"\\u010CAKAREVI\\u0106 NEDELJKO" } ,
- {"\\u010CAKI \\u0160ANDOR" } ,
- {"\\u010CAKI AMALIJA" } ,
- {"\\u010CAKI ANDRA\\u0160" } ,
- {"\\u010CAKI LADISLAV" } ,
- {"\\u010CAKI LAJO\\u0160" } ,
- {"\\u010CAKI LASLO" } ,
+ {"\\u010CAKI MIHALJ", {0}},
+ {"\\u010CAKI MIHALJ", {0}},
+ {"\\u010CAKI PIRO\\u0160KA", {0}},
+ {"\\u010CABAI ANDRIJA", {0}},
+ {"\\u010CABAI LAJO\\u0160", {0}},
+ {"\\u010CABAI MARIJA", {0}},
+ {"\\u010CABAI STEVAN", {0}},
+ {"\\u010CABAI STEVAN", {0}},
+ {"\\u010CABARKAPA BRANKO", {0}},
+ {"\\u010CABARKAPA MILENKO", {0}},
+ {"\\u010CABARKAPA MIROSLAV", {0}},
+ {"\\u010CABARKAPA SIMO", {0}},
+ {"\\u010CABARKAPA STANKO", {0}},
+ {"\\u010CABARKAPA TAMARA", {0}},
+ {"\\u010CABARKAPA TOMA\\u0160", {0}},
+ {"\\u010CABDARI\\u0106 NIKOLA", {0}},
+ {"\\u010CABDARI\\u0106 ZORICA", {0}},
+ {"\\u010CABI NANDOR", {0}},
+ {"\\u010CABOVI\\u0106 MILAN", {0}},
+ {"\\u010CABRADI AGNEZIJA", {0}},
+ {"\\u010CABRADI IVAN", {0}},
+ {"\\u010CABRADI JELENA", {0}},
+ {"\\u010CABRADI LJUBICA", {0}},
+ {"\\u010CABRADI STEVAN", {0}},
+ {"\\u010CABRDA MARTIN", {0}},
+ {"\\u010CABRILO BOGDAN", {0}},
+ {"\\u010CABRILO BRANISLAV", {0}},
+ {"\\u010CABRILO LAZAR", {0}},
+ {"\\u010CABRILO LJUBICA", {0}},
+ {"\\u010CABRILO SPASOJA", {0}},
+ {"\\u010CADE\\u0160 ZDENKA", {0}},
+ {"\\u010CADESKI BLAGOJE", {0}},
+ {"\\u010CADOVSKI VLADIMIR", {0}},
+ {"\\u010CAGLJEVI\\u0106 TOMA", {0}},
+ {"\\u010CAGOROVI\\u0106 VLADIMIR", {0}},
+ {"\\u010CAJA VANKA", {0}},
+ {"\\u010CAJI\\u0106 BOGOLJUB", {0}},
+ {"\\u010CAJI\\u0106 BORISLAV", {0}},
+ {"\\u010CAJI\\u0106 RADOSLAV", {0}},
+ {"\\u010CAK\\u0160IRAN MILADIN", {0}},
+ {"\\u010CAKAN EUGEN", {0}},
+ {"\\u010CAKAN EVGENIJE", {0}},
+ {"\\u010CAKAN IVAN", {0}},
+ {"\\u010CAKAN JULIJAN", {0}},
+ {"\\u010CAKAN MIHAJLO", {0}},
+ {"\\u010CAKAN STEVAN", {0}},
+ {"\\u010CAKAN VLADIMIR", {0}},
+ {"\\u010CAKAN VLADIMIR", {0}},
+ {"\\u010CAKAN VLADIMIR", {0}},
+ {"\\u010CAKARA ANA", {0}},
+ {"\\u010CAKAREVI\\u0106 MOMIR", {0}},
+ {"\\u010CAKAREVI\\u0106 NEDELJKO", {0}},
+ {"\\u010CAKI \\u0160ANDOR", {0}},
+ {"\\u010CAKI AMALIJA", {0}},
+ {"\\u010CAKI ANDRA\\u0160", {0}},
+ {"\\u010CAKI LADISLAV", {0}},
+ {"\\u010CAKI LAJO\\u0160", {0}},
+ {"\\u010CAKI LASLO", {0}},
};
ubrk_setText(bi, uData, -1, &status);
pos = ubrk_first(bi);
- for (i=0; i<sizeof(breaks); i++) {
+ for (i=0; i<(int)sizeof(breaks); i++) {
if (pos == i && breaks[i] != '*') {
log_err("FAIL: unexpected break at position %d found\n", pos);
break;
{ "de", testSentenceSuppressionsDe, testSentFwdOffsetsDe, testSentRevOffsetsDe },
{ "es@ss=standard", testSentenceSuppressionsEs, testSentSuppFwdOffsetsEs, testSentSuppRevOffsetsEs },
{ "es", testSentenceSuppressionsEs, testSentFwdOffsetsEs, testSentRevOffsetsEs },
- { NULL, NULL, NULL }
+ { NULL, NULL, NULL, NULL }
};
static void TestBreakIteratorSuppressions(void) {
static char * formatLevels(UBiDi *bidi, char *buffer) {
UErrorCode ec = U_ZERO_ERROR;
const UBiDiLevel* gotLevels = ubidi_getLevels(bidi, &ec);
- int len = ubidi_getLength(bidi);
+ int32_t len = ubidi_getLength(bidi);
char c;
- int i, k;
+ int32_t i, k;
if(U_FAILURE(ec)) {
strcpy(buffer, "BAD LEVELS");
}
for (i=0; i<len; i++) {
k = gotLevels[i];
- if (k >= sizeof(columns))
+ if (k >= (int32_t)sizeof(columns))
c = '+';
else
c = columns[k];
k = map[i];
if (k < 0)
c = '-';
- else if (k >= sizeof(columns))
+ else if (k >= (int32_t)sizeof(columns))
c = '+';
else
c = columns[k];
UConverterCallbackReason reason,
UErrorCode * err)
{
+ // suppress compiler warnings about unused variables
+ (void)codeUnits;
+ (void)length;
+ (void)codePoint;
+
TSCCContext *ctx = (TSCCContext*)context;
UConverterFromUCallback junkFrom;
UConverterCallbackReason reason,
UErrorCode * err)
{
+ // suppress compiler warnings about unused variables
+ (void)codeUnits;
+ (void)length;
+
TSCCContext *ctx = (TSCCContext*)context;
UConverterToUCallback junkFrom;
if(errorCode==U_BUFFER_OVERFLOW_ERROR) {
/* continue converting another chunk */
errorCode=U_ZERO_ERROR;
- if(targetLength+chunkSize<=sizeof(targetBuffer)) {
+ if(targetLength+chunkSize<=(int32_t)sizeof(targetBuffer)) {
targetLimit=target+chunkSize;
} else {
- targetLimit=targetBuffer+sizeof(targetBuffer);
+ targetLimit=targetBuffer+(int32_t)sizeof(targetBuffer);
}
} else if(U_FAILURE(errorCode)) {
/* failure */
char charUTF8[4], int32_t charUTF8Length,
char char0[8], int32_t char0Length,
char char1[8], int32_t char1Length) {
+ // suppress compiler warnings about unused variables
+ (void)char0;
+ (void)char0Length;
+ (void)char1;
+ (void)char1Length;
+
char utf8[16];
int32_t utf8Length;
log_verbose("count %d\n", count);
for (;;) {
- uint32_t ce;
+ int32_t ce;
UChar *e = u_strchr(s, 0x20);
if (e == 0) {
e = u_strchr(s, 0);
return;
}
while (ce != UCOL_NULLORDER) {
- if (ce != (uint32_t)ucol_next(iter, &status) ||
+ if (ce != ucol_next(iter, &status) ||
U_FAILURE(status)) {
log_err("Discontiguos contraction test mismatch\n");
return;
testLCID(UResourceBundle *currentBundle,
const char *localeName)
{
+ (void)currentBundle; // suppress compiler warnings about unused variables
UErrorCode status = U_ZERO_ERROR;
uint32_t expectedLCID;
char lcidStringC[64] = {0};
resultLen = uloc_getKeywordValue(kwSetTestCases[i].x, kwSetTestCases[i].k, buffer, 1023, &status);
if(U_FAILURE(status)) {
log_err("Err on test case %d for getKeywordValue: got error %s\n", i, u_errorName(status));
- } else if (resultLen != uprv_strlen(kwSetTestCases[i].v) || uprv_strcmp(buffer, kwSetTestCases[i].v) != 0) {
+ } else if (resultLen != (int32_t)uprv_strlen(kwSetTestCases[i].v) || uprv_strcmp(buffer, kwSetTestCases[i].v) != 0) {
log_err("FAIL: #%d getKeywordValue: got %s (%d) expected %s (%d)\n", i, buffer, resultLen,
kwSetTestCases[i].v, uprv_strlen(kwSetTestCases[i].v));
}
continue;
}
- if (length != uprv_strlen(temp2)) {
+ if (length != (int32_t)uprv_strlen(temp2)) {
log_err(" returned length %d not correct for uloc_getLocaleForLCID(%#04x), expected %d\n", length, lcid, uprv_strlen(temp2));
}
UCollationElements *iter2 = ucol_openElements(coll,
&(testdata[i][j]),
1, &status);
- uint32_t ce;
+ int32_t ce;
if (U_FAILURE(status)) {
log_err("Collation iterator creation failed\n");
return;
}
ce = ucol_next(iter2, &status);
while (ce != UCOL_NULLORDER) {
- if ((uint32_t)ucol_next(iter1, &status) != ce) {
+ if (ucol_next(iter1, &status) != ce) {
log_err("Collation elements in contraction split does not match\n");
return;
}
for (count = 0; count < 50; count ++)
{
int size = 0;
- UBool testresult = UNORM_YES;
+ UNormalizationCheckResult testresult = UNORM_YES;
UChar data[20];
UChar norm[100];
UChar nfd[100];
log_err("File %s, Line %d, (expected, acutal) = (\"%s\", \"%s\")\n",
__FILE__, __LINE__, numFormatted, desta);
}
- if (strlen(numFormatted) != resultSize) {
+ if ((int32_t)strlen(numFormatted) != resultSize) {
log_err("File %s, Line %d, (expected, actual) = (%d, %d)\n",
- __FILE__, __LINE__, strlen(numFormatted), resultSize);
+ __FILE__, __LINE__, (int32_t)strlen(numFormatted), resultSize);
}
/* Format with a FieldPosition parameter */
log_verbose("File %s, Line %d, got expected = \"%s\"\n",
__FILE__, __LINE__, desta);
}
- if (strlen(parseExpected) != resultSize) {
+ if ((int32_t)strlen(parseExpected) != resultSize) {
log_err("File %s, Line %d, (expected, actual) = (%d, %d)\n",
- __FILE__, __LINE__, strlen(parseExpected), resultSize);
+ __FILE__, __LINE__, (int32_t)strlen(parseExpected), resultSize);
}
/* Parse with a parsePos parameter */
log_verbose("File %s, Line %d, got expected = \"%s\"\n",
__FILE__, __LINE__, desta);
}
- if (strlen(numFormatted) != parsePos) {
+ if ((int32_t)strlen(numFormatted) != parsePos) {
log_err("File %s, Line %d, parsePos (expected, actual) = (\"%d\", \"%d\")\n",
- __FILE__, __LINE__, strlen(parseExpected), parsePos);
+ __FILE__, __LINE__, (int32_t)strlen(parseExpected), parsePos);
}
unum_close(fmt);
}
/* Assume rand has at least 12 bits of precision */
- for (i=0; i<sizeof(l); ++i)
+ for (i=0; i<(int32_t)sizeof(l); ++i)
((char*)&l)[i] = (char)((rand() & 0x0FF0) >> 4);
return l;
}
}
/* verify NUL-termination */
- if((p8 != buffer8 || length8 < sizeof(buffer8)) && s8[length8] != 0) {
+ if((p8 != buffer8 || length8 < (int32_t)sizeof(buffer8)) && s8[length8] != 0) {
log_err("ures_getUTF8String(%p, %ld, '%s') did not NUL-terminate\n",
resB, (long)idx, key);
}
/* test simple case folding */
p=simple;
- for(i=0; i<sizeof(simple)/12; p+=3, ++i) {
+ for(i=0; i<(int32_t)sizeof(simple)/12; p+=3, ++i) {
if(u_foldCase(p[0], U_FOLD_CASE_DEFAULT)!=p[1]) {
log_err("error: u_foldCase(0x%04lx, default)=0x%04lx instead of 0x%04lx\n",
p[0], u_foldCase(p[0], U_FOLD_CASE_DEFAULT), p[1]);
log_err("uprv_isInvariantString(\"\\0\") failed\n");
}
- for(i=0; i<(sizeof(variantChars)-1); ++i) {
+ for(i=0; i<(int32_t)(sizeof(variantChars)-1); ++i) {
if(uprv_isInvariantString(variantChars+i, 1)) {
log_err("uprv_isInvariantString(variantChars[%d]) failed\n", i);
}
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode)
{
+ (void)fieldCount; // suppress compiler warnings about unused variable
char buffer[100];
const char *d;
char *end;
/* get BiDi category, field 4 */
*fields[4][1]=0;
i=MakeDir(fields[4][0]);
- if(i!=u_charDirection(c) || i!=u_getIntPropertyValue(c, UCHAR_BIDI_CLASS)) {
+ if(i!=(int32_t)u_charDirection(c) || i!=u_getIntPropertyValue(c, UCHAR_BIDI_CLASS)) {
log_err("error: u_charDirection(U+%04lx)==%u instead of %u (%s)\n", c, u_charDirection(c), MakeDir(fields[4][0]), fields[4][0]);
}
static UBool U_CALLCONV
enumDefaultsRange(const void *context, UChar32 start, UChar32 limit, UCharCategory type) {
+ (void)context; // suppress compiler warnings about unused variable
+
/* default Bidi classes for unassigned code points, from the DerivedBidiClass.txt header */
static const int32_t defaultBidi[][2]={ /* { limit, class } */
{ 0x0590, U_LEFT_TO_RIGHT },
}
if( u_charDirection(c)!=shouldBeDir ||
- u_getIntPropertyValue(c, UCHAR_BIDI_CLASS)!=shouldBeDir
+ (UCharDirection)u_getIntPropertyValue(c, UCHAR_BIDI_CLASS)!=shouldBeDir
) {
log_err("error: u_charDirection(unassigned/PUA U+%04lx)=%s should be %s\n",
c, dirStrings[u_charDirection(c)], dirStrings[shouldBeDir]);
uint32_t code;
const char *name, *oldName, *extName, *alias;
} names[]={
- {0x0061, "LATIN SMALL LETTER A", "", "LATIN SMALL LETTER A"},
+ {0x0061, "LATIN SMALL LETTER A", "", "LATIN SMALL LETTER A", NULL},
{0x01a2, "LATIN CAPITAL LETTER OI", "",
"LATIN CAPITAL LETTER OI",
"LATIN CAPITAL LETTER GHA"},
{0x0284, "LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK", "",
- "LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK" },
+ "LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK", NULL},
{0x0fd0, "TIBETAN MARK BSKA- SHOG GI MGO RGYAN", "",
"TIBETAN MARK BSKA- SHOG GI MGO RGYAN",
"TIBETAN MARK BKA- SHOG GI MGO RGYAN"},
- {0x3401, "CJK UNIFIED IDEOGRAPH-3401", "", "CJK UNIFIED IDEOGRAPH-3401" },
- {0x7fed, "CJK UNIFIED IDEOGRAPH-7FED", "", "CJK UNIFIED IDEOGRAPH-7FED" },
- {0xac00, "HANGUL SYLLABLE GA", "", "HANGUL SYLLABLE GA" },
- {0xd7a3, "HANGUL SYLLABLE HIH", "", "HANGUL SYLLABLE HIH" },
- {0xd800, "", "", "<lead surrogate-D800>" },
- {0xdc00, "", "", "<trail surrogate-DC00>" },
- {0xff08, "FULLWIDTH LEFT PARENTHESIS", "", "FULLWIDTH LEFT PARENTHESIS" },
- {0xffe5, "FULLWIDTH YEN SIGN", "", "FULLWIDTH YEN SIGN" },
- {0xffff, "", "", "<noncharacter-FFFF>" },
+ {0x3401, "CJK UNIFIED IDEOGRAPH-3401", "", "CJK UNIFIED IDEOGRAPH-3401", NULL},
+ {0x7fed, "CJK UNIFIED IDEOGRAPH-7FED", "", "CJK UNIFIED IDEOGRAPH-7FED", NULL},
+ {0xac00, "HANGUL SYLLABLE GA", "", "HANGUL SYLLABLE GA", NULL},
+ {0xd7a3, "HANGUL SYLLABLE HIH", "", "HANGUL SYLLABLE HIH", NULL},
+ {0xd800, "", "", "<lead surrogate-D800>", NULL},
+ {0xdc00, "", "", "<trail surrogate-DC00>", NULL},
+ {0xff08, "FULLWIDTH LEFT PARENTHESIS", "", "FULLWIDTH LEFT PARENTHESIS", NULL},
+ {0xffe5, "FULLWIDTH YEN SIGN", "", "FULLWIDTH YEN SIGN", NULL},
+ {0xffff, "", "", "<noncharacter-FFFF>", NULL},
{0x1d0c5, "BYZANTINE MUSICAL SYMBOL FHTORA SKLIRON CHROMA VASIS", "",
"BYZANTINE MUSICAL SYMBOL FHTORA SKLIRON CHROMA VASIS",
"BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS"},
- {0x23456, "CJK UNIFIED IDEOGRAPH-23456", "", "CJK UNIFIED IDEOGRAPH-23456" }
+ {0x23456, "CJK UNIFIED IDEOGRAPH-23456", "", "CJK UNIFIED IDEOGRAPH-23456", NULL}
};
static UBool
uset_add,
uset_addRange,
uset_addString,
- NULL /* don't need remove() */
+ NULL, /* don't need remove() */
+ NULL /* don't need removeRange() */
};
sa.set=set;
uprv_getCharNameCharacters(&sa);
caseFoldingLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
+ (void)fieldCount; // suppress compiler warnings about unused variable
+
CaseFoldingData *pData=(CaseFoldingData *)context;
char *end;
UChar full[32];
static void
TestCaseFolding() {
- CaseFoldingData data={ NULL };
+ CaseFoldingData data={ NULL, 0, 0, {0}, 0, 0 };
char *fields[3][2];
UErrorCode errorCode;
originalCount = uenum_count(en, &status);
for (count=0;;count++) {
const char *str = uenum_next(en, &len, &status);
- if (str == NULL || len != expectedLen || strlen(str) != expectedLen) {
+ if (str == NULL || len != expectedLen || (int32_t)strlen(str) != expectedLen) {
break;
}
}
withTrail16, u_strlen(withTrail16),
0xfffd, &numSubstitutions,
&err);
- if(U_FAILURE(err) || u8DestLen!=uprv_strlen((const char *)withTrail8SubFFFD) ||
+ if(U_FAILURE(err) || u8DestLen!=(int32_t)uprv_strlen((const char *)withTrail8SubFFFD) ||
0!=uprv_memcmp((const char *)withTrail8SubFFFD, out8, u8DestLen+1) ||
numSubstitutions!=1) {
log_err("error: u_strToUTF8WithSub(length) failed\n");
withTrail16, -1,
0x1a, &numSubstitutions,
&err);
- if(U_FAILURE(err) || u8DestLen!=uprv_strlen((const char *)withTrail8Sub1A) ||
+ if(U_FAILURE(err) || u8DestLen!=(int32_t)uprv_strlen((const char *)withTrail8Sub1A) ||
0!=uprv_memcmp((const char *)withTrail8Sub1A, out8, u8DestLen+1) ||
numSubstitutions!=1) {
log_err("error: u_strToUTF8WithSub(NUL termination) failed\n");
withTrail16, -1,
0xfffd, &numSubstitutions,
&err);
- if(err!=U_BUFFER_OVERFLOW_ERROR || u8DestLen!=uprv_strlen((const char *)withTrail8SubFFFD) ||
+ if(err!=U_BUFFER_OVERFLOW_ERROR || u8DestLen!=(int32_t)uprv_strlen((const char *)withTrail8SubFFFD) ||
numSubstitutions!=1) {
log_err("error: u_strToUTF8WithSub(preflight/NUL termination) failed\n");
}
const void *gContext;
static void * U_CALLCONV myMemAlloc(const void *context, size_t size) {
+ (void)context; // suppress compiler warnings about unused variable
char *retPtr = (char *)malloc(size+sizeof(ctest_AlignedMemory));
if (retPtr != NULL) {
retPtr += sizeof(ctest_AlignedMemory);
}
static void U_CALLCONV myMemFree(const void *context, void *mem) {
+ (void)context; // suppress compiler warnings about unused variable
char *freePtr = (char *)mem;
if (freePtr != NULL) {
freePtr -= sizeof(ctest_AlignedMemory);
static void * U_CALLCONV myMemRealloc(const void *context, void *mem, size_t size) {
+ (void)context; // suppress compiler warnings about unused variable
char *p = (char *)mem;
char *retPtr;
offset16 = 0;
offset8 = 0;
while(currCh <= UNICODE_LIMIT
- && offset16 < (MAX_LENGTH/sizeof(UChar) - MAX_UTF16_LEN)
+ && offset16 < ((int32_t)(MAX_LENGTH/sizeof(UChar) - MAX_UTF16_LEN))
&& offset8 < (MAX_LENGTH - MAX_UTF8_LEN))
{
if (currCh == SURROGATE_HIGH_START) {
offset16 = 0;
offset32 = 0;
while(currCh <= UNICODE_LIMIT
- && offset16 < (MAX_LENGTH/sizeof(UChar) - MAX_UTF16_LEN)
- && offset32 < (MAX_LENGTH/sizeof(UChar32) - MAX_UTF32_LEN))
+ && offset16 < ((int32_t)(MAX_LENGTH/sizeof(UChar) - MAX_UTF16_LEN))
+ && offset32 < ((int32_t)(MAX_LENGTH/sizeof(UChar32) - MAX_UTF32_LEN)))
{
if (currCh == SURROGATE_HIGH_START) {
currCh = SURROGATE_LOW_END + 1; /* Skip surrogate range */
/* Callback for TestJitterbug6175, should only get called for empty segment errors */
static void UCNV_TO_U_CALLBACK_EMPTYSEGMENT( const void *context, UConverterToUnicodeArgs *toArgs, const char* codeUnits,
int32_t length, UConverterCallbackReason reason, UErrorCode * err ) {
+ // suppress compiler warnings about unused variables
+ (void)context;
+ (void)codeUnits;
+ (void)length;
if (reason > UCNV_IRREGULAR) {
return;
}
int32_t m=-1;
int32_t x4=x>>4;
int32_t m1=m>>1;
- UBool signedRightShiftIsArithmetic= x4==0xffff5fff && m1==-1;
+ UBool signedRightShiftIsArithmetic= (x4==(int32_t)0xffff5fff && m1==-1);
if(signedRightShiftIsArithmetic==U_SIGNED_RIGHT_SHIFT_IS_ARITHMETIC) {
log_info("signed right shift is Arithmetic Shift Right: %d\n",
signedRightShiftIsArithmetic);
}
static UBool U_CALLCONV FindCallback(const void* context , int64_t matchIndex) {
+ // suppress compiler warnings about unused variables
+ (void)context;
+ (void)matchIndex;
return FALSE;
}
static UBool U_CALLCONV MatchCallback(const void *context, int32_t steps) {
+ // suppress compiler warnings about unused variables
+ (void)context;
+ (void)steps;
return FALSE;
}
static void
printLines(const Line *lines) {
+ (void)lines; // suppress compiler warnings about unused variable
#if 0
int32_t i, j;
for(i=0; i<NUM_LINES; ++i) {
unescapeData(const char* src, int32_t srcLen,
char* dest, int32_t destCapacity,
UErrorCode* status){
+ (void)srcLen; // suppress compiler warnings about unused variable
UChar b1Stack[MAX_BUFFER_SIZE];
int32_t b1Capacity = MAX_BUFFER_SIZE,
strprepProfileLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
+ (void)fieldCount; // suppress compiler warnings about unused variable
uint32_t mapping[40];
char *end, *map;
uint32_t code;
void
doStringPrepTest(const char* binFileName, const char* txtFileName, int32_t options, UErrorCode* errorCode){
-
+ (void)options; // suppress compiler warnings about unused variable
const char *testdatapath = loadTestData(errorCode);
const char *srcdatapath = NULL;
const char *relativepath = NULL;
char expectedResult[300];
/* check that local buffers are big enough for the test case */
- if (sizeof(buf) <= bufCap) {
+ if ((int32_t)sizeof(buf) <= bufCap) {
log_err("At file:line %s:%d, requested bufCap too large.\n");
return;
}
static UBool gFnFormatError = FALSE;
static void U_CALLCONV testTraceEntry(const void *context, int32_t fnNumber) {
+ (void)context; // suppress compiler warnings about unused variable
const char *fnName;
const char *bogusFnName;
static void U_CALLCONV testTraceExit(const void *context, int32_t fnNumber,
const char *fmt, va_list args) {
+ (void)context; // suppress compiler warnings about unused variable
char buf[1000];
const char *fnName;
const char *bogusFnName;
static void U_CALLCONV testTraceData(const void *context, int32_t fnNumber, int32_t level,
const char *fmt, va_list args) {
+ // suppress compiler warnings about unused variables
+ (void)context;
+ (void)level;
char buf[1000];
const char *fnName;
const char *bogusFnName;
/* utrie2_enum() callback, modifies a value */
static uint32_t U_CALLCONV
testEnumValue(const void *context, uint32_t value) {
+ (void)context; // suppress compiler warnings about unused variable
return value^0x5555;
}
testTrieEnum(const char *testName,
const UTrie2 *trie,
const CheckRange checkRanges[], int32_t countCheckRanges) {
+ (void)testName; // suppress compiler warnings about unused variable
/* skip over special values */
while(countCheckRanges>0 && checkRanges[0].limit<=0) {
++checkRanges;
values[countValues++]=value;
}
/* write an illegal byte sequence */
- if(i8<sizeof(illegal)) {
+ if(i8<(int32_t)sizeof(illegal)) {
U8_FWD_1(illegal, i8, sizeof(illegal));
while(prev8<i8) {
s[length++]=illegal[prev8++];
}
}
/* write the remaining illegal byte sequences */
- while(i8<sizeof(illegal)) {
+ while(i8<(int32_t)sizeof(illegal)) {
U8_FWD_1(illegal, i8, sizeof(illegal));
while(prev8<i8) {
s[length++]=illegal[prev8++];
static uint32_t U_CALLCONV
_testEnumValue(const void *context, uint32_t value) {
+ (void)context; // suppress compiler warnings about unused variable
return value^0x5555;
}
static int32_t U_CALLCONV
dummyGetFoldingOffset(uint32_t data) {
+ (void)data; // suppress compiler warnings about unused variable
return -1; /* never get non-initialValue data for supplementary code points */
}
fclose(f);
return FALSE;
}
- if (length != fread(tt->text, 1, length, f)) {
+ if (length != (int32_t)fread(tt->text, 1, length, f)) {
log_err("error reading %ld bytes from test text file\n", (long)length);
length = 0;
uprv_free(tt->text);
/* ucptrie_enum() callback, modifies a value */
static uint32_t U_CALLCONV
testFilter(const void *context, uint32_t value) {
+ (void)context; // suppress compiler warnings about unused variable
return value ^ 0x5555;
}
values[countValues++]=value;
}
/* write an illegal byte sequence */
- if(i8<sizeof(illegal)) {
+ if(i8<(int32_t)sizeof(illegal)) {
U8_FWD_1(illegal, i8, sizeof(illegal));
while(prev8<i8) {
s[length++]=illegal[prev8++];
}
}
/* write the remaining illegal byte sequences */
- while(i8<sizeof(illegal)) {
+ while(i8<(int32_t)sizeof(illegal)) {
U8_FWD_1(illegal, i8, sizeof(illegal));
while(prev8<i8) {
s[length++]=illegal[prev8++];
isAcceptable1(void *context,
const char *type, const char *name,
const UDataInfo *pInfo) {
+ (void)context; // suppress compiler warnings about unused variable
if( pInfo->size>=20 &&
pInfo->isBigEndian==U_IS_BIG_ENDIAN &&
isAcceptable2(void *context,
const char *type, const char *name,
const UDataInfo *pInfo){
+ (void)context; // suppress compiler warnings about unused variable
UVersionInfo unicodeVersion;
u_getUnicodeVersion(unicodeVersion);
isAcceptable3(void *context,
const char *type, const char *name,
const UDataInfo *pInfo){
+ (void)context; // suppress compiler warnings about unused variable
if( pInfo->size>=20 &&
pInfo->isBigEndian==U_IS_BIG_ENDIAN &&
{0x31, 0x31, 0x31, 0x31}, /* dataFormat="1111" */
{0, 0, 0, 0}, /* formatVersion */
- {0, 0, 0, 0}} /* dataVersion */
+ {0, 0, 0, 0}}, /* dataVersion */
+ 0
};
#endif
static void U_CALLCONV
printError(void *context, const char *fmt, va_list args) {
+ (void)context; // suppress compiler warnings about unused variable
vlog_info("[swap] ", fmt, args);
log_err("\n"); /* Register error */
}
static int32_t U_CALLCONV
chArrayCount(UEnumeration *en, UErrorCode *status) {
+ (void)status; // suppress compiler warnings about unused variable
return cont->maxIndex;
}
static const UChar* U_CALLCONV
chArrayUNext(UEnumeration *en, int32_t *resultLength, UErrorCode *status) {
+ (void)status; // suppress compiler warnings about unused variable
if(cont->currIndex >= cont->maxIndex) {
return NULL;
}
static const char* U_CALLCONV
chArrayNext(UEnumeration *en, int32_t *resultLength, UErrorCode *status) {
+ (void)status; // suppress compiler warnings about unused variable
if(cont->currIndex >= cont->maxIndex) {
return NULL;
}
static void U_CALLCONV
chArrayReset(UEnumeration *en, UErrorCode *status) {
+ (void)status; // suppress compiler warnings about unused variable
cont->currIndex = 0;
}
static int32_t U_CALLCONV
uchArrayCount(UEnumeration *en, UErrorCode *status) {
+ (void)status; // suppress compiler warnings about unused variable
return ucont->maxIndex;
}
static const UChar* U_CALLCONV
uchArrayUNext(UEnumeration *en, int32_t *resultLength, UErrorCode *status) {
+ (void)status; // suppress compiler warnings about unused variable
if(ucont->currIndex >= ucont->maxIndex) {
return NULL;
}
static void U_CALLCONV
uchArrayReset(UEnumeration *en, UErrorCode *status) {
+ (void)status; // suppress compiler warnings about unused variable
ucont->currIndex = 0;
}
log_verbose("%s:%d: OK: string #%d got '%s'\n", __FILE__, line, i, c);
}
- if(len!=strlen(compareToChar[i])) {
+ if(len!=(int32_t)strlen(compareToChar[i])) {
log_err("%s:%d: FAIL: string #%d expected len %d got %d\n", __FILE__, line, i, strlen(compareToChar[i]), len);
} else {
log_verbose("%s:%d: OK: string #%d got len %d\n", __FILE__, line, i, len);
log_verbose("%s:%d: OK: ustring #%d got '%s'\n", __FILE__, line, i, compareToChar[i]);
}
- if(len!=strlen(compareToChar[i])) {
+ if(len!=(int32_t)strlen(compareToChar[i])) {
log_err("%s:%d: FAIL: ustring #%d expected len %d got %d\n", __FILE__, line, i, strlen(compareToChar[i]), len);
} else {
log_verbose("%s:%d: OK: ustring #%d got len %d\n", __FILE__, line, i, len);
UFieldCategory expectedCategory,
const UFieldPosition* expectedFieldPositions,
int32_t expectedFieldPositionsLength) {
+ (void)expectedFieldPositionsLength; // suppress compiler warnings about unused variable
UErrorCode ec = U_ZERO_ERROR;
checkFormattedValueString(message, fv, expectedString, &ec);
if (U_FAILURE(ec)) { return; }
const UChar* expectedString,
const UFieldPositionWithCategory* expectedFieldPositions,
int32_t length) {
+ (void)length; // suppress compiler warnings about unused variable
UErrorCode ec = U_ZERO_ERROR;
checkFormattedValueString(message, fv, expectedString, &ec);
if (U_FAILURE(ec)) { return; }
if (assertSuccessCheck("unumf_formatInt() failed", &ec, TRUE)) {
// field position test:
- UFieldPosition ufpos = {UNUM_DECIMAL_SEPARATOR_FIELD};
+ UFieldPosition ufpos = {UNUM_DECIMAL_SEPARATOR_FIELD, 0, 0};
unumf_resultNextFieldPosition(uresult, &ufpos, &ec);
assertIntEquals("Field position should be correct", 14, ufpos.beginIndex);
assertIntEquals("Field position should be correct", 15, ufpos.endIndex);
{UNUM_MEASURE_UNIT_FIELD, 18, 19}
};
UFieldPosition actual;
- for (int32_t i = 0; i < sizeof(expectedFields) / sizeof(*expectedFields); i++) {
+ for (int32_t i = 0; i < (int32_t)(sizeof(expectedFields) / sizeof(*expectedFields)); i++) {
// Iterate using the UFieldPosition to hold state...
UFieldPosition expected = expectedFields[i];
actual.field = ufieldpositer_next(ufpositer, &actual.beginIndex, &actual.endIndex);
matchlength = search.size[count];
usearch_next(strsrch, &status);
if (matchindex != usearch_getMatchedStart(strsrch) ||
- matchlength != (uint32_t)usearch_getMatchedLength(strsrch)) {
+ matchlength != usearch_getMatchedLength(strsrch)) {
char *str = toCharString(usearch_getText(strsrch, &textlength));
log_err("Text: %s\n", str);
str = toCharString(usearch_getPattern(strsrch, &textlength));
count ++;
if (usearch_getMatchedText(strsrch, matchtext, 128, &status) !=
- (int32_t) matchlength || U_FAILURE(status) ||
+ matchlength || U_FAILURE(status) ||
memcmp(matchtext,
usearch_getText(strsrch, &textlength) + matchindex,
matchlength * sizeof(UChar)) != 0) {
matchlength = search.size[count];
usearch_previous(strsrch, &status);
if (matchindex != usearch_getMatchedStart(strsrch) ||
- matchlength != (uint32_t)usearch_getMatchedLength(strsrch)) {
+ matchlength != usearch_getMatchedLength(strsrch)) {
char *str = toCharString(usearch_getText(strsrch, &textlength));
log_err("Text: %s\n", str);
str = toCharString(usearch_getPattern(strsrch, &textlength));
}
if (usearch_getMatchedText(strsrch, matchtext, 128, &status) !=
- (int32_t) matchlength || U_FAILURE(status) ||
+ matchlength || U_FAILURE(status) ||
memcmp(matchtext,
usearch_getText(strsrch, &textlength) + matchindex,
matchlength * sizeof(UChar)) != 0) {
ucol_setStrength(usearch_getCollator(strsrch), search.strength);
usearch_reset(strsrch);
while (U_SUCCESS(status) && matchindex >= 0) {
- uint32_t matchlength = search.size[count];
+ int32_t matchlength = search.size[count];
usearch_next(strsrch, &status);
if (matchindex != usearch_getMatchedStart(strsrch) ||
- matchlength != (uint32_t)usearch_getMatchedLength(strsrch)) {
+ matchlength != usearch_getMatchedLength(strsrch)) {
char *str = toCharString(usearch_getText(strsrch,
&textlength));
log_err("Text: %s\n", str);
usearch_setOffset(strsrch, matchindex + matchlength, &status);
usearch_previous(strsrch, &status);
if (matchindex != usearch_getMatchedStart(strsrch) ||
- matchlength != (uint32_t)usearch_getMatchedLength(strsrch)) {
+ matchlength != usearch_getMatchedLength(strsrch)) {
char *str = toCharString(usearch_getText(strsrch,
&textlength));
log_err("Text: %s\n", str);
}
status = U_ZERO_ERROR;
if (usearch_getMatchedText(strsrch, NULL, 0, &status) !=
- (int32_t)matchlength || U_SUCCESS(status)){
+ matchlength || U_SUCCESS(status)){
log_err("Error pre-flighting match length\n");
}
status = U_ZERO_ERROR;
if (usearch_getMatchedText(strsrch, matchtext, 0, &status) !=
- (int32_t)matchlength || U_SUCCESS(status)){
+ matchlength || U_SUCCESS(status)){
log_err("Error getting match text with buffer size 0\n");
}
status = U_ZERO_ERROR;
if (usearch_getMatchedText(strsrch, matchtext, matchlength, &status)
- != (int32_t)matchlength || matchtext[matchlength - 1] == 0 ||
+ != matchlength || matchtext[matchlength - 1] == 0 ||
U_FAILURE(status)){
log_err("Error getting match text with exact size\n");
}
status = U_ZERO_ERROR;
if (usearch_getMatchedText(strsrch, matchtext, 128, &status) !=
- (int32_t) matchlength || U_FAILURE(status) ||
+ matchlength || U_FAILURE(status) ||
memcmp(matchtext,
usearch_getText(strsrch, &textlength) + matchindex,
matchlength * sizeof(UChar)) != 0 ||
usearch_setText(strsrch, text, -1, &status);
usearch_setPattern(strsrch, pattern, -1, &status);
while (U_SUCCESS(status) && matchindex >= 0) {
- uint32_t matchlength = search.size[count];
+ int32_t matchlength = search.size[count];
usearch_next(strsrch, &status);
if (matchindex != usearch_getMatchedStart(strsrch) ||
- matchlength != (uint32_t)usearch_getMatchedLength(strsrch)) {
+ matchlength != usearch_getMatchedLength(strsrch)) {
char *str = toCharString(usearch_getText(strsrch,
&textlength));
log_err("Text: %s\n", str);
}
#if !U_HIDE_OBSOLETE_UTF_OLD_H
setOffset=offset;
- UTF8_SET_CHAR_LIMIT_SAFE(input,0, setOffset, sizeof(input));
+ UTF8_SET_CHAR_LIMIT_SAFE(input,0, setOffset, (int32_t)sizeof(input));
if(setOffset != limit_safe[i]){
log_err("ERROR: UTF8_SET_CHAR_LIMIT_SAFE failed for offset=%ld. Expected:%ld Got:%ld\n", offset, limit_safe[i], setOffset);
}
#endif
setOffset=offset;
- U8_SET_CP_LIMIT(input,0, setOffset, sizeof(input));
+ U8_SET_CP_LIMIT(input,0, setOffset, (int32_t)sizeof(input));
if(setOffset != limit_safe[i]){
log_err("ERROR: U8_SET_CP_LIMIT failed for offset=%ld. Expected:%ld Got:%ld\n", offset, limit_safe[i], setOffset);
}
}
/* Assume rand has at least 12 bits of precision */
- for (i = 0; i < sizeof(ran); i += 1) {
+ for (i = 0; i < (int32_t)sizeof(ran); i += 1) {
((char*)&ran)[i] = (char)((rand() & 0x0FF0) >> 4);
}
virtual UBool operator==(const Collator& other) const;
// Collator::operator!= calls !Collator::operator== which works for all subclasses.
virtual void setLocales(const Locale& requestedLocale, const Locale& validLocale, const Locale& actualLocale);
- TestCollator() : Collator() {};
+ TestCollator() : Collator() {}
TestCollator(UCollationStrength collationStrength,
- UNormalizationMode decompositionMode) : Collator(collationStrength, decompositionMode) {};
+ UNormalizationMode decompositionMode) : Collator(collationStrength, decompositionMode) {}
};
inline UBool TestCollator::operator==(const Collator& other) const {
}
- virtual ~SCharacterIterator(){};
+ virtual ~SCharacterIterator(){}
void setText(const UnicodeString& newText){
}
virtual UChar nextPostInc(void){ return text.charAt(pos++);}
virtual UChar32 next32PostInc(void){return text.char32At(pos++);}
- virtual UBool hasNext() { return TRUE;};
- virtual UChar first(){return DONE;};
- virtual UChar32 first32(){return DONE;};
- virtual UChar last(){return DONE;};
- virtual UChar32 last32(){return DONE;};
- virtual UChar setIndex(int32_t /*pos*/){return DONE;};
- virtual UChar32 setIndex32(int32_t /*pos*/){return DONE;};
- virtual UChar current() const{return DONE;};
- virtual UChar32 current32() const{return DONE;};
- virtual UChar next(){return DONE;};
- virtual UChar32 next32(){return DONE;};
- virtual UChar previous(){return DONE;};
- virtual UChar32 previous32(){return DONE;};
+ virtual UBool hasNext() { return TRUE;}
+ virtual UChar first(){return DONE;}
+ virtual UChar32 first32(){return DONE;}
+ virtual UChar last(){return DONE;}
+ virtual UChar32 last32(){return DONE;}
+ virtual UChar setIndex(int32_t /*pos*/){return DONE;}
+ virtual UChar32 setIndex32(int32_t /*pos*/){return DONE;}
+ virtual UChar current() const{return DONE;}
+ virtual UChar32 current32() const{return DONE;}
+ virtual UChar next(){return DONE;}
+ virtual UChar32 next32(){return DONE;}
+ virtual UChar previous(){return DONE;}
+ virtual UChar32 previous32(){return DONE;}
virtual int32_t move(int32_t delta,CharacterIterator::EOrigin origin){
switch(origin) {
case kStart:
}
return pos;
- };
+ }
virtual int32_t move32(int32_t delta, CharacterIterator::EOrigin origin){
switch(origin) {
case kStart:
}
return pos;
- };
- virtual UBool hasPrevious() {return TRUE;};
+ }
+ virtual UBool hasPrevious() {return TRUE;}
SCharacterIterator& operator=(const SCharacterIterator& that){
text = that.text;
class InvariantStringPiece: public StringPiece {
public:
InvariantStringPiece(const UnicodeString &s);
- ~InvariantStringPiece() {};
+ ~InvariantStringPiece() {}
private:
MaybeStackArray<char, 20> buf;
};
class UnicodeStringPiece: public StringPiece {
public:
UnicodeStringPiece(const UnicodeString &s);
- ~UnicodeStringPiece() {};
+ ~UnicodeStringPiece() {}
private:
MaybeStackArray<char, 20> buf;
};
class StubNumberFormat :public NumberFormat{
public:
- StubNumberFormat(){};
+ StubNumberFormat(){}
virtual UnicodeString& format(double ,UnicodeString& appendTo,FieldPosition& ) const {
return appendTo;
}
US(const UnicodeString &us) {
int32_t bufLen = us.extract((int32_t)0, us.length(), (char *)NULL, (uint32_t)0) + 1;
buf = (char *)uprv_malloc(bufLen);
- us.extract(0, us.length(), buf, bufLen); };
- const char *cstr() {return buf;};
- ~US() { uprv_free(buf);};
+ us.extract(0, us.length(), buf, bufLen); }
+ const char *cstr() {return buf;}
+ ~US() { uprv_free(buf);}
};
class MonkeyTestData: public UObject {
public:
- MonkeyTestData() {};
- ~MonkeyTestData() {};
+ MonkeyTestData() {}
+ ~MonkeyTestData() {}
void set(BreakRules *rules, IntlTest::icu_rand &rand, UErrorCode &status);
void clearActualBreaks();
void dump(int32_t around = -1) const;
private:
RBBIMonkeyImpl *fMonkeyImpl;
public:
- RBBIMonkeyThread(RBBIMonkeyImpl *impl) : fMonkeyImpl(impl) {};
- void run() U_OVERRIDE { fMonkeyImpl->runTest(); };
+ RBBIMonkeyThread(RBBIMonkeyImpl *impl) : fMonkeyImpl(impl) {}
+ void run() U_OVERRIDE { fMonkeyImpl->runTest(); }
};
private:
void openBreakRules(const char *fileName, UErrorCode &status);
int32_t maxCalls;
int32_t numCalls;
int32_t lastSteps;
- void reset(int32_t max) {maxCalls=max; numCalls=0; lastSteps=0;};
+ void reset(int32_t max) {maxCalls=max; numCalls=0; lastSteps=0;}
};
U_CDECL_BEGIN
int64_t lastIndex;
int32_t maxCalls;
int32_t numCalls;
- void reset(int32_t max) {maxCalls=max; numCalls=0;lastIndex=0;};
+ void reset(int32_t max) {maxCalls=max; numCalls=0;lastIndex=0;}
};
// call-back function for find().
class ThreadPoolThread: public SimpleThread {
public:
- ThreadPoolThread(ThreadPoolBase *pool, int32_t threadNum) : fPool(pool), fNum(threadNum) {};
+ ThreadPoolThread(ThreadPoolBase *pool, int32_t threadNum) : fPool(pool), fNum(threadNum) {}
virtual void run() {fPool->callFn(fNum); }
ThreadPoolBase *fPool;
int32_t fNum;
void (TestClass::*fRunFnPtr)(int32_t);
public:
ThreadPool(TestClass *test, int howMany, void (TestClass::*runFnPtr)(int32_t threadNumber)) :
- ThreadPoolBase(test, howMany), fRunFnPtr(runFnPtr) {};
- virtual ~ThreadPool() {};
+ ThreadPoolBase(test, howMany), fRunFnPtr(runFnPtr) {}
+ virtual ~ThreadPool() {}
private:
virtual void callFn(int32_t param) {
TestClass *test = dynamic_cast<TestClass *>(fIntlTest);
class StubSearchIterator:public SearchIterator{
public:
StubSearchIterator(){}
- virtual void setOffset(int32_t , UErrorCode &) {};
- virtual int32_t getOffset(void) const {return 0;};
- virtual SearchIterator* safeClone(void) const {return NULL;};
- virtual int32_t handleNext(int32_t , UErrorCode &){return 0;};
- virtual int32_t handlePrev(int32_t , UErrorCode &) {return 0;};
+ virtual void setOffset(int32_t , UErrorCode &) {}
+ virtual int32_t getOffset(void) const {return 0;}
+ virtual SearchIterator* safeClone(void) const {return NULL;}
+ virtual int32_t handleNext(int32_t , UErrorCode &){return 0;}
+ virtual int32_t handlePrev(int32_t , UErrorCode &) {return 0;}
virtual UClassID getDynamicClassID() const {
static char classID = 0;
return (UClassID)&classID;
public:
virtual UnicodeFunctor* clone() const {return NULL;}
static UClassID getStaticClassID(void) {return (UClassID)&MyUnicodeFunctorTestClassID;}
- virtual UClassID getDynamicClassID(void) const {return getStaticClassID();};
+ virtual UClassID getDynamicClassID(void) const {return getStaticClassID();}
virtual void setData(const TransliterationRuleData*) {}
};
public:
LegalIndic();
virtual UBool is(const UnicodeString& sourceString) const;
- virtual ~LegalIndic() {};
+ virtual ~LegalIndic() {}
};
UBool LegalIndic::is(const UnicodeString& sourceString) const{
int cp=sourceString.charAt(0);
class TestArabicShapeThreads : public SimpleThread
{
public:
- TestArabicShapeThreads() {};
- virtual void run() { doTailTest(); };
+ TestArabicShapeThreads() {}
+ virtual void run() { doTailTest(); }
private:
void doTailTest();
};
noLines(0),
isAtLeastUCA62(TRUE)
{
- };
+ }
void setCollator(Collator *c, Line *l, int32_t nl, UBool atLeastUCA62)
{
coll = c;
: SimpleThread(),
fTraceInfo(0)
{
- };
+ }
virtual void run()
Transliterator *gSharedTranslit = NULL;
class TxThread: public SimpleThread {
public:
- TxThread() {};
+ TxThread() {}
~TxThread();
void run();
};
UnifiedCacheThread(
const UnifiedCache *cache,
const char *loc,
- const char *loc2) : fCache(cache), fLoc(loc), fLoc2(loc2) {};
- ~UnifiedCacheThread() {};
+ const char *loc2) : fCache(cache), fLoc(loc), fLoc2(loc2) {}
+ ~UnifiedCacheThread() {}
void run();
void exerciseByLocale(const Locale &);
const UnifiedCache *fCache;
class BreakTranslitThread: public SimpleThread {
public:
- BreakTranslitThread() {};
- ~BreakTranslitThread() {};
+ BreakTranslitThread() {}
+ ~BreakTranslitThread() {}
void run();
};
class TestIncDecThread : public SimpleThread {
public:
- TestIncDecThread() { };
+ TestIncDecThread() {}
virtual void run();
};
class Test20104Thread : public SimpleThread {
public:
- Test20104Thread() { };
+ Test20104Thread() {}
virtual void run();
};
for (int i=0; i<UPRV_LENGTHOF(times); i++) {
times[i] = 0;
}
- };
+ }
void resetTestIteration() {
localeIndex = -1;
#endif
#if !UCONFIG_NO_FORMATTING
static void TestBadFScanfFormat(const char *format, const UChar *uValue, const char *cValue) {
+ (void)cValue; // suppress compiler warnings about unused variable
UFILE *myFile;
UChar uBuffer[256];
int32_t uNumScanned;
static void TestBadSScanfFormat(const char *format, const UChar *uValue, const char *cValue) {
#if !UCONFIG_NO_FORMATTING
+ (void)cValue; // suppress compiler warnings about unused variable
UChar uBuffer[256];
int32_t uNumScanned;
static int traceFnNestingDepth = 0;
U_CDECL_BEGIN
static void U_CALLCONV TraceEntry(const void *context, int32_t fnNumber) {
+ (void)context; // suppress compiler warnings about unused variable
char buf[500];
- utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() enter.\n", utrace_functionName(fnNumber)); buf[sizeof(buf)-1]=0;
+ utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() enter.\n", utrace_functionName(fnNumber));
+ buf[sizeof(buf)-1]=0;
fputs(buf, stdout);
traceFnNestingDepth++;
}
-static void U_CALLCONV TraceExit(const void *context, int32_t fnNumber, const char *fmt, va_list args) { char buf[500];
-
+static void U_CALLCONV TraceExit(const void *context, int32_t fnNumber, const char *fmt, va_list args) {
+ (void)context; // suppress compiler warnings about unused variable
+ char buf[500];
if (traceFnNestingDepth>0) {
traceFnNestingDepth--;
}
- utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() ", utrace_functionName(fnNumber)); buf[sizeof(buf)-1]=0;
+ utrace_format(buf, sizeof(buf), traceFnNestingDepth*3, "%s() ", utrace_functionName(fnNumber));
+ buf[sizeof(buf)-1]=0;
fputs(buf, stdout);
utrace_vformat(buf, sizeof(buf), traceFnNestingDepth*3, fmt, args);
buf[sizeof(buf)-1]=0;
static void U_CALLCONV TraceData(const void *context, int32_t fnNumber,
int32_t level, const char *fmt, va_list args) {
+ // suppress compiler warnings about unused variables
+ (void)context;
+ (void)fnNumber;
+ (void)level;
char buf[500];
utrace_vformat(buf, sizeof(buf), traceFnNestingDepth*3, fmt, args);
buf[sizeof(buf)-1]=0;
}
static void *U_CALLCONV ctest_libMalloc(const void *context, size_t size) {
+ (void)context; // suppress compiler warnings about unused variable
/*if (VERBOSITY) {
printf("Allocated %ld\n", (long)size);
}*/
return malloc(size);
}
static void *U_CALLCONV ctest_libRealloc(const void *context, void *mem, size_t size) {
+ (void)context; // suppress compiler warnings about unused variable
/*if (VERBOSITY) {
printf("Reallocated %ld\n", (long)size);
}*/
return realloc(mem, size);
}
static void U_CALLCONV ctest_libFree(const void *context, void *mem) {
+ (void)context; // suppress compiler warnings about unused variable
free(mem);
}
static void
addOfficialTaggedStandards(char *line, int32_t lineLen) {
+ (void) lineLen; // suppress compiler warnings about unused variable
char *atag;
char *endTagExp;
char *tag;
normalizationCorrectionsLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
+ (void)context; // suppress compiler warnings about unused variable
+ (void)fieldCount; // suppress compiler warnings about unused variable
uint32_t mapping[40];
char *end, *s;
uint32_t code;
strprepProfileLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
+ (void)fieldCount; // suppress compiler warnings about unused variable
uint32_t mapping[40];
char *end, *map;
uint32_t code;
extern void
-storeRange(uint32_t start, uint32_t end, UStringPrepType type,UErrorCode* status){
+storeRange(uint32_t start, uint32_t end, UStringPrepType type, UErrorCode* status){
+ (void)status; // suppress compiler warnings about unused variable
uint16_t trieWord = 0;
if((int)(_SPREP_TYPE_THRESHOLD + type) > 0xFFFF){
static UBool
CnvExtIsValid(NewConverter *cnvData,
const uint8_t *bytes, int32_t length) {
+ // suppress compiler warnings about unused variables
+ (void)cnvData;
+ (void)bytes;
+ (void)length;
return FALSE;
}
static uint32_t
CnvExtWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
UNewDataMemory *pData, int32_t tableType) {
+ (void) staticData; // suppress compiler warnings about unused variable
CnvExtData *extData=(CnvExtData *)cnvData;
int32_t length, top, headerSize;
if(tableType&TABLE_BASE) {
headerSize=0;
} else {
- _MBCSHeader header={ { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0 };
+ _MBCSHeader header={ { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
/* write the header and base table name for an extension-only table */
length=(int32_t)uprv_strlen(extData->ucm->baseName)+1;
/**
* End of file value
*/
-#define U_EOF 0xFFFFFFFF
+#define U_EOF ((int32_t)0xFFFFFFFF)
/**
* Error value if a sequence cannot be unescaped
*/
-#define U_ERR 0xFFFFFFFE
+#define U_ERR ((int32_t)0xFFFFFFFE)
typedef struct ULine ULine;