ICU-5161 Remove debugging information for small platforms.

X-SVN-Rev: 19845
This commit is contained in:
George Rhoten 2006-07-14 00:47:15 +00:00
parent 95f8cc867f
commit e66b33496f
5 changed files with 35 additions and 32 deletions

View file

@ -35,6 +35,10 @@
#include "localsvc.h"
#endif
#ifdef RBBI_DEBUG
static UBool fTrace = FALSE;
#endif
U_NAMESPACE_BEGIN
@ -205,7 +209,6 @@ RuleBasedBreakIterator::operator=(const RuleBasedBreakIterator& that) {
if (that.fData != NULL) {
fData = that.fData->addReference();
}
fTrace = that.fTrace;
return *this;
}
@ -218,7 +221,6 @@ RuleBasedBreakIterator::operator=(const RuleBasedBreakIterator& that) {
// Initializes all fields, leaving the object in a consistent state.
//
//-----------------------------------------------------------------------------
UBool RuleBasedBreakIterator::fTrace = FALSE;
void RuleBasedBreakIterator::init() {
UErrorCode status = U_ZERO_ERROR;
fText = utext_openUChars(NULL, NULL, 0, &status);
@ -898,9 +900,11 @@ int32_t RuleBasedBreakIterator::handleNext(const RBBIStateTable *statetable) {
int32_t lookaheadResult = 0;
UBool lookAheadHardBreak = (statetable->fFlags & RBBI_LOOKAHEAD_HARD_BREAK) != 0;
if (fTrace) {
RBBIDebugPuts("Handle Next pos char state category");
}
#ifdef RBBI_DEBUG
if (fTrace) {
RBBIDebugPuts("Handle Next pos char state category");
}
#endif
// No matter what, handleNext alway correctly sets the break tag value.
fLastStatusIndexValid = TRUE;
@ -1106,9 +1110,11 @@ int32_t RuleBasedBreakIterator::handlePrevious(const RBBIStateTable *statetable)
int32_t lookaheadResult = 0;
UBool lookAheadHardBreak = (statetable->fFlags & RBBI_LOOKAHEAD_HARD_BREAK) != 0;
if (fTrace) {
RBBIDebugPuts("Handle Previous pos char state category");
}
#ifdef RBBI_DEBUG
if (fTrace) {
RBBIDebugPuts("Handle Previous pos char state category");
}
#endif
// handlePrevious() never gets the rule status.
// Flag the status as invalid; if the user ever asks for status, we will need

View file

@ -1,6 +1,6 @@
/*
***************************************************************************
* Copyright (C) 2002-2003 International Business Machines Corporation *
* Copyright (C) 2002-2006 International Business Machines Corporation *
* and others. All rights reserved. *
***************************************************************************
*/
@ -33,8 +33,9 @@
U_NAMESPACE_BEGIN
int RBBINode::gLastSerial = 0;
#ifdef RBBI_DEBUG
static int gLastSerial = 0;
#endif
//-------------------------------------------------------------------------
@ -43,7 +44,9 @@ int RBBINode::gLastSerial = 0;
//
//-------------------------------------------------------------------------
RBBINode::RBBINode(NodeType t) : UMemory() {
#ifdef RBBI_DEBUG
fSerialNum = ++gLastSerial;
#endif
fType = t;
fParent = NULL;
fLeftChild = NULL;
@ -69,7 +72,9 @@ RBBINode::RBBINode(NodeType t) : UMemory() {
RBBINode::RBBINode(const RBBINode &other) : UMemory(other) {
#ifdef RBBI_DEBUG
fSerialNum = ++gLastSerial;
#endif
fType = other.fType;
fParent = NULL;
fLeftChild = NULL;

View file

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 2001-2003, International Business Machines Corporation and
* Copyright (c) 2001-2006, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -96,20 +96,15 @@ class RBBINode : public UMemory {
#ifdef RBBI_DEBUG
void printNode();
void printTree(UBool withHeading);
#else
// Do-nothing inline functions for non-debug builds. Can't make empty defines for member
// functions - they won't compile at the call sites.
int fakeField;
#define printNode() fakeField=0;
#define printTree(withHeading) fakeField=0;
#endif
private:
RBBINode &operator = (const RBBINode &other); // No defs.
UBool operator == (const RBBINode &other); // Private, so these functions won't accidently be used.
#ifdef RBBI_DEBUG
int fSerialNum; // Debugging aids.
static int gLastSerial;
#endif
};
#ifdef RBBI_DEBUG

View file

@ -1,13 +1,13 @@
/*
**********************************************************************
* Copyright (c) 2002-2006, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*/
//
// rbbitblb.cpp
//
/*
**********************************************************************
* Copyright (c) 2002-2005, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*/
#include "unicode/utypes.h"
@ -75,10 +75,12 @@ void RBBITableBuilder::build() {
// parse tree for the substition expression.
//
fTree = fTree->flattenVariables();
#ifdef RBBI_DEBUG
if (fRB->fDebugEnv && uprv_strstr(fRB->fDebugEnv, "ftree")) {
RBBIDebugPuts("Parse tree after flattening variable references.");
fTree->printTree(TRUE);
}
#endif
//
// If the rules contained any references to {bof}
@ -113,10 +115,12 @@ void RBBITableBuilder::build() {
// expression.
//
fTree->flattenSets();
#ifdef RBBI_DEBUG
if (fRB->fDebugEnv && uprv_strstr(fRB->fDebugEnv, "stree")) {
RBBIDebugPuts("Parse tree after flattening Unicode Set references.");
fTree->printTree(TRUE);
}
#endif
//

View file

@ -165,13 +165,6 @@ protected:
*/
int32_t fBreakType;
/**
* Debugging flag. Trace operation of state machine when true.
* @internal
*/
static UBool fTrace;
protected:
//=======================================================================
// constructors