From: Shane Carr Date: Sat, 23 Mar 2019 04:34:56 +0000 (-0700) Subject: ICU-20439 Fix internal and draft headers. X-Git-Tag: release-64-1~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c86028c70c45ab0d8f3d8cbcc26c703f95fb6aec;p=icu ICU-20439 Fix internal and draft headers. --- diff --git a/icu4c/source/i18n/numsys.cpp b/icu4c/source/i18n/numsys.cpp index 50be63e7b93..d420151b1b5 100644 --- a/icu4c/source/i18n/numsys.cpp +++ b/icu4c/source/i18n/numsys.cpp @@ -260,8 +260,8 @@ void NumberingSystem::setName(const char *n) { if ( n == nullptr ) { name[0] = (char) 0; } else { - uprv_strncpy(name,n,NUMSYS_NAME_CAPACITY); - name[NUMSYS_NAME_CAPACITY] = '\0'; // Make sure it is null terminated. + uprv_strncpy(name,n,kInternalNumSysNameCapacity); + name[kInternalNumSysNameCapacity] = '\0'; // Make sure it is null terminated. } } UBool NumberingSystem::isAlgorithmic() const { diff --git a/icu4c/source/i18n/unicode/numberformatter.h b/icu4c/source/i18n/unicode/numberformatter.h index 72f474886a0..e9fe39a9316 100644 --- a/icu4c/source/i18n/unicode/numberformatter.h +++ b/icu4c/source/i18n/unicode/numberformatter.h @@ -112,7 +112,7 @@ class IntegerWidth; namespace impl { -#ifndef U_HIDE_INTERNAL_API +// can't be #ifndef U_HIDE_INTERNAL_API; referenced throughout this file in public classes /** * Datatype for minimum/maximum fraction digits. Must be able to hold kMaxIntFracSig. * @@ -120,14 +120,14 @@ namespace impl { */ typedef int16_t digits_t; +// can't be #ifndef U_HIDE_INTERNAL_API; needed for struct initialization /** * Use a default threshold of 3. This means that the third time .format() is called, the data structures get built * using the "safe" code path. The first two calls to .format() will trigger the unsafe code path. * * @internal */ -static constexpr int32_t DEFAULT_THRESHOLD = 3; -#endif /* U_HIDE_INTERNAL_API */ +static constexpr int32_t kInternalDefaultThreshold = 3; // Forward declarations: class Padder; @@ -1411,7 +1411,7 @@ struct U_I18N_API MacroProps : public UMemory { const CurrencySymbols* currencySymbols = nullptr; // no ownership /** @internal */ - int32_t threshold = DEFAULT_THRESHOLD; + int32_t threshold = kInternalDefaultThreshold; /** @internal */ Locale locale; diff --git a/icu4c/source/i18n/unicode/numsys.h b/icu4c/source/i18n/unicode/numsys.h index 5e14ea5c311..0ced6f4cfa6 100644 --- a/icu4c/source/i18n/unicode/numsys.h +++ b/icu4c/source/i18n/unicode/numsys.h @@ -20,16 +20,6 @@ #include "unicode/utypes.h" -#ifndef U_HIDE_INTERNAL_API -/** - * \def NUMSYS_NAME_CAPACITY - * Size of a numbering system name. - * @internal - */ -#define NUMSYS_NAME_CAPACITY 8 -#endif /* U_HIDE_INTERNAL_API */ - - /** * \file * \brief C++ API: NumberingSystem object @@ -37,12 +27,18 @@ #if !UCONFIG_NO_FORMATTING - #include "unicode/format.h" #include "unicode/uobject.h" U_NAMESPACE_BEGIN +// can't be #ifndef U_HIDE_INTERNAL_API; needed for char[] field size +/** + * Size of a numbering system name. + * @internal + */ +constexpr const size_t kInternalNumSysNameCapacity = 8; + /** * Defines numbering systems. A numbering system describes the scheme by which * numbers are to be presented to the end user. In its simplest form, a numbering @@ -195,7 +191,7 @@ private: UnicodeString desc; int32_t radix; UBool algorithmic; - char name[NUMSYS_NAME_CAPACITY+1]; + char name[kInternalNumSysNameCapacity+1]; void setRadix(int32_t radix); diff --git a/icu4c/source/i18n/unicode/reldatefmt.h b/icu4c/source/i18n/unicode/reldatefmt.h index 32344cd5f18..16ae91ad034 100644 --- a/icu4c/source/i18n/unicode/reldatefmt.h +++ b/icu4c/source/i18n/unicode/reldatefmt.h @@ -708,11 +708,13 @@ private: UErrorCode& status, Args... args) const; +#ifndef U_HIDE_DRAFT_API // for FormattedRelativeDateTime template FormattedRelativeDateTime doFormatToValue( F callback, UErrorCode& status, Args... args) const; +#endif // U_HIDE_DRAFT_API void formatImpl( double quantity, diff --git a/icu4c/source/test/hdrtst/cxxfiles.txt b/icu4c/source/test/hdrtst/cxxfiles.txt index 4c06badc6b7..02151debd6a 100644 --- a/icu4c/source/test/hdrtst/cxxfiles.txt +++ b/icu4c/source/test/hdrtst/cxxfiles.txt @@ -53,11 +53,13 @@ fieldpos.h filteredbrk.h fmtable.h format.h +formattedvalue.h fpositer.h gender.h gregocal.h idna.h listformatter.h +localebuilder.h locdspnm.h locid.h measfmt.h