summaryrefslogtreecommitdiff
path: root/src/corefx
diff options
context:
space:
mode:
authorMatt Ellis <matell@microsoft.com>2015-09-22 14:47:20 -0700
committerMatt Ellis <matell@microsoft.com>2015-09-22 14:47:20 -0700
commit5f6fce38a9a7cbad436cf10a2410652f0fea3588 (patch)
treed6d2efa58f1fb2530c6b2926ebe82db7a1e407bf /src/corefx
parent93eeae8f8ed87230dd3ba5d52195b60dd01d0f2e (diff)
downloadcoreclr-5f6fce38a9a7cbad436cf10a2410652f0fea3588.tar.gz
coreclr-5f6fce38a9a7cbad436cf10a2410652f0fea3588.tar.bz2
coreclr-5f6fce38a9a7cbad436cf10a2410652f0fea3588.zip
Respond to PR feedback
Diffstat (limited to 'src/corefx')
-rw-r--r--src/corefx/System.Globalization.Native/calendarData.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corefx/System.Globalization.Native/calendarData.cpp b/src/corefx/System.Globalization.Native/calendarData.cpp
index a9c356dbaf..1fc61167af 100644
--- a/src/corefx/System.Globalization.Native/calendarData.cpp
+++ b/src/corefx/System.Globalization.Native/calendarData.cpp
@@ -23,6 +23,8 @@
#define ISLAMIC_UMALQURA_NAME "islamic-umalqura"
#define ROC_NAME "roc"
+#define JAPANESE_LOCALE_AND_CALENDAR "ja_JP@calendar=japanese"
+
/*
* These values should be kept in sync with System.Globalization.CalendarId
*/
@@ -519,7 +521,7 @@ Gets the latest era in the Japanese calendar.
extern "C" int32_t GetLatestJapaneseEra()
{
UErrorCode err = U_ZERO_ERROR;
- Locale japaneseLocale("ja_JP@calendar=japanese");
+ Locale japaneseLocale(JAPANESE_LOCALE_AND_CALENDAR);
LocalPointer<Calendar> calendar(Calendar::createInstance(japaneseLocale, err));
if (U_FAILURE(err))
@@ -540,8 +542,12 @@ extern "C" int32_t GetJapaneseEraStartDate(
int32_t* startMonth,
int32_t* startDay)
{
+ *startYear = -1;
+ *startMonth = -1;
+ *startDay = -1;
+
UErrorCode err = U_ZERO_ERROR;
- Locale japaneseLocale("ja_JP@calendar=japanese");
+ Locale japaneseLocale(JAPANESE_LOCALE_AND_CALENDAR);
LocalPointer<Calendar> calendar(Calendar::createInstance(japaneseLocale, err));
if (U_FAILURE(err))
return false;