From f346c4d8f236b2ce691ffaf32abcdd9725eefea7 Mon Sep 17 00:00:00 2001 From: Vladimir Weinstein Date: Thu, 29 Aug 2002 22:12:49 +0000 Subject: [PATCH] ICU-2268 fixed UTokenAssigner bug in UVector X-SVN-Rev: 9816 --- icu4c/source/common/uniset.cpp | 4 ++-- icu4c/source/common/uvector.cpp | 2 +- icu4c/source/common/uvector.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/icu4c/source/common/uniset.cpp b/icu4c/source/common/uniset.cpp index 71f397462b..d865119010 100644 --- a/icu4c/source/common/uniset.cpp +++ b/icu4c/source/common/uniset.cpp @@ -151,8 +151,8 @@ static inline void _dbgdt(UnicodeSet* set) { // UnicodeString in UVector support //---------------------------------------------------------------- -static void U_CALLCONV cloneUnicodeString(UHashTok dst, UHashTok src) { - dst.pointer = new UnicodeString(*(UnicodeString*)src.pointer); +static void U_CALLCONV cloneUnicodeString(UHashTok *dst, UHashTok *src) { + dst->pointer = new UnicodeString(*(UnicodeString*)src->pointer); } static int8_t U_CALLCONV compareUnicodeString(UHashTok t1, UHashTok t2) { diff --git a/icu4c/source/common/uvector.cpp b/icu4c/source/common/uvector.cpp index 01c23e0ede..8da159924f 100644 --- a/icu4c/source/common/uvector.cpp +++ b/icu4c/source/common/uvector.cpp @@ -95,7 +95,7 @@ void UVector::assign(const UVector& other, UTokenAssigner *assign, UErrorCode &e if (elements[i].pointer != 0 && deleter != 0) { (*deleter)(elements[i].pointer); } - (*assign)(elements[i], other.elements[i]); + (*assign)(&elements[i], &other.elements[i]); } } } diff --git a/icu4c/source/common/uvector.h b/icu4c/source/common/uvector.h index ba310a7662..faf71bb83b 100644 --- a/icu4c/source/common/uvector.h +++ b/icu4c/source/common/uvector.h @@ -34,8 +34,8 @@ typedef int8_t U_CALLCONV USortComparator(UHashTok tok1, * @param dst The token to be assigned to * @param src The token to assign from */ -typedef void U_CALLCONV UTokenAssigner(UHashTok dst, - UHashTok src); +typedef void U_CALLCONV UTokenAssigner(UHashTok *dst, + UHashTok *src); /** *

Ultralightweight C++ implementation of a void* vector