ICU-13722 Removing obsolete constructs FmtStackData and UCONFIG_FORMAT_FASTPATHS_49.

X-SVN-Rev: 41457
This commit is contained in:
Shane Carr 2018-05-25 00:26:00 +00:00
parent 79b8248092
commit 4beed11456
9 changed files with 8 additions and 114 deletions

View File

@ -1,56 +0,0 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
* Copyright (C) 2012-2014, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************/
// TODO: This file, and the corresponding UCONFIG settings, may be obsolete.
#ifndef DCFMTIMP_H
#define DCFMTIMP_H
#include "unicode/utypes.h"
#if UCONFIG_FORMAT_FASTPATHS_49
U_NAMESPACE_BEGIN
enum EDecimalFormatFastpathStatus {
kFastpathNO = 0,
kFastpathYES = 1,
kFastpathUNKNOWN = 2, /* not yet set */
kFastpathMAYBE = 3 /* depends on value being formatted. */
};
/**
* Must be smaller than DecimalFormat::fReserved
*/
struct DecimalFormatInternal {
uint8_t fFastFormatStatus;
uint8_t fFastParseStatus;
DecimalFormatInternal &operator=(const DecimalFormatInternal& rhs) {
fFastParseStatus = rhs.fFastParseStatus;
fFastFormatStatus = rhs.fFastFormatStatus;
return *this;
}
#ifdef FMT_DEBUG
void dump() const {
printf("DecimalFormatInternal: fFastFormatStatus=%c, fFastParseStatus=%c\n",
"NY?"[(int)fFastFormatStatus&3],
"NY?"[(int)fFastParseStatus&3]
);
}
#endif
};
U_NAMESPACE_END
#endif
#endif

View File

@ -16,16 +16,6 @@
U_NAMESPACE_BEGIN
/**
* @internal
*/
struct FmtStackData {
icu::number::impl::DecimalQuantity stackDecimalNum; // 128
//CharString stackDecimalStr; // 64
// -----
// 192 total
};
/**
* Maximum int64_t value that can be stored in a double without chancing losing precision.
* IEEE doubles have 53 bits of mantissa, 10 bits exponent, 1 bit sign.

View File

@ -407,7 +407,6 @@
<ClInclude Include="collationtailoring.h" />
<ClInclude Include="collationweights.h" />
<ClInclude Include="dayperiodrules.h" />
<ClInclude Include="dcfmtimp.h" />
<ClInclude Include="numsys_impl.h" />
<ClInclude Include="region_impl.h" />
<ClInclude Include="selfmtimpl.h" />

View File

@ -1091,9 +1091,6 @@
<ClInclude Include="numsys_impl.h">
<Filter>formatting</Filter>
</ClInclude>
<ClInclude Include="dcfmtimp.h">
<Filter>formatting</Filter>
</ClInclude>
<ClInclude Include="selfmtimpl.h">
<Filter>formatting</Filter>
</ClInclude>

View File

@ -512,7 +512,6 @@
<ClInclude Include="collationtailoring.h" />
<ClInclude Include="collationweights.h" />
<ClInclude Include="dayperiodrules.h" />
<ClInclude Include="dcfmtimp.h" />
<ClInclude Include="numsys_impl.h" />
<ClInclude Include="region_impl.h" />
<ClInclude Include="selfmtimpl.h" />

View File

@ -43,16 +43,6 @@
#include "unicode/curramt.h"
#include "unicode/enumset.h"
#ifndef U_HIDE_INTERNAL_API
/**
* \def UNUM_DECIMALFORMAT_INTERNAL_SIZE
* @internal
*/
#if UCONFIG_FORMAT_FASTPATHS_49
#define UNUM_DECIMALFORMAT_INTERNAL_SIZE 16
#endif
#endif /* U_HIDE_INTERNAL_API */
U_NAMESPACE_BEGIN
class CurrencyPluralInfo;

View File

