mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-45 clean up g++ compiler warnings
X-SVN-Rev: 9290
This commit is contained in:
parent
45556a1366
commit
7c556849f0
7 changed files with 15 additions and 27 deletions
|
@ -899,13 +899,13 @@ BreakIterator * RuleBasedBreakIterator::createBufferClone(void *stackBuffer,
|
|||
// Allocate heap memory if the user supplied memory is insufficient.
|
||||
//
|
||||
char *buf = (char *)stackBuffer;
|
||||
int32_t s = bufferSize;
|
||||
uint32_t s = bufferSize;
|
||||
|
||||
if (stackBuffer == NULL) {
|
||||
s = 0; // Ignore size, force allocation if user didn't give us a buffer.
|
||||
}
|
||||
if (U_ALIGNMENT_OFFSET(stackBuffer) != 0) {
|
||||
int32_t offsetUp = (int32_t)U_ALIGNMENT_OFFSET_UP(buf);
|
||||
uint32_t offsetUp = (uint32_t)U_ALIGNMENT_OFFSET_UP(buf);
|
||||
s -= offsetUp;
|
||||
buf += offsetUp;
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ const UnicodeString &RBBIDataWrapper::getRuleSourceString() {
|
|||
void RBBIDataWrapper::printData() {
|
||||
uint32_t c, s;
|
||||
|
||||
printf("RBBI Data at %x\n", fHeader);
|
||||
printf("RBBI Data at %p\n", fHeader);
|
||||
printf(" Version = %d\n", fHeader->fVersion);
|
||||
printf(" total length of data = %d\n", fHeader->fLength);
|
||||
printf(" number of character categories = %d\n\n", fHeader->fCatCount);
|
||||
|
@ -198,7 +198,7 @@ void RBBIDataWrapper::printData() {
|
|||
for (s=0; s<fForwardTable->fNumStates; s++) {
|
||||
RBBIStateTableRow *row = (RBBIStateTableRow *)
|
||||
(fForwardTable->fTableData + (fForwardTable->fRowLen * s));
|
||||
printf("%4d | %3d %3d ", s, row->fAccepting, row->fLookAhead, row->fTag);
|
||||
printf("%4d | %3d %3d %3d ", s, row->fAccepting, row->fLookAhead, row->fTag);
|
||||
for (c=0; c<fHeader->fCatCount; c++) {
|
||||
printf("%3d ", row->fNextState[c]);
|
||||
};
|
||||
|
|
|
@ -54,15 +54,16 @@ RBBINode::RBBINode(NodeType t) : UObject() {
|
|||
fNullable = FALSE;
|
||||
fLookAheadEnd = FALSE;
|
||||
fVal = 0;
|
||||
fPrecedence = precZero;
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
fFirstPosSet = new UVector(status); // TODO - get a real status from somewhere
|
||||
fLastPosSet = new UVector(status);
|
||||
fFollowPos = new UVector(status);
|
||||
if (t==opCat) {fPrecedence = precOpCat;}
|
||||
else if (t==opOr) {fPrecedence = precOpOr;}
|
||||
else if (t==opStart) {fPrecedence = precStart;}
|
||||
else if (t= opLParen) {fPrecedence = precLParen;}
|
||||
if (t==opCat) {fPrecedence = precOpCat;}
|
||||
else if (t==opOr) {fPrecedence = precOpOr;}
|
||||
else if (t==opStart) {fPrecedence = precStart;}
|
||||
else if (t==opLParen) {fPrecedence = precLParen;}
|
||||
|
||||
};
|
||||
|
||||
|
@ -290,7 +291,7 @@ static const char *nodeTypeNames[] = {
|
|||
};
|
||||
|
||||
void RBBINode::print() {
|
||||
printf("%10x %12s %10x %10x %10x %4d %6d %d ",
|
||||
printf("%10p %12s %10p %10p %10p %4d %6d %d ",
|
||||
this, nodeTypeNames[fType], fParent, fLeftChild, fRightChild,
|
||||
fSerialNum, fFirstPos, fVal);
|
||||
if (fType == varRef) {
|
||||
|
|
|
@ -198,7 +198,6 @@ RBBIRuleScanner::~RBBIRuleScanner() {
|
|||
UBool RBBIRuleScanner::doParseActions(EParseAction action,
|
||||
RBBIRuleScanner::RBBIRuleChar &c)
|
||||
{
|
||||
int i = 0;
|
||||
RBBINode *n = NULL;
|
||||
|
||||
UBool returnVal = TRUE;
|
||||
|
@ -1054,7 +1053,6 @@ RBBINode *RBBIRuleScanner::pushNewNode(RBBINode::NodeType t) {
|
|||
void RBBIRuleScanner::scanSet() {
|
||||
UnicodeSet *uset;
|
||||
ParsePosition pos;
|
||||
int errorPos = -1;
|
||||
int startPos;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -113,16 +113,6 @@ getFoldedRBBIValue(UNewTrie *trie, UChar32 start, int32_t offset) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* if bit 15 is set, then the folding offset is in bits 14..0 of the 16-bit trie result */
|
||||
static int32_t U_CALLCONV
|
||||
getFoldingRBBIOffset(uint32_t data) {
|
||||
if(data&0x8000) {
|
||||
return (int32_t)(data&0x7fff);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
U_CDECL_END
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ U_CDECL_END
|
|||
|
||||
|
||||
RBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules, UErrorCode &status)
|
||||
:fRuleScanner(rs), fRules(rules), ffffString(UChar(0xffff))
|
||||
:fRules(rules), fRuleScanner(rs), ffffString(UChar(0xffff))
|
||||
{
|
||||
fHashTable = NULL;
|
||||
fCachedSetLookup = NULL;
|
||||
|
@ -246,7 +246,7 @@ void RBBISymbolTable::print() const {
|
|||
RBBISymbolTableEntry *s = (RBBISymbolTableEntry *)e->value.pointer;
|
||||
|
||||
RBBINode::printUnicodeString(s->key, 15);
|
||||
printf(" %8x ", s->val);
|
||||
printf(" %8p ", s->val);
|
||||
RBBINode::printUnicodeString(s->val->fLeftChild->fText);
|
||||
printf("\n");
|
||||
}
|
||||
|
|
|
@ -276,7 +276,6 @@ void RBBITableBuilder::calcFollowPos(RBBINode *n) {
|
|||
uint32_t ix;
|
||||
|
||||
UVector *LastPosOfLeftChild = n->fLeftChild->fLastPosSet;
|
||||
UVector *FirstPosOfRightChild = n->fRightChild->fFirstPosSet;
|
||||
|
||||
for (ix=0; ix<(uint32_t)LastPosOfLeftChild->size(); ix++) {
|
||||
i = (RBBINode *)LastPosOfLeftChild->elementAt(ix);
|
||||
|
@ -364,7 +363,7 @@ void RBBITableBuilder::buildStateTable() {
|
|||
}
|
||||
|
||||
// if U is not empty and not in DStates then
|
||||
int32_t ux;
|
||||
int32_t ux = 0;
|
||||
UBool UinDstates = FALSE;
|
||||
if (U != NULL) {
|
||||
U_ASSERT(U->size() > 0);
|
||||
|
@ -540,7 +539,7 @@ UBool RBBITableBuilder::setEquals(UVector *a, UVector *b) {
|
|||
int32_t bx;
|
||||
int32_t firstBx = 0;
|
||||
void *aVal;
|
||||
void *bVal;
|
||||
void *bVal = NULL;
|
||||
|
||||
for (ax=0; ax<aSize; ax++) {
|
||||
aVal = a->elementAt(ax);
|
||||
|
@ -671,7 +670,7 @@ void RBBITableBuilder::printSet(UVector *s) {
|
|||
int32_t i;
|
||||
for (i=0; i<s->size(); i++) {
|
||||
void *v = s->elementAt(i);
|
||||
printf("%10x", v);
|
||||
printf("%10p", v);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue