diff --git a/icu4c/source/common/hash.h b/icu4c/source/common/hash.h index 709ae9a905e..36cc46bf992 100644 --- a/icu4c/source/common/hash.h +++ b/icu4c/source/common/hash.h @@ -48,7 +48,7 @@ public: */ ~Hashtable(); - UObjectDeleter setValueDeleter(UObjectDeleter fn); + UObjectDeleter *setValueDeleter(UObjectDeleter *fn); int32_t count() const; @@ -131,7 +131,7 @@ inline Hashtable::~Hashtable() { } } -inline UObjectDeleter Hashtable::setValueDeleter(UObjectDeleter fn) { +inline UObjectDeleter *Hashtable::setValueDeleter(UObjectDeleter *fn) { return uhash_setValueDeleter(hash, fn); } diff --git a/icu4c/source/common/uhash.c b/icu4c/source/common/uhash.c index ebb4be60a6f..0293089baff 100644 --- a/icu4c/source/common/uhash.c +++ b/icu4c/source/common/uhash.c @@ -155,7 +155,7 @@ static const float RESIZE_POLICY_RATIO_TABLE[6] = { * PRIVATE Prototypes ********************************************************************/ -static UHashtable* _uhash_create(UHashFunction keyHash, UKeyComparator keyComp, +static UHashtable* _uhash_create(UHashFunction *keyHash, UKeyComparator *keyComp, int32_t primeIndex, UErrorCode *status); static void _uhash_allocate(UHashtable *hash, int32_t primeIndex, @@ -189,14 +189,14 @@ static void _uhash_internalSetResizePolicy(UHashtable *hash, enum UHashResizePol ********************************************************************/ U_CAPI UHashtable* U_EXPORT2 -uhash_open(UHashFunction keyHash, UKeyComparator keyComp, +uhash_open(UHashFunction *keyHash, UKeyComparator *keyComp, UErrorCode *status) { return _uhash_create(keyHash, keyComp, 3, status); } U_CAPI UHashtable* U_EXPORT2 -uhash_openSize(UHashFunction keyHash, UKeyComparator keyComp, +uhash_openSize(UHashFunction *keyHash, UKeyComparator *keyComp, int32_t size, UErrorCode *status) { @@ -226,30 +226,30 @@ uhash_close(UHashtable *hash) { uprv_free(hash); } -U_CAPI UHashFunction U_EXPORT2 -uhash_setKeyHasher(UHashtable *hash, UHashFunction fn) { - UHashFunction result = hash->keyHasher; +U_CAPI UHashFunction *U_EXPORT2 +uhash_setKeyHasher(UHashtable *hash, UHashFunction *fn) { + UHashFunction *result = hash->keyHasher; hash->keyHasher = fn; return result; } -U_CAPI UKeyComparator U_EXPORT2 -uhash_setKeyComparator(UHashtable *hash, UKeyComparator fn) { - UKeyComparator result = hash->keyComparator; +U_CAPI UKeyComparator *U_EXPORT2 +uhash_setKeyComparator(UHashtable *hash, UKeyComparator *fn) { + UKeyComparator *result = hash->keyComparator; hash->keyComparator = fn; return result; } -U_CAPI UObjectDeleter U_EXPORT2 -uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter fn) { - UObjectDeleter result = hash->keyDeleter; +U_CAPI UObjectDeleter *U_EXPORT2 +uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter *fn) { + UObjectDeleter *result = hash->keyDeleter; hash->keyDeleter = fn; return result; } -U_CAPI UObjectDeleter U_EXPORT2 -uhash_setValueDeleter(UHashtable *hash, UObjectDeleter fn) { - UObjectDeleter result = hash->valueDeleter; +U_CAPI UObjectDeleter *U_EXPORT2 +uhash_setValueDeleter(UHashtable *hash, UObjectDeleter *fn) { + UObjectDeleter *result = hash->valueDeleter; hash->valueDeleter = fn; return result; } @@ -559,7 +559,7 @@ uhash_freeBlock(void *obj) { ********************************************************************/ static UHashtable* -_uhash_create(UHashFunction keyHash, UKeyComparator keyComp, +_uhash_create(UHashFunction *keyHash, UKeyComparator *keyComp, int32_t primeIndex, UErrorCode *status) { UHashtable *result; diff --git a/icu4c/source/common/uhash.h b/icu4c/source/common/uhash.h index f7dd1ef99fd..580ae957f55 100644 --- a/icu4c/source/common/uhash.h +++ b/icu4c/source/common/uhash.h @@ -107,7 +107,7 @@ typedef struct UHashElement UHashElement; * @param key A key stored in a hashtable * @return A NON-NEGATIVE hash code for parm. */ -typedef int32_t (U_EXPORT2 * U_CALLCONV UHashFunction)(const UHashTok key); +typedef int32_t U_CALLCONV UHashFunction(const UHashTok key); /** * A key comparison function. @@ -115,8 +115,8 @@ typedef int32_t (U_EXPORT2 * U_CALLCONV UHashFunction)(const UHashTok key); * @param key2 A key stored in a hashtable * @return TRUE if the two keys are equal. */ -typedef UBool (U_EXPORT2 * U_CALLCONV UKeyComparator)(const UHashTok key1, - const UHashTok key2); +typedef UBool U_CALLCONV UKeyComparator(const UHashTok key1, + const UHashTok key2); /** * A function called by uhash_remove, @@ -124,7 +124,7 @@ typedef UBool (U_EXPORT2 * U_CALLCONV UKeyComparator)(const UHashTok key1, * an existing key or value. * @param obj A key or value stored in a hashtable */ -typedef void (U_EXPORT2 * U_CALLCONV UObjectDeleter)(void* obj); +typedef void U_CALLCONV UObjectDeleter(void* obj); /** * This specifies whether or not, and how, the hastable resizes itself. @@ -165,13 +165,13 @@ struct UHashtable { /* Function pointers */ - UHashFunction keyHasher; /* Computes hash from key. + UHashFunction *keyHasher; /* Computes hash from key. * Never null. */ - UKeyComparator keyComparator; /* Compares keys for equality. + UKeyComparator *keyComparator; /* Compares keys for equality. * Never null. */ - UObjectDeleter keyDeleter; /* Deletes keys when required. + UObjectDeleter *keyDeleter; /* Deletes keys when required. * If NULL won't do anything */ - UObjectDeleter valueDeleter; /* Deletes values when required. + UObjectDeleter *valueDeleter; /* Deletes values when required. * If NULL won't do anything */ }; typedef struct UHashtable UHashtable; @@ -193,8 +193,8 @@ U_CDECL_END * @see uhash_openSize */ U_CAPI UHashtable* U_EXPORT2 -uhash_open(UHashFunction keyHash, - UKeyComparator keyComp, +uhash_open(UHashFunction *keyHash, + UKeyComparator *keyComp, UErrorCode *status); /** @@ -209,8 +209,8 @@ uhash_open(UHashFunction keyHash, * @see uhash_open */ U_CAPI UHashtable* U_EXPORT2 -uhash_openSize(UHashFunction keyHash, - UKeyComparator keyComp, +uhash_openSize(UHashFunction *keyHash, + UKeyComparator *keyComp, int32_t size, UErrorCode *status); @@ -229,8 +229,8 @@ uhash_close(UHashtable *hash); * @param fn the function to be used hash keys; must not be NULL * @return the previous key hasher; non-NULL */ -U_CAPI UHashFunction U_EXPORT2 -uhash_setKeyHasher(UHashtable *hash, UHashFunction fn); +U_CAPI UHashFunction *U_EXPORT2 +uhash_setKeyHasher(UHashtable *hash, UHashFunction *fn); /** * Set the function used to compare keys. The default comparison is a @@ -239,8 +239,8 @@ uhash_setKeyHasher(UHashtable *hash, UHashFunction fn); * @param fn the function to be used compare keys; must not be NULL * @return the previous key comparator; non-NULL */ -U_CAPI UKeyComparator U_EXPORT2 -uhash_setKeyComparator(UHashtable *hash, UKeyComparator fn); +U_CAPI UKeyComparator *U_EXPORT2 +uhash_setKeyComparator(UHashtable *hash, UKeyComparator *fn); /** * Set the function used to delete keys. If this function pointer is @@ -252,8 +252,8 @@ uhash_setKeyComparator(UHashtable *hash, UKeyComparator fn); * @param fn the function to be used delete keys, or NULL * @return the previous key deleter; may be NULL */ -U_CAPI UObjectDeleter U_EXPORT2 -uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter fn); +U_CAPI UObjectDeleter *U_EXPORT2 +uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter *fn); /** * Set the function used to delete values. If this function pointer @@ -265,8 +265,8 @@ uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter fn); * @param fn the function to be used delete values, or NULL * @return the previous value deleter; may be NULL */ -U_CAPI UObjectDeleter U_EXPORT2 -uhash_setValueDeleter(UHashtable *hash, UObjectDeleter fn); +U_CAPI UObjectDeleter *U_EXPORT2 +uhash_setValueDeleter(UHashtable *hash, UObjectDeleter *fn); /** * Specify whether or not, and how, the hastable resizes itself. diff --git a/icu4c/source/common/uvector.cpp b/icu4c/source/common/uvector.cpp index 87a3e13da76..9373ae2459d 100644 --- a/icu4c/source/common/uvector.cpp +++ b/icu4c/source/common/uvector.cpp @@ -37,7 +37,7 @@ UVector::UVector(int32_t initialCapacity, UErrorCode &status) : _init(initialCapacity, status); } -UVector::UVector(UObjectDeleter d, UKeyComparator c, UErrorCode &status) : +UVector::UVector(UObjectDeleter *d, UKeyComparator *c, UErrorCode &status) : count(0), capacity(0), elements(0), @@ -47,7 +47,7 @@ UVector::UVector(UObjectDeleter d, UKeyComparator c, UErrorCode &status) : _init(DEFUALT_CAPACITY, status); } -UVector::UVector(UObjectDeleter d, UKeyComparator c, int32_t initialCapacity, UErrorCode &status) : +UVector::UVector(UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, UErrorCode &status) : count(0), capacity(0), elements(0), @@ -352,14 +352,14 @@ void** UVector::toArray(void** result) const { return result; } -UObjectDeleter UVector::setDeleter(UObjectDeleter d) { - UObjectDeleter old = deleter; +UObjectDeleter *UVector::setDeleter(UObjectDeleter *d) { + UObjectDeleter *old = deleter; deleter = d; return old; } -UKeyComparator UVector::setComparer(UKeyComparator d) { - UKeyComparator old = comparer; +UKeyComparator *UVector::setComparer(UKeyComparator *d) { + UKeyComparator *old = comparer; comparer = d; return old; } @@ -447,12 +447,12 @@ UStack::UStack(int32_t initialCapacity, UErrorCode &status) : { } -UStack::UStack(UObjectDeleter d, UKeyComparator c, UErrorCode &status) : +UStack::UStack(UObjectDeleter *d, UKeyComparator *c, UErrorCode &status) : UVector(d, c, status) { } -UStack::UStack(UObjectDeleter d, UKeyComparator c, int32_t initialCapacity, UErrorCode &status) : +UStack::UStack(UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, UErrorCode &status) : UVector(d, c, initialCapacity, status) { } diff --git a/icu4c/source/common/uvector.h b/icu4c/source/common/uvector.h index 69ce18ce759..bf593069913 100644 --- a/icu4c/source/common/uvector.h +++ b/icu4c/source/common/uvector.h @@ -102,18 +102,18 @@ private: UHashTok* elements; - UObjectDeleter deleter; + UObjectDeleter *deleter; - UKeyComparator comparer; + UKeyComparator *comparer; public: UVector(UErrorCode &status); UVector(int32_t initialCapacity, UErrorCode &status); - UVector(UObjectDeleter d, UKeyComparator c, UErrorCode &status); + UVector(UObjectDeleter *d, UKeyComparator *c, UErrorCode &status); - UVector(UObjectDeleter d, UKeyComparator c, int32_t initialCapacity, UErrorCode &status); + UVector(UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, UErrorCode &status); ~UVector(); @@ -204,9 +204,9 @@ public: // New API //------------------------------------------------------------ - UObjectDeleter setDeleter(UObjectDeleter d); + UObjectDeleter *setDeleter(UObjectDeleter *d); - UKeyComparator setComparer(UKeyComparator c); + UKeyComparator *setComparer(UKeyComparator *c); void* operator[](int32_t index) const; @@ -300,9 +300,9 @@ public: UStack(int32_t initialCapacity, UErrorCode &status); - UStack(UObjectDeleter d, UKeyComparator c, UErrorCode &status); + UStack(UObjectDeleter *d, UKeyComparator *c, UErrorCode &status); - UStack(UObjectDeleter d, UKeyComparator c, int32_t initialCapacity, UErrorCode &status); + UStack(UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, UErrorCode &status); // It's okay not to have a virtual destructor (in UVector) // because UStack has no special cleanup to do. diff --git a/icu4c/source/i18n/tridpars.cpp b/icu4c/source/i18n/tridpars.cpp index 39d43d21867..fd26f598e43 100644 --- a/icu4c/source/i18n/tridpars.cpp +++ b/icu4c/source/i18n/tridpars.cpp @@ -417,7 +417,7 @@ UBool TransliteratorIDParser::parseCompoundID(const UnicodeString& id, int32_t d return TRUE; FAIL: - UObjectDeleter save = list.setDeleter(_deleteSingleID); + UObjectDeleter *save = list.setDeleter(_deleteSingleID); list.removeAllElements(); list.setDeleter(save); delete globalFilter; @@ -503,7 +503,7 @@ int32_t TransliteratorIDParser::instantiateList(UVector& list, RETURN: - UObjectDeleter save = list.setDeleter(_deleteSingleID); + UObjectDeleter *save = list.setDeleter(_deleteSingleID); list.removeAllElements(); list.setDeleter(_deleteTransliterator);