*/
#define STATIC_NEW(type) [] () { \
alignas(type) static char storage[sizeof(type)]; \
- return new(storage) type();} ();
+ return new(storage) type();} ()
/**
* Heap clean up function, called from u_cleanup()
* `actualLocale' of size ULOC_FULLNAME_CAPACITY
*/
#define U_LOCALE_BASED(varname, objname) \
- LocaleBased varname((objname).validLocale, (objname).actualLocale);
+ LocaleBased varname((objname).validLocale, (objname).actualLocale)
U_NAMESPACE_BEGIN
// or have a different iteration position.
// Note that fText's position is always the same as the break iterator's position.
return FALSE;
- };
+ }
if (!(fPosition == that2.fPosition &&
fRuleStatusIndex == that2.fRuleStatusIndex &&
// The initial handleNext() only advanced by a single code point. Go again.
position = fBI->handleNext(); // Safe rules identify safe pairs.
}
- };
+ }
positionStatusIdx = fBI->fRuleStatusIndex;
}
} while (position >= fromPosition);
/* constants and macros for access to the data ------------------------------ */
/* getting a uint32_t properties word from the data */
-#define GET_PROPS(c, result) ((result)=UTRIE2_GET16(&propsTrie, c));
+#define GET_PROPS(c, result) ((result)=UTRIE2_GET16(&propsTrie, c))
/* API functions ------------------------------------------------------------ */
}
if (leftString == NULL) {
return 1;
- };
+ }
if (rightString == NULL) {
return -1;
}
// consistent with forward iteration.
while(offsets.size() <= ceBuffer.length) {
offsets.addElement(limitOffset, errorCode);
- };
+ }
}
return ceBuffer.get(--ceBuffer.length);
} else {
offset = getOffset();
while(offsets.size() < ceBuffer.length) {
offsets.addElement(offset, errorCode);
- };
+ }
}
U_ASSERT(offsets.size() == ceBuffer.length);
// End offset corresponding to just after the unsafe-backwards segment.
// The ordering of the following statements is important.
if (fLeapMonthPatterns[kLeapMonthPatternFormatAbbrev].isEmpty()) {
fLeapMonthPatterns[kLeapMonthPatternFormatAbbrev].setTo(fLeapMonthPatterns[kLeapMonthPatternFormatWide]);
- };
+ }
if (fLeapMonthPatterns[kLeapMonthPatternFormatNarrow].isEmpty()) {
fLeapMonthPatterns[kLeapMonthPatternFormatNarrow].setTo(fLeapMonthPatterns[kLeapMonthPatternStandaloneNarrow]);
- };
+ }
if (fLeapMonthPatterns[kLeapMonthPatternStandaloneWide].isEmpty()) {
fLeapMonthPatterns[kLeapMonthPatternStandaloneWide].setTo(fLeapMonthPatterns[kLeapMonthPatternFormatWide]);
- };
+ }
if (fLeapMonthPatterns[kLeapMonthPatternStandaloneAbbrev].isEmpty()) {
fLeapMonthPatterns[kLeapMonthPatternStandaloneAbbrev].setTo(fLeapMonthPatterns[kLeapMonthPatternFormatAbbrev]);
- };
+ }
// end of hack
fLeapMonthPatternsCount = kMonthPatternsCount;
} else {
#define MAX_E_COUNT 5
#define MAX_M_COUNT 5
//#define MAX_INTERVAL_INDEX 4
-#define MAX_POSITIVE_INT 56632;
+#define MAX_POSITIVE_INT 56632
#endif /* #if !UCONFIG_NO_FORMATTING */
// Get total required capacity first (it's refreshed on each call).
int32_t totalCapacity = 0;
- for (int32_t partIndex = 0; (partIndex = nextTopLevelArgStart(partIndex)) >= 0; ++totalCapacity) {};
+ for (int32_t partIndex = 0; (partIndex = nextTopLevelArgStart(partIndex)) >= 0; ++totalCapacity) {}
MessageFormat* t = const_cast<MessageFormat*> (this);
cnt = 0;
UnicodeString output(affixPattern); // copy
if (affixPattern.length() == 0) {
return output;
- };
+ }
AffixTag tag;
while (hasNext(tag, affixPattern)) {
tag = nextToken(tag, affixPattern, status);
const UnicodeSet& ignorables, UErrorCode& status) {
if (affixPattern.length() == 0) {
return true;
- };
+ }
AffixTag tag;
while (hasNext(tag, affixPattern)) {
tag = nextToken(tag, affixPattern, status);
UErrorCode& status) {
if (affixPattern.length() == 0) {
return;
- };
+ }
AffixTag tag;
while (hasNext(tag, affixPattern)) {
tag = nextToken(tag, affixPattern, status);
// Useful constants
-#define DEFAULT_DIGITS UNICODE_STRING_SIMPLE("0123456789");
+#define DEFAULT_DIGITS UNICODE_STRING_SIMPLE("0123456789")
static const char gNumberingSystems[] = "numberingSystems";
static const char gNumberElements[] = "NumberElements";
static const char gDefault[] = "default";
// it assumes that the look-ahead match might be zero-length.
// TODO: Positive lookahead could recursively do the block, then continue
// with the longer of the block or the value coming in. Ticket 6060
- int32_t depth = (opType == URX_LA_START? 2: 1);;
+ int32_t depth = (opType == URX_LA_START? 2: 1);
for (;;) {
loc++;
op = (int32_t)fRXPat->fCompiledPat->elementAti(loc);
//
if (U_FAILURE(status)) {
return 0;
- };
+ }
if (destCapacity < 1) {
status = U_ILLEGAL_ARGUMENT_ERROR;
{
if (U_FAILURE(status)) {
return 0;
- };
+ }
RegexMatcher m(this);
int32_t r = 0;
{
if (U_FAILURE(status)) {
return 0;
- };
+ }
RegexMatcher m(this);
int32_t r = 0;
log_err_status(status, "Failure at file %s, line %d, error = %s\n", __FILE__, __LINE__, u_errorName(status));}}
#define TEST_ASSERT(expr) {if ((expr)==FALSE) { \
-log_err("Test Failure at file %s, line %d: \"%s\" is false.\n", __FILE__, __LINE__, #expr);};}
+log_err("Test Failure at file %s, line %d: \"%s\" is false.\n", __FILE__, __LINE__, #expr);}}
#define TEST_ASSERT_EQ(a, b) { if ((a) != (b)) { \
log_err("Test Failure at file %s, line %d: \"%s\" (%d) != \"%s\" (%d) \n", \
#define TEST_CHECK_STATUS {if (U_FAILURE(status)) {dataerrln("%s:%d: Test failure. status=%s", \
__FILE__, __LINE__, u_errorName(status)); return;}}
-#define TEST_ASSERT(expr) {if ((expr)==FALSE) {errln("%s:%d: Test failure \n", __FILE__, __LINE__);};}
+#define TEST_ASSERT(expr) {if ((expr)==FALSE) {errln("%s:%d: Test failure \n", __FILE__, __LINE__);}}
//
// APITest. Invoke every function at least once, and check that it does something.
errln("%s:%d: Test failure, locale %s. status=%s", __FILE__, __LINE__, testlocale, u_errorName(status)); \
} return;}}
-#define TEST_ASSERT(expr) {if ((expr)==FALSE) {errln("%s:%d: Test failure \n", __FILE__, __LINE__);};}
+#define TEST_ASSERT(expr) {if ((expr)==FALSE) {errln("%s:%d: Test failure \n", __FILE__, __LINE__);}}
// *****************************************************************************
// class CalendarTest
if(gLocaleCount < 0) {
int32_t i;
for(i=0;testLocaleID(i) != NULL;i++) {
- ;
+ // do nothing
}
gLocaleCount = i;
}
{dataerrln("DecimalFormatTest failure at line %d. status=%s", \
__LINE__, u_errorName(status)); return 0;}}
-#define DF_ASSERT(expr) {if ((expr)==FALSE) {errln("DecimalFormatTest failure at line %d.\n", __LINE__);};}
+#define DF_ASSERT(expr) {if ((expr)==FALSE) {errln("DecimalFormatTest failure at line %d.\n", __LINE__);}}
#define DF_ASSERT_FAIL(expr, errcode) {UErrorCode status=U_ZERO_ERROR; (expr);\
if (status!=errcode) {dataerrln("DecimalFormatTest failure at line %d. Expected status=%s, got %s", \
- __LINE__, u_errorName(errcode), u_errorName(status));};}
+ __LINE__, u_errorName(errcode), u_errorName(status));}}
#define DF_CHECK_STATUS_L(line) {if (U_FAILURE(status)) {errln( \
"DecimalFormatTest failure at line %d, from %d. status=%d\n",__LINE__, (line), status); }}
errln("ICU Error \"%s\"\n", u_errorName(status));
delete retPtr;
retPtr = NULL;
- };
+ }
return retPtr;
}
if (U_FAILURE(status)) {
errln("Error getting time to format");
return;
- };
+ }
sdf->adoptCalendar(cal);
UnicodeString result;
UnicodeString correct("-0330", "");
FieldPosition pos(FieldPosition::DONT_CARE);
fmt->format(test_date,result, pos);
- UnicodeString expected = ((UnicodeString)DATA[i][1]).unescape();;
+ UnicodeString expected = ((UnicodeString)DATA[i][1]).unescape();
if (result != expected)
errln("FAIL: Expected " + expected + " get: " + result);
curOffset += 1 + t; // BACKSLAH and NewlineMark
continue;
}
- };
+ }
buf.append(c);
curOffset++;
}
errcheckln(status, "Failure at file %s, line %d, error = %s", __FILE__, __LINE__, u_errorName(status));}}
#define TEST_ASSERT(expr) {if ((expr)==FALSE) { \
- errln("Test Failure at file %s, line %d: \"%s\" is false.", __FILE__, __LINE__, #expr);};}
+ errln("Test Failure at file %s, line %d: \"%s\" is false.", __FILE__, __LINE__, #expr);}}
#define TEST_ASSERT_MSG(expr, msg) {if ((expr)==FALSE) { \
- dataerrln("Test Failure at file %s, line %d, %s: \"%s\" is false.", __FILE__, __LINE__, msg, #expr);};}
+ dataerrln("Test Failure at file %s, line %d, %s: \"%s\" is false.", __FILE__, __LINE__, msg, #expr);}}
#define TEST_ASSERT_EQ(a, b) { if ((a) != (b)) { \
errln("Test Failure at file %s, line %d: \"%s\" (%d) != \"%s\" (%d)", \
errln("setExtension('u', \"%s\") got Error: %s\n",
extension, u_errorName(status));
}
- };
+ }
}
void LocaleBuilderTest::TestSetExtensionValidateUIllFormed() {
errln("setExtension('t', \"%s\") got Error: %s\n",
extension, u_errorName(status));
}
- };
+ }
}
void LocaleBuilderTest::TestSetExtensionValidateTIllFormed() {
errln("setExtension('x', \"%s\") got Error: %s\n",
extension, u_errorName(status));
}
- };
+ }
}
void LocaleBuilderTest::TestSetExtensionValidatePUIllFormed() {
errln("setExtension('%c', \"%s\") got Error: %s\n",
ch, extension, u_errorName(status));
}
- };
+ }
const char* someChars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()-_=+;:,.<>?";
}
TESTCASE_AUTO_BEGIN;
TESTCASE_AUTO(testDecimalQuantityBehaviorStandalone);
- TESTCASE_AUTO(testSwitchStorage);;
+ TESTCASE_AUTO(testSwitchStorage);
TESTCASE_AUTO(testCopyMove);
TESTCASE_AUTO(testAppend);
if (!quick) {
int64_t num = 4;
if (stub.format(num, agent, pos) != UnicodeString("agent3")){
errln("NumberFormat::format(int64, UnicodString&, FieldPosition&) should delegate to (int32, ,)");
- };
+ }
}
void NumberFormatTest::TestLocalizedPatternSymbolCoverage() {
if (failure(status, "NumberFormat::createInstance", Locale::getCanadaFrench(), TRUE)){
delete formatter;
return;
- };
+ }
tempString = formatter->format (-5789.9876, tempString);
if (tempString == expectedDefault) {
if (failure(status, "NumberFormat::createNumberInstance", TRUE)){
delete formatter;
return;
- };
+ }
tempString = formatter->format (-5789.9876, tempString);
if (tempString == expectedDefault) {
if (failure(status, "NumberFormat::createInstance", TRUE)){
delete nff;
return;
- };
+ }
DecimalFormat *nf = dynamic_cast<DecimalFormat *>(nff);
if(nf == NULL) {
errln("DecimalFormat needed to continue");
if (failure(status, "NumberFormat::createInstance", TRUE)){
delete fmt;
return;
- };
+ }
double a = DBL_MAX * 0.99; // DBL_MAX itself overflows to +Inf
UnicodeString s;
if (failure(status, "createInstance", Locale::getUS(), TRUE)){
delete fmt;
return;
- };
+ }
int32_t DATA[] = { INT32_MIN, INT32_MAX, -100000000, 100000000 };
int DATA_length = UPRV_LENGTHOF(DATA);
for (int i=0; i<DATA_length; ++i) {
if (failure(status, "createInstance", Locale::getUS(), TRUE)){
delete fmt;
return;
- };
+ }
fmt->setMaximumFractionDigits(2);
for (int i=0; i<D_length; i++) {
UnicodeString s;
if (failure(status, "createInstance", Locale::getUS(), TRUE)){
delete nf;
return;
- };
+ }
nf->setMinimumFractionDigits(1);
nf->setMaximumFractionDigits(1);
double a = -0.09;
if (failure(status, "NumberFormat::createInstance", TRUE)){
delete nf;
return;
- };
+ }
DecimalFormat *df = dynamic_cast<DecimalFormat *>(nf);
if(df == NULL) {
errln("DecimalFormat needed to continue");
errln("FAIL: with different neg prefix , parse error %s\n", u_errorName(status));
status = U_ZERO_ERROR;
} else {
-;
if(n!=-123456789) {
errln("FAIL: with different neg prefix , unum_parse status %s, result %d expected -123456789\n", u_errorName(status), n);
} else {
if (failure(status, "NumberFormat::createInstance", TRUE)){
delete nf;
return;
- };
+ }
DecimalFormat *fmt = dynamic_cast<DecimalFormat *>(nf);
if(fmt == NULL) {
dataerrln("Failure at file %s, line %d, error = %s", __FILE__, __LINE__, u_errorName(status));}}
#define TEST_ASSERT(expr) {if ((expr) == FALSE) { \
- errln("Test Failure at file %s, line %d: \"%s\" is false.\n", __FILE__, __LINE__, #expr);};}
+ errln("Test Failure at file %s, line %d: \"%s\" is false.\n", __FILE__, __LINE__, #expr);}}
void RBBIAPITest::TestCloneEquals()
{
__FILE__, __LINE__, u_errorName(status), parseError.line, parseError.offset);
errln(UnicodeString(builtSource));
return;
- };
+ }
rbbiRules = brkItr->getBinaryRules(length);
logln("Comparing \"%s\" len=%d", dataFile, length);
if (memcmp(builtRules, rbbiRules, (int32_t)length) != 0) {
delete []retPtr;
retPtr = 0;
ulen = 0;
- };
+ }
return retPtr;
}
c3 = fText->char32At(p3);
if (fCRSet->contains(c2) || fLFSet->contains(c2) || fNewlineSet->contains(c2)) {
break;
- };
+ }
}
while (fFormatSet->contains(c3) || fExtendSet->contains(c3) || fZWJSet->contains(c3));
//
if (fCRSet->contains(c1) || fLFSet->contains(c1) || fNewlineSet->contains(c1)) {
break;
- };
+ }
if (fCRSet->contains(c2) || fLFSet->contains(c2) || fNewlineSet->contains(c2)) {
break;
- };
+ }
// Rule (3c) ZWJ x Extended_Pictographic
// Not ignoring extend chars, so peek into input text to
#define REGEX_CHECK_STATUS {if (U_FAILURE(status)) {dataerrln("%s:%d: RegexTest failure. status=%s", \
__FILE__, __LINE__, u_errorName(status)); return;}}
-#define REGEX_ASSERT(expr) {if ((expr)==FALSE) {errln("%s:%d: RegexTest failure: REGEX_ASSERT(%s) failed \n", __FILE__, __LINE__, #expr);};}
+#define REGEX_ASSERT(expr) {if ((expr)==FALSE) {errln("%s:%d: RegexTest failure: REGEX_ASSERT(%s) failed \n", __FILE__, __LINE__, #expr);}}
#define REGEX_ASSERT_FAIL(expr, errcode) {UErrorCode status=U_ZERO_ERROR; (expr);\
if (status!=errcode) {dataerrln("RegexTest failure at line %d. Expected status=%s, got %s", \
- __LINE__, u_errorName(errcode), u_errorName(status));};}
+ __LINE__, u_errorName(errcode), u_errorName(status));}}
#define REGEX_CHECK_STATUS_L(line) {if (U_FAILURE(status)) {errln( \
"RegexTest failure at line %d, from %d. status=%d\n",__LINE__, (line), status); }}
#define REGEX_ASSERT_UNISTR(expected, actual) { \
if (UnicodeString(expected, -1, US_INV) != (actual)) { \
errln("%s:%d: RegexTest failure: REGEX_ASSERT_UNISTR(%s, %s) failed \n", \
- __FILE__, __LINE__, expected, extractToAssertBuf(actual));};}
+ __FILE__, __LINE__, expected, extractToAssertBuf(actual));}}
static UBool testUTextEqual(UText *uta, UText *utb) {
// REGEX_ERR("pattern", expected error line, column, expected status);
//
//---------------------------------------------------------------------------
-#define REGEX_ERR(pat, line, col, status) regex_err(pat, line, col, status, __LINE__);
+#define REGEX_ERR(pat, line, col, status) regex_err(pat, line, col, status, __LINE__)
void RegexTest::regex_err(const char *pat, int32_t errLine, int32_t errCol,
UErrorCode expectedStatus, int32_t line) {
delete []retPtr;
retPtr = 0;
ulen = 0;
- };
+ }
return retPtr;
}
const UnicodeString *locale = testCase->getAttribute("locale");
if (locale == NULL || locale->length()==0) {
locale = &defLocale;
- };
+ }
locale->extract(0, locale->length(), clocale, sizeof(clocale), NULL);
SimpleFontInstance *font = new SimpleFontInstance(12, status);
LayoutEngine *engine = LayoutEngine::layoutEngineFactory(font, arabScriptCode, -1, status);
le_int32 glyphCount;
- LEGlyphID glyphs[6], extraBitGlyphs[6];;
+ LEGlyphID glyphs[6], extraBitGlyphs[6];
le_int32 biasedIndices[6], indices[6], glyph;
float positions[6 * 2 + 2];
LEUnicode chars[] = {
if (status != U_BUFFER_OVERFLOW_ERROR) {
fprintf(stderr, "ucnv_toUChars: ICU Error \"%s\"\n", u_errorName(status));
exit(status);
- };
+ }
status = U_ZERO_ERROR;
UChar *ruleSourceU = new UChar[destCap+1];
if (U_FAILURE(status)) {
fprintf(stderr, "ucnv_toUChars: ICU Error \"%s\"\n", u_errorName(status));
exit(status);
- };
+ }
ucnv_close(conv);
fprintf(stderr, "createRuleBasedBreakIterator: ICU Error \"%s\" at line %d, column %d\n",
u_errorName(status), (int)parseError.line, (int)parseError.offset);
exit(status);
- };
+ }
//
fprintf(stderr, "gencfu: uspoof_openFromSource error \"%s\" at file %s, line %d, column %d\n",
u_errorName(status), confFileName, (int)parseError.line, (int)parseError.offset);
exit(status);
- };
+ }
//
if (!(enc = ucnv_getStandardName(encoding, "MIME", &err))) {
err = U_ZERO_ERROR;
if (!(enc = ucnv_getStandardName(encoding, "IANA", &err))) {
- ;
+ // do nothing
}
}
if (U_FAILURE(status)) {
fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, u_errorName(status));
return FALSE;
- };
+ }
if ((subDirp = opendir(newpath.data())) != NULL) {
/* If this new path is a directory, make a recursive call with the newpath. */
// reached end of file, convert once more to flush the converter
flush=TRUE;
}
- };
+ }
exit:
ucnv_close(cnv);