From 4d4cde52ca1388a266ef496cd797f1cb797fed20 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Wed, 17 Jul 2002 19:44:00 +0000 Subject: [PATCH] ICU-1913 Fixes for iSeries. X-SVN-Rev: 9235 --- icu4c/source/common/uvector.cpp | 23 ++++++++++++++++++----- icu4c/source/common/uvector.h | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/icu4c/source/common/uvector.cpp b/icu4c/source/common/uvector.cpp index 9373ae2459..584ce4afe8 100644 --- a/icu4c/source/common/uvector.cpp +++ b/icu4c/source/common/uvector.cpp @@ -15,6 +15,14 @@ U_NAMESPACE_BEGIN #define DEFUALT_CAPACITY 8 +/* + * Constants for hinting whether a key is an integer + * or a pointer. If a hint bit is zero, then the associated + * token is assumed to be an integer. This is needed for iSeries + */ +#define HINT_KEY_POINTER (1) +#define HINT_KEY_INTEGER (2) + const char UVector::fgClassID=0; UVector::UVector(UErrorCode &status) : @@ -261,17 +269,17 @@ UBool UVector::equals(const UVector &other) const { int32_t UVector::indexOf(void* obj, int32_t startIndex) const { UHashTok key; key.pointer = obj; - return indexOf(key, startIndex); + return indexOf(key, startIndex, HINT_KEY_POINTER); } int32_t UVector::indexOf(int32_t obj, int32_t startIndex) const { UHashTok key; key.integer = obj; - return indexOf(key, startIndex); + return indexOf(key, startIndex, HINT_KEY_INTEGER); } // This only works if this object has a non-null comparer -int32_t UVector::indexOf(UHashTok key, int32_t startIndex) const { +int32_t UVector::indexOf(UHashTok key, int32_t startIndex, int8_t hint) const { int32_t i; if (comparer != 0) { for (i=startIndex; i