]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/rbbistbl.cpp
ICU-8.11.1.tar.gz
[apple/icu.git] / icuSources / common / rbbistbl.cpp
index 99e22123da64a2a56e3e5e7d07960ed4001a1369..771eb3136a439ccb61931ed8f8166a77e24304aa 100644 (file)
@@ -3,7 +3,7 @@
 //
 /*
 ***************************************************************************
-*   Copyright (C) 2002-2003 International Business Machines Corporation   *
+*   Copyright (C) 2002-2005 International Business Machines Corporation   *
 *   and others. All rights reserved.                                      *
 ***************************************************************************
 */
@@ -28,7 +28,7 @@
 //                                  when the hash table is deleted.
 //
 U_CDECL_BEGIN
-static void  U_EXPORT2 U_CALLCONV RBBISymbolTableEntry_deleter(void *p) {
+static void U_CALLCONV RBBISymbolTableEntry_deleter(void *p) {
     RBBISymbolTableEntry *px = (RBBISymbolTableEntry *)p;
     delete px;
 }
@@ -43,11 +43,12 @@ RBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules
 {
     fHashTable       = NULL;
     fCachedSetLookup = NULL;
+    
+    fHashTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, NULL, &status);
+    // uhash_open checks status
     if (U_FAILURE(status)) {
         return;
     }
-
-    fHashTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, &status);
     uhash_setValueDeleter(fHashTable, RBBISymbolTableEntry_deleter);
 }
 
@@ -223,7 +224,8 @@ RBBISymbolTableEntry::~RBBISymbolTableEntry() {
 //
 //  RBBISymbolTable::print    Debugging function, dump out the symbol table contents.
 //
-void RBBISymbolTable::print() const {
+#ifdef RBBI_DEBUG
+void RBBISymbolTable::rbbiSymtablePrint() const {
     RBBIDebugPrintf("Variable Definitions\n"
            "Name               Node Val     String Val\n"
            "----------------------------------------------------------------------\n");
@@ -237,9 +239,9 @@ void RBBISymbolTable::print() const {
         }
         RBBISymbolTableEntry  *s   = (RBBISymbolTableEntry *)e->value.pointer;
 
-        RBBINode::printUnicodeString(s->key, 15);
+        RBBI_DEBUG_printUnicodeString(s->key, 15);
         RBBIDebugPrintf("   %8p   ", (void *)s->val);
-        RBBINode::printUnicodeString(s->val->fLeftChild->fText);
+        RBBI_DEBUG_printUnicodeString(s->val->fLeftChild->fText);
         RBBIDebugPrintf("\n");
     }
 
@@ -251,12 +253,12 @@ void RBBISymbolTable::print() const {
             break;
         }
         RBBISymbolTableEntry  *s   = (RBBISymbolTableEntry *)e->value.pointer;
-        RBBINode::printUnicodeString(s->key);
-        s->val->fLeftChild->printTree();
+        RBBI_DEBUG_printUnicodeString(s->key);
+        s->val->fLeftChild->printTree(TRUE);
         RBBIDebugPrintf("\n");
     }
 }
-
+#endif