ICU-2111 Fix for IRIX

X-SVN-Rev: 9738
This commit is contained in:
George Rhoten 2002-08-19 16:05:39 +00:00
parent e6be932df6
commit 87438a3f34
2 changed files with 26 additions and 38 deletions

View File

@ -37,13 +37,6 @@ U_NAMESPACE_BEGIN
const char RBBIRuleScanner::fgClassID=0;
//
// Forward Declarations
//
U_CDECL_BEGIN
static void U_EXPORT2 U_CALLCONV RBBISetTable_deleter(void *p);
U_CDECL_END
//----------------------------------------------------------------------------------------
//
// Unicode Set init strings for each of the character classes needed for parsing a rule file.
@ -77,6 +70,17 @@ static const UChar gRuleSet_name_start_char_pattern[] = {
static const UChar kAny[] = {0x61, 0x6e, 0x79, 0x00}; // "any"
U_CDECL_BEGIN
static void U_EXPORT2 U_CALLCONV RBBISetTable_deleter(void *p) {
RBBISetTableEl *px = (RBBISetTableEl *)p;
delete px->key;
// Note: px->val is owned by the linked list "fSetsListHead" in scanner.
// Don't delete the value nodes here.
uprv_free(px);
};
U_CDECL_END
//----------------------------------------------------------------------------------------
//
// Constructor.
@ -607,16 +611,6 @@ void RBBIRuleScanner::fixOpStack(RBBINode::OpPrecedence p) {
// If the string is "any", return a set containing all chars.
//
//----------------------------------------------------------------------------------------
U_CDECL_BEGIN
static void U_EXPORT2 U_CALLCONV RBBISetTable_deleter(void *p) {
RBBISetTableEl *px = (RBBISetTableEl *)p;
delete px->key;
// Note: px->val is owned by the linked list "fSetsListHead" in scanner.
// Don't delete the value nodes here.
uprv_free(px);
};
U_CDECL_END
void RBBIRuleScanner::findSetFor(const UnicodeString &s, RBBINode *node, UnicodeSet *setToAdopt) {
RBBISetTableEl *el;

View File

@ -19,18 +19,23 @@
#include "rbbinode.h"
//
// RBBISymbolTableEntry_deleter Used by the UHashTable to delete the contents
// when the hash table is deleted.
//
U_CDECL_BEGIN
static void U_EXPORT2 U_CALLCONV RBBISymbolTableEntry_deleter(void *p) {
RBBISymbolTableEntry *px = (RBBISymbolTableEntry *)p;
delete px;
};
U_CDECL_END
U_NAMESPACE_BEGIN
const char RBBISymbolTable::fgClassID=0;
//
// Forward Declarations
//
U_CDECL_BEGIN
static void U_EXPORT2 U_CALLCONV RBBISymbolTableEntry_deleter(void *p);
U_CDECL_END
RBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules, UErrorCode &status)
@ -42,8 +47,8 @@ RBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules
return;
}
fHashTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, &status);
uhash_setValueDeleter(fHashTable, RBBISymbolTableEntry_deleter);
fHashTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, &status);
uhash_setValueDeleter(fHashTable, RBBISymbolTableEntry_deleter);
};
@ -199,17 +204,6 @@ void RBBISymbolTable::addEntry (const UnicodeString &key, RBBINode *
};
//
// RBBISymbolTableEntry_deleter Used by the UHashTable to delete the contents
// when the hash table is deleted.
//
U_CDECL_BEGIN
static void U_EXPORT2 U_CALLCONV RBBISymbolTableEntry_deleter(void *p) {
RBBISymbolTableEntry *px = (RBBISymbolTableEntry *)p;
delete px;
};
U_CDECL_END
const char RBBISymbolTableEntry::fgClassID=0;
RBBISymbolTableEntry::~RBBISymbolTableEntry() {