From 1d9f6a4c0622eef0b7f8aaa5216d87510e027707 Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Wed, 29 Mar 2000 19:41:57 +0000 Subject: [PATCH] ICU-149 make ResourceBundle use new UHashtable API X-SVN-Rev: 1019 --- icu4c/source/common/rbread.cpp | 11 ++++++----- icu4c/source/common/resbund.cpp | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/icu4c/source/common/rbread.cpp b/icu4c/source/common/rbread.cpp index 8eddf5f3a93..9a32a27519f 100644 --- a/icu4c/source/common/rbread.cpp +++ b/icu4c/source/common/rbread.cpp @@ -262,12 +262,13 @@ rb_parse(FileStream *f, if(U_FAILURE(status)) return 0; /* Open the hashtable for saving data */ - retval = uhash_open((UHashFunction)uhash_OLD_hashUString, - uhash_OLD_pointerComparator, &status); + retval = uhash_open(uhash_hashUnicodeString, + uhash_compareUnicodeString, &status); if(retval == 0 || U_FAILURE(status)) { status = U_MEMORY_ALLOCATION_ERROR; return 0; } + uhash_setKeyDeleter(retval, uhash_deleteUnicodeString); uhash_setValueDeleter(retval, RBHashtable_valueDeleter); /* Read the byte order mark from the file */ @@ -307,7 +308,7 @@ rb_parse(FileStream *f, uhash_close(retval); return 0; } - uhash_OLD_putKey(retval, listname.hashCode() & 0x7FFFFFFF, + uhash_put(retval, new UnicodeString(listname), strlist, &status); if(U_FAILURE(status)) { uhash_close(retval); @@ -317,7 +318,7 @@ rb_parse(FileStream *f, case sSTRINGLIST2D: strlist2d = read_strlist2d(f, listname, status); - uhash_OLD_putKey(retval, listname.hashCode() & 0x7FFFFFFF, + uhash_put(retval, new UnicodeString(listname), strlist2d, &status); if(U_FAILURE(status)) { uhash_close(retval); @@ -327,7 +328,7 @@ rb_parse(FileStream *f, case sTAGGEDLIST: taglist = read_taglist(f, listname, status); - uhash_OLD_putKey(retval, listname.hashCode() & 0x7FFFFFFF, + uhash_put(retval, new UnicodeString(listname), taglist, &status); if(U_FAILURE(status)) { uhash_close(retval); diff --git a/icu4c/source/common/resbund.cpp b/icu4c/source/common/resbund.cpp index 3e75e449cc7..533c43d488e 100644 --- a/icu4c/source/common/resbund.cpp +++ b/icu4c/source/common/resbund.cpp @@ -599,8 +599,7 @@ ResourceBundle::getDataForTag(const char *tag, if(fData[i] != 0) { const ResourceBundleData* s = - (const ResourceBundleData*)uhash_OLD_get(fData[i], - UnicodeString(tag, "").hashCode() & 0x7FFFFFFF); + (const ResourceBundleData*)uhash_get(fData[i], &UnicodeString(tag, "")); if(s != 0) { err = fDataStatus[i]; /* restore the error from the original lookup. */ return s; @@ -952,7 +951,7 @@ ResourceBundle::listInstalledLocales(const UnicodeString& path, if(h != 0) { UnicodeString ukIndexTag = UnicodeString(kIndexTag,""); ResourceBundleData *data = - (ResourceBundleData*) uhash_OLD_get(h, ukIndexTag.hashCode() & 0x7FFFFFFF); + (ResourceBundleData*) uhash_get(h, &ukIndexTag); if(data != 0 && data->getDynamicClassID() == StringList::getStaticClassID()) { numInstalledLocales = ((StringList*)data)->fCount;