/* determine the paragraph level at position index */
U_CFUNC UBiDiLevel
-ubidi_getParaLevelAtIndex(const UBiDi *pBiDi, int32_t index) {
+ubidi_getParaLevelAtIndex(const UBiDi *pBiDi, int32_t pindex) {
int32_t i;
for(i=0; i<pBiDi->paraCount; i++)
- if(index<pBiDi->paras[i].limit)
+ if(pindex<pBiDi->paras[i].limit)
break;
if(i>=pBiDi->paraCount)
i=pBiDi->paraCount-1;
# for build.
if test "${CC}" == "clang"; then
- CLANGCFLAGS="-Qunused-arguments"
+ CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality"
else
CLANGCFLAGS=""
fi
if test "${CXX}" == "clang++"; then
- CLANGCXXFLAGS="-Qunused-arguments"
+ CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality"
else
CLANGCXXFLAGS=""
fi
# for build.
if test "${CC}" == "clang"; then
- CLANGCFLAGS="-Qunused-arguments"
+ CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality"
else
CLANGCFLAGS=""
fi
if test "${CXX}" == "clang++"; then
- CLANGCXXFLAGS="-Qunused-arguments"
+ CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality"
else
CLANGCXXFLAGS=""
fi
U_NAMESPACE_BEGIN
NGramParser::NGramParser(const int32_t *theNgramList, const uint8_t *theCharMap)
- :byteIndex(0), ngram(0)
+ : ngram(0), byteIndex(0)
{
ngramList = theNgramList;
charMap = theCharMap;
//----------------------------------------------------------------------
UBool
-DateFormat::getBooleanAttribute(UDateFormatBooleanAttribute attr, UErrorCode &status) const {
+DateFormat::getBooleanAttribute(UDateFormatBooleanAttribute attr, UErrorCode &/*status*/) const {
return fBoolFlags.get(attr);
}
#include "astro.h" // CalendarAstronomer
#include "uhash.h"
#include "ucln_in.h"
+#include "uassert.h"
static const UDate HIJRA_MILLIS = -42521587200000.0; // 7/16/622 AD 00:00
return "islamic";
} else if(civil==TBLA){
return "islamic-tbla";
+ } else if(civil==UMALQURA){
+ return "islamic-umalqura";
} else {
- return "islamic-umalqura";
- }
+ U_ASSERT(false); // out of range
+ return "islamic-unknown";
+ }
}
Calendar* IslamicCalendar::clone() const {
year = months / 12 + 1;
month = months % 12;
- } else if(civil == UMALQURA){
+ } else if(civil == UMALQURA) {
int32_t umalquraStartdays = yearStart(UMALQURA_YEAR_START) ;
if( days < umalquraStartdays){
//Use Civil calculation
year = y;
month = m;
}
- }
+ } else { // invalid 'civil'
+ U_ASSERT(false); // should not get here, out of range
+ year=month=0;
+ }
dayOfMonth = (days - monthStart(year, month)) + 1;
enum ECivil {
ASTRONOMICAL,
CIVIL,
- UMALQURA,
+ UMALQURA,
TBLA
};
static const int32_t ASTRONOMICAL_EPOC = 1948439;
- static const int getUmalqura_MonthLength(int i, int j){
+ static int getUmalqura_MonthLength(int i, int j){
static const int UMALQURA_MONTHLENGTH[] = {
//* 1318 -1322 */ "0101 0111 0100", "1001 0111 0110", "0100 1011 0111", "0010 0101 0111", "0101 0010 1011",
const Formattable* number(void) const;
const UChar *iso(void) const;
- const UBool wasCurrency(void) const;
+ UBool wasCurrency(void) const;
};
inline const Formattable*
return num;
}
-inline const UBool
+inline UBool
ArgExtractor::wasCurrency(void) const {
return fWasCurrency;
}
return save;
}
-ArgExtractor::ArgExtractor(const NumberFormat& nf, const Formattable& obj, UErrorCode& /*status*/)
+ArgExtractor::ArgExtractor(const NumberFormat& /*nf*/, const Formattable& obj, UErrorCode& /*status*/)
: num(&obj), fWasCurrency(FALSE) {
const UObject* o = obj.getObject(); // most commonly o==NULL
char winidKey[MAX_WINDOWS_ID_SIZE];
int32_t winKeyLen = winid.extract(0, winid.length(), winidKey, sizeof(winidKey) - 1, US_INV);
- if (winKeyLen == 0 || winKeyLen >= sizeof(winidKey)) {
+ if (winKeyLen == 0 || winKeyLen >= (int32_t)sizeof(winidKey)) {
ures_close(zones);
return id;
}
int32_t len = 0;
UBool gotID = FALSE;
if (region) {
- int32_t tzidsLen = 0;
const UChar *tzids = ures_getStringByKey(zones, region, &len, &tmperr); // use tmperr, because
// regional mapping is optional
if (U_SUCCESS(tmperr)) {
case UTZFMT_STYLE_ISO_EXTENDED_LOCAL_FULL:
formatOffsetISO8601Extended(offset, FALSE, FALSE, FALSE, name, status);
break;
+
+ default:
+ // UTZFMT_STYLE_ZONE_ID, UTZFMT_STYLE_ZONE_ID_SHORT, UTZFMT_STYLE_EXEMPLAR_LOCATION
+ break;
}
if (timeType) {
/**
* Range check for overflow
*/
-#define LE_RANGE_CHECK(type, count, ptrfn) (( (LE_UINTPTR_MAX / sizeof(type)) < count ) ? NULL : (ptrfn))
+#define LE_RANGE_CHECK(type, count, ptrfn) (( (LE_UINTPTR_MAX / sizeof(type)) < (size_t)count ) ? NULL : (ptrfn))
/**
* A convenience macro to get the length of an array.
*
LE_DEBUG_BAD_FONT("off end of ligature substitution header");
return newState; // get out! bad font
}
- if(componentGlyph > glyphStorage.getGlyphCount()) {
+ if(componentGlyph > (le_uint32)glyphStorage.getGlyphCount()) {
LE_DEBUG_BAD_FONT("preposterous componentGlyph");
currGlyph++;
return newState; // get out! bad font
UResourceBundle* theBundle = NULL;
const char* testdatapath;
UErrorCode status = U_ZERO_ERROR;
- UResourceBundle* res = NULL;
int32_t unused_len = 0;
testdatapath=loadTestData(&status);
tstCal->roll(UCAL_DAY_OF_MONTH, (UBool)TRUE, status);
TEST_CHECK_STATUS;
}
-
+
if(day != (initDay + loopCnt - 1) || month != IslamicCalendar::RABI_2 || year != 1434)
- errln("invalid values for RABI_2 date after roll of " + loopCnt);
-
-
+ errln("invalid values for RABI_2 date after roll of %d", loopCnt);
+
status = U_ZERO_ERROR;
tstCal->clear();
initMonth = 2;
LocalUEnumerationPointer eActive(ucsdet_getDetectableCharsets(csd.getAlias(), status));
const char *activeName = NULL;
- while (activeName = uenum_next(eActive.getAlias(), NULL, status)) {
+ while ((activeName = uenum_next(eActive.getAlias(), NULL, status))) {
// the charset must be included in all list
UBool found = FALSE;
const char *name = NULL;
uenum_reset(e.getAlias(), status);
- while (name = uenum_next(e.getAlias(), NULL, status)) {
+ while ((name = uenum_next(e.getAlias(), NULL, status))) {
if (strcmp(activeName, name) == 0) {
found = TRUE;
break;
SimpleDateFormat * sdmft = new SimpleDateFormat(itemPtr->pattern, locale, status);
sdmft->setLenient(itemPtr->leniency);
sdmft->setBooleanAttribute(UDAT_PARSE_ALLOW_WHITESPACE, itemPtr->leniency, status).setBooleanAttribute(UDAT_PARSE_ALLOW_NUMERIC, itemPtr->leniency, status);
- UDate d = sdmft->parse(itemPtr->parseString, pos);
-
+ /*UDate d = */sdmft->parse(itemPtr->parseString, pos);
+
delete sdmft;
if(pos.getErrorIndex() > -1)
if(itemPtr->expectedResult.length() != 0) {
- errln("error: unexpected error - " + itemPtr->parseString + " - error index " + pos.getErrorIndex() + " - leniency " + itemPtr->leniency);
- continue;
- } else
- continue;
+ errln("error: unexpected error - " + itemPtr->parseString + " - error index " + pos.getErrorIndex() + " - leniency " + itemPtr->leniency);
+ continue;
+ } else {
+ continue;
+ }
}
}
delete cal;
gFormat->format(gBBDThing, gBBDStr, NULL, status);
}
-void ThreadSafeFormat::fini(UErrorCode &status) {
+void ThreadSafeFormat::fini(UErrorCode &/*status*/) {
gFormat.adoptInstead(NULL);
}