X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/f3c0d7a59d99c2a94c6b8822291f0e42be3773c9..4f1e1a09ce4daed860e35d359ce2fceccb0764e8:/icuSources/i18n/reldatefmt.cpp diff --git a/icuSources/i18n/reldatefmt.cpp b/icuSources/i18n/reldatefmt.cpp index 38bfe962..aad026cb 100644 --- a/icuSources/i18n/reldatefmt.cpp +++ b/icuSources/i18n/reldatefmt.cpp @@ -14,6 +14,7 @@ #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION +#include #include "unicode/dtfmtsym.h" #include "unicode/ucasemap.h" #include "unicode/ureldatefmt.h" @@ -560,7 +561,7 @@ struct RelDateTimeFmtDataSink : public ResourceSink { RelDateTimeFmtDataSink::~RelDateTimeFmtDataSink() {} } // namespace -DateFormatSymbols::DtWidthType styleToDateFormatSymbolWidth[UDAT_STYLE_COUNT] = { +static const DateFormatSymbols::DtWidthType styleToDateFormatSymbolWidth[UDAT_STYLE_COUNT] = { DateFormatSymbols::WIDE, DateFormatSymbols::SHORT, DateFormatSymbols::NARROW }; @@ -849,7 +850,7 @@ UnicodeString& RelativeDateTimeFormatter::formatNumeric( return appendTo; } UDateDirection direction = UDAT_DIRECTION_NEXT; - if (offset < 0) { + if (std::signbit(offset)) { // needed to handle -0.0 direction = UDAT_DIRECTION_LAST; offset = -offset; }