X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..9d88c94317aeac5dd26c1dbe8c2112dbe855d2b5:/icuSources/common/uvector.cpp diff --git a/icuSources/common/uvector.cpp b/icuSources/common/uvector.cpp index 8da15992..ca76a709 100644 --- a/icuSources/common/uvector.cpp +++ b/icuSources/common/uvector.cpp @@ -1,6 +1,6 @@ /* ****************************************************************************** -* Copyright (C) 1999-2001, International Business Machines Corporation and * +* Copyright (C) 1999-2004, International Business Machines Corporation and * * others. All Rights Reserved. * ****************************************************************************** * Date Name Description @@ -23,7 +23,7 @@ U_NAMESPACE_BEGIN #define HINT_KEY_POINTER (1) #define HINT_KEY_INTEGER (0) -const char UVector::fgClassID=0; +UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UVector) UVector::UVector(UErrorCode &status) : count(0), @@ -66,6 +66,9 @@ UVector::UVector(UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, } void UVector::_init(int32_t initialCapacity, UErrorCode &status) { + if (U_FAILURE(status)) { + return; + } // Fix bogus initialCapacity values; avoid malloc(0) if (initialCapacity < 1) { initialCapacity = DEFUALT_CAPACITY; @@ -465,8 +468,6 @@ void UVector::sortedInsert(UHashTok tok, USortComparator *compare, UErrorCode& e } } -const char UStack::fgClassID=0; - UStack::UStack(UErrorCode &status) : UVector(status) { @@ -487,6 +488,8 @@ UStack::UStack(UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, UE { } +UStack::~UStack() {} + void* UStack::pop(void) { int32_t n = size() - 1; void* result = 0;