X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/4388f060552cc537e71e957d32f35e9d75a61233..c5116b9f5a666b9d59f443b3770acd6ef64dc6c3:/icuSources/common/uobject.cpp diff --git a/icuSources/common/uobject.cpp b/icuSources/common/uobject.cpp index bf31c573..e222b2ce 100644 --- a/icuSources/common/uobject.cpp +++ b/icuSources/common/uobject.cpp @@ -1,12 +1,14 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * -* Copyright (C) 2002-2011, International Business Machines +* Copyright (C) 2002-2012, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** * file name: uobject.h -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -56,32 +58,32 @@ U_NAMESPACE_BEGIN * and replace with uprv_malloc/uprv_free. */ -void * U_EXPORT2 UMemory::operator new(size_t size) U_NO_THROW { +void * U_EXPORT2 UMemory::operator new(size_t size) U_NOEXCEPT { return uprv_malloc(size); } -void U_EXPORT2 UMemory::operator delete(void *p) U_NO_THROW { +void U_EXPORT2 UMemory::operator delete(void *p) U_NOEXCEPT { if(p!=NULL) { uprv_free(p); } } -void * U_EXPORT2 UMemory::operator new[](size_t size) U_NO_THROW { +void * U_EXPORT2 UMemory::operator new[](size_t size) U_NOEXCEPT { return uprv_malloc(size); } -void U_EXPORT2 UMemory::operator delete[](void *p) U_NO_THROW { +void U_EXPORT2 UMemory::operator delete[](void *p) U_NOEXCEPT { if(p!=NULL) { uprv_free(p); } } #if U_HAVE_DEBUG_LOCATION_NEW -void * U_EXPORT2 UMemory::operator new(size_t size, const char* /*file*/, int /*line*/) U_NO_THROW { +void * U_EXPORT2 UMemory::operator new(size_t size, const char* /*file*/, int /*line*/) U_NOEXCEPT { return UMemory::operator new(size); } -void U_EXPORT2 UMemory::operator delete(void* p, const char* /*file*/, int /*line*/) U_NO_THROW { +void U_EXPORT2 UMemory::operator delete(void* p, const char* /*file*/, int /*line*/) U_NOEXCEPT { UMemory::operator delete(p); } #endif /* U_HAVE_DEBUG_LOCATION_NEW */ @@ -91,23 +93,7 @@ void U_EXPORT2 UMemory::operator delete(void* p, const char* /*file*/, int /*lin UObject::~UObject() {} -// Future implementation for RTTI that support subtyping. [alan] -// -// UClassID UObject::getStaticClassID() { -// return (UClassID) NULL; -// } -// -// UBool UObject::instanceOf(UClassID type) const { -// UClassID c = getDynamicClassID(); -// for (;;) { -// if (c == type) { -// return TRUE; -// } else if (c == (UClassID) NULL) { -// return FALSE; -// } -// c = * (UClassID*) c; -// } -// } +UClassID UObject::getDynamicClassID() const { return NULL; } U_NAMESPACE_END @@ -115,5 +101,5 @@ U_NAMESPACE_USE U_CAPI void U_EXPORT2 uprv_deleteUObject(void *obj) { - delete reinterpret_cast(obj); + delete static_cast(obj); }