From 177c4eec6385f7a79ac280402c3ec06bd81769f9 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Sat, 14 Jan 2006 09:24:33 +0000 Subject: [PATCH] ICU-4707 Fix some compiler warnings X-SVN-Rev: 18987 --- icu4c/source/i18n/fmtable.cpp | 23 ++++++++++++++++++----- icu4c/source/i18n/unicode/fmtable.h | 19 +------------------ 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/icu4c/source/i18n/fmtable.cpp b/icu4c/source/i18n/fmtable.cpp index b3a882e9056..b767b332166 100644 --- a/icu4c/source/i18n/fmtable.cpp +++ b/icu4c/source/i18n/fmtable.cpp @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 1997-2005, International Business Machines Corporation and * +* Copyright (C) 1997-2006, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* * @@ -43,30 +43,43 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Formattable) // of the Measure class, which is true as of 3.0. [alan] // Return TRUE if *a == *b. -inline UBool objectEquals(const UObject* a, const UObject* b) { +static inline UBool objectEquals(const UObject* a, const UObject* b) { // LATER: return *a == *b; return *((const Measure*) a) == *((const Measure*) b); } // Return a clone of *a. -inline UObject* objectClone(const UObject* a) { +static inline UObject* objectClone(const UObject* a) { // LATER: return a->clone(); return ((const Measure*) a)->clone(); } // Return TRUE if *a is an instance of Measure. -inline UBool instanceOfMeasure(const UObject* a) { +static inline UBool instanceOfMeasure(const UObject* a) { // LATER: return a->instanceof(Measure::getStaticClassID()); return a->getDynamicClassID() == CurrencyAmount::getStaticClassID(); } +/** + * Creates a new Formattable array and copies the values from the specified + * original. + * @param array the original array + * @param count the original array count + * @return the new Formattable array. + */ +static inline Formattable* createArrayCopy(const Formattable* array, int32_t count) { + Formattable *result = new Formattable[count]; + for (int32_t i=0; i