--- source/common/rbbidata.h +++ source/common/rbbidata.h @@ -113,7 +113,7 @@ /* StatusTable of the set of matching */ /* tags (rule status values) */ int16_t fReserved; - uint16_t fNextState[2]; /* Next State, indexed by char category. */ + uint16_t fNextState[1]; /* Next State, indexed by char category. */ /* This array does not have two elements */ /* Array Size is actually fData->fHeader->fCatCount */ /* CAUTION: see RBBITableBuilder::getTableSize() */ --- source/common/rbbitblb.cpp +++ source/common/rbbitblb.cpp @@ -1072,10 +1072,10 @@ numRows = fDStates->size(); numCols = fRB->fSetBuilder->getNumCharCategories(); - // Note The declaration of RBBIStateTableRow is for a table of two columns. - // Therefore we subtract two from numCols when determining + // Note The declaration of RBBIStateTableRow is for a table of one columns. + // Therefore we subtract one from numCols when determining // how much storage to add to a row for the total columns. - rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-2); + rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-1); size += numRows * rowSize; return size; } @@ -1105,7 +1105,7 @@ } table->fRowLen = sizeof(RBBIStateTableRow) + - sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 2); + sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 1); table->fNumStates = fDStates->size(); table->fFlags = 0; if (fRB->fLookAheadHardBreak) { --- source/common/ucmndata.h +++ source/common/ucmndata.h @@ -50,7 +50,7 @@ typedef struct { uint32_t count; - UDataOffsetTOCEntry entry[2]; /* Actual size of array is from count. */ + UDataOffsetTOCEntry entry[1]; /* Actual size of array is from count. */ } UDataOffsetTOC; /** --- source/common/ustring.cpp +++ source/common/ustring.cpp @@ -1486,7 +1486,7 @@ */ #define STRING_HASH(TYPE, STR, STRLEN, DEREF) \ - int32_t hash = 0; \ + uint32_t hash = 0; \ const TYPE *p = (const TYPE*) STR; \ if (p != NULL) { \ int32_t len = (int32_t)(STRLEN); \ @@ -1497,7 +1497,7 @@ p += inc; \ } \ } \ - return hash + return static_cast(hash) /* Used by UnicodeString to compute its hashcode - Not public API. */ U_CAPI int32_t U_EXPORT2