@ -39,16 +39,6 @@ class DecimalQuantity;
}
}
/**
* \def UNUM_INTERNAL_STACKARRAY_SIZE
* @internal
*/
#if U_PLATFORM == U_PF_OS400
#define UNUM_INTERNAL_STACKARRAY_SIZE 144
#else
#define UNUM_INTERNAL_STACKARRAY_SIZE 80
#endif
/**
* Formattable objects can be passed to the Format class or
* its subclasses for formatting. Formattable is a thin wrapper

View File

@ -6956,21 +6956,7 @@ NumberFormatTest::Test9087(void)
unum_close(fmt);
}
#include "dcfmtimp.h"
void NumberFormatTest::TestFormatFastpaths() {
#if UCONFIG_FORMAT_FASTPATHS_49
logln("Sizeof DecimalFormat = %d, Sizeof DecimalFormatInternal=%d, UNUM_DECIMALFORMAT_INTERNAL_SIZE=%d\n",
sizeof(DecimalFormat), sizeof(DecimalFormatInternal), UNUM_DECIMALFORMAT_INTERNAL_SIZE);
if(UNUM_DECIMALFORMAT_INTERNAL_SIZE < sizeof(DecimalFormatInternal)) {
errln("Error: sizeof(DecimalFormatInternal)=%d but UNUM_DECIMALFORMAT_INTERNAL_SIZE is only %d. Increase the #define?\n", sizeof(DecimalFormatInternal), UNUM_DECIMALFORMAT_INTERNAL_SIZE);
} else if(UNUM_DECIMALFORMAT_INTERNAL_SIZE > (sizeof(DecimalFormatInternal)+16)) {
infoln("Note: sizeof(DecimalFormatInternal)=%d but UNUM_DECIMALFORMAT_INTERNAL_SIZE is %d. Decrease the #define? sizeof(DecimalFormat)=%d\n", sizeof(DecimalFormatInternal), UNUM_DECIMALFORMAT_INTERNAL_SIZE, sizeof(DecimalFormat));
}
#else
infoln("NOTE: UCONFIG_FORMAT_FASTPATHS not set, test skipped.");
#endif
// get some additional case
{
UErrorCode status=U_ZERO_ERROR;
@ -7081,15 +7067,15 @@ void NumberFormatTest::TestFormatFastpaths() {
void NumberFormatTest::TestFormattableSize(void) {
if(sizeof(FmtStackData) > UNUM_INTERNAL_STACKARRAY_SIZE) {
errln("Error: sizeof(FmtStackData)=%d, UNUM_INTERNAL_STACKARRAY_SIZE=%d\n",
sizeof(FmtStackData), UNUM_INTERNAL_STACKARRAY_SIZE);
} else if(sizeof(FmtStackData) < UNUM_INTERNAL_STACKARRAY_SIZE) {
logln("Warning: sizeof(FmtStackData)=%d, UNUM_INTERNAL_STACKARRAY_SIZE=%d\n",
sizeof(FmtStackData), UNUM_INTERNAL_STACKARRAY_SIZE);
if(sizeof(Formattable) > 112) {
errln("Error: sizeof(Formattable)=%d, 112=%d\n",
sizeof(Formattable), 112);
} else if(sizeof(Formattable) < 112) {
logln("Warning: sizeof(Formattable)=%d, 112=%d\n",
sizeof(Formattable), 112);
} else {
logln("sizeof(FmtStackData)=%d, UNUM_INTERNAL_STACKARRAY_SIZE=%d\n",
sizeof(FmtStackData), UNUM_INTERNAL_STACKARRAY_SIZE);
logln("sizeof(Formattable)=%d, 112=%d\n",
sizeof(Formattable), 112);
}
}

View File

@ -554,7 +554,6 @@ static const USystemParams systemParams[] = {
#endif
{ "uconfig.internal_digitlist", paramInteger, "b", 1}, /* always 1 */
{ "uconfig.have_parseallinput", paramInteger, "b", UCONFIG_HAVE_PARSEALLINPUT},
{ "uconfig.format_fastpaths_49",paramInteger, "b", UCONFIG_FORMAT_FASTPATHS_49},
};