Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: source/i18n/islamcal.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/indiancal.cpp ('k') | source/i18n/locdspnm.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/islamcal.cpp
diff --git a/source/i18n/islamcal.cpp b/source/i18n/islamcal.cpp
index 9ecc7ed12a452ce8278060838cdfc52ab0ce387e..38ea781b226b0b9a085e101d2b6a4b87a3f7b93b 100644
--- a/source/i18n/islamcal.cpp
+++ b/source/i18n/islamcal.cpp
@@ -1,6 +1,6 @@
/*
******************************************************************************
-* Copyright (C) 2003-2013, International Business Machines Corporation
+* Copyright (C) 2003-2014, International Business Machines Corporation
* and others. All Rights Reserved.
******************************************************************************
*
@@ -77,60 +77,68 @@ U_NAMESPACE_BEGIN
/**
* Friday EPOC
*/
-static const int32_t CIVIL_EPOC = 1948440;
+static const int32_t CIVIL_EPOC = 1948440; // CE 622 July 16 Friday (Julian calendar) / CE 622 July 19 (Gregorian calendar)
/**
* Thursday EPOC
*/
-static const int32_t ASTRONOMICAL_EPOC = 1948439;
+static const int32_t ASTRONOMICAL_EPOC = 1948439; // CE 622 July 15 Thursday (Julian calendar)
-static const int32_t UMALQURA_YEAR_START = 1318;
-static const int32_t UMALQURA_YEAR_END = 1480;
+static const int32_t UMALQURA_YEAR_START = 1300;
+static const int32_t UMALQURA_YEAR_END = 1600;
static const int UMALQURA_MONTHLENGTH[] = {
- //* 1318 -1322 */ "0101 0111 0100", "1001 0111 0110", "0100 1011 0111", "0010 0101 0111", "0101 0010 1011",
- 0x0574, 0x0975, 0x06A7, 0x0257, 0x052B,
- //* 1323 -1327 */ "0110 1001 0101", "0110 1100 1010", "1010 1101 0101", "0101 0101 1011", "0010 0101 1101",
- 0x0695, 0x06CA, 0x0AD5, 0x055B, 0x025B,
- //* 1328 -1332 */ "1001 0010 1101", "1100 1001 0101", "1101 0100 1010", "1110 1010 0101", "0110 1101 0010",
- 0x092D, 0x0C95, 0x0D4A, 0x0E5B, 0x025B,
- //* 1333 -1337 */ "1010 1101 0101", "0101 0101 1010", "1010 1010 1011", "0100 0100 1011", "0110 1010 0101",
- 0x0AD5, 0x055A, 0x0AAB, 0x044B, 0x06A5,
- //* 1338 -1342 */ "0111 0101 0010", "1011 1010 1001", "0011 0111 0100", "1010 1011 0110", "0101 0101 0110",
- 0x0752, 0x0BA9, 0x0374, 0x0AB6, 0x0556,
- //* 1343 -1347 */ "1010 1010 1010", "1101 0101 0010", "1101 1010 1001", "0101 1101 0100", "1010 1110 1010",
- 0x0AAA, 0x0D52, 0x0DA9, 0x05D4, 0x0AEA,
- //* 1348 -1352 */ "0100 1101 1101", "0010 0110 1110", "1001 0010 1110", "1010 1010 0110", "1101 0101 0100",
- 0x04DD, 0x026E, 0x092E, 0x0AA6, 0x0D54,
- //* 1353 -1357 */ "0101 1010 1010", "0101 1011 0101", "0010 1011 0100", "1001 0011 0111", "0100 1001 1011",
- 0x05AA, 0x05B5, 0x02B4, 0x0937, 0x049B,
- //* 1358 -1362 */ "1010 0100 1011", "1011 0010 0101", "1011 0101 0100", "1011 0110 1010", "0101 0110 1101",
- 0x0A4B, 0x0B25, 0x0B54, 0x0B6A, 0x056D,
- //* 1363 -1367 */ "0100 1010 1101", "1010 0101 0101", "1101 0010 0101", "1110 1001 0010", "1110 1100 1001",
- 0x04AD, 0x0A55, 0x0D25, 0x0E92, 0x0EC9,
- //* 1368 -1372 */ "0110 1101 0100", "1010 1110 1010", "0101 0110 1011", "0100 1010 1011", "0110 1000 0101",
- 0x06D4, 0x0ADA, 0x056B, 0x04AB, 0x0685,
- //* 1373 -1377 */ "1011 0100 1001", "1011 1010 0100", "1011 1011 0010", "0101 1011 0101", "0010 1011 1010",
- 0x0B49, 0x0BA4, 0x0BB2, 0x05B5, 0x02BA,
- //* 1378 -1382 */ "1001 0101 1011", "0100 1010 1011", "0101 0101 0101", "0110 1011 0010", "0110 1101 1001",
- 0x095B, 0x04AB, 0x0555, 0x06B2, 0x06D9,
- //* 1383 -1387 */ "0010 1110 1100", "1001 0110 1110", "0100 1010 1110", "1010 0101 0110", "1101 0010 1010",
- 0x02EC, 0x096E, 0x04AE, 0x0A56, 0x0D2A,
- //* 1388 -1392 */ "1101 0101 0101", "0101 1010 1010", "1010 1011 0101", "0100 1011 1011", "0000 0101 1011",
- 0x0D55, 0x05AA, 0x0AB5, 0x04BB, 0x005B,
- //* 1393 -1397 */ "1001 0010 1011", "1010 1001 0101", "0011 0100 1010", "1011 1010 0101", "0101 1010 1010",
- 0x092B, 0x0A95, 0x034A, 0x0BA5, 0x05AA,
- //* 1398 -1402 */ "1010 1011 0101", "0101 0101 0110", "1010 1001 0110", "1101 0100 1010", "1110 1010 0101",
- 0x0AB5, 0x0556, 0x0A96, 0x0B4A, 0x0EA5,
- //* 1403 -1407 */ "0111 0101 0010", "0110 1110 1001", "0011 0110 1010", "1010 1010 1101", "0101 0101 0101",
- 0x0752, 0x06E9, 0x036A, 0x0AAD, 0x0555,
- //* 1408 -1412 */ "1010 1010 0101", "1011 0101 0010", "1011 1010 1001", "0101 1011 0100", "1001 1011 1010",
- 0x0AA5, 0x0B52, 0x0BA9, 0x05B4, 0x09BA,
- //* 1413 -1417 */ "0100 1101 1011", "0010 0101 1101", "0101 0010 1101", "1010 1010 0101", "1010 1101 0100",
- 0x04DB, 0x025D, 0x052D, 0x0AA5, 0x0AD4,
- //* 1418 -1422 */ "1010 1110 1010", "0101 0110 1101", "0100 1011 1101", "0010 0011 1101", "1001 0001 1101",
- 0x0AEA, 0x056D, 0x04BD, 0x023D, 0x091D,
+ //* 1300 -1302 */ "1010 1010 1010", "1101 0101 0100", "1110 1100 1001",
+ 0x0AAA, 0x0D54, 0x0EC9,
+ //* 1303 -1307 */ "0110 1101 0100", "0110 1110 1010", "0011 0110 1100", "1010 1010 1101", "0101 0101 0101",
+ 0x06D4, 0x06EA, 0x036C, 0x0AAD, 0x0555,
+ //* 1308 -1312 */ "0110 1010 1001", "0111 1001 0010", "1011 1010 1001", "0101 1101 0100", "1010 1101 1010",
+ 0x06A9, 0x0792, 0x0BA9, 0x05D4, 0x0ADA,
+ //* 1313 -1317 */ "0101 0101 1100", "1101 0010 1101", "0110 1001 0101", "0111 0100 1010", "1011 0101 0100",
+ 0x055C, 0x0D2D, 0x0695, 0x074A, 0x0B54,
+ //* 1318 -1322 */ "1011 0110 1010", "0101 1010 1101", "0100 1010 1110", "1010 0100 1111", "0101 0001 0111",
+ 0x0B6A, 0x05AD, 0x04AE, 0x0A4F, 0x0517,
+ //* 1323 -1327 */ "0110 1000 1011", "0110 1010 0101", "1010 1101 0101", "0010 1101 0110", "1001 0101 1011",
+ 0x068B, 0x06A5, 0x0AD5, 0x02D6, 0x095B,
+ //* 1328 -1332 */ "0100 1001 1101", "1010 0100 1101", "1101 0010 0110", "1101 1001 0101", "0101 1010 1100",
+ 0x049D, 0x0A4D, 0x0D26, 0x0D95, 0x05AC,
+ //* 1333 -1337 */ "1001 1011 0110", "0010 1011 1010", "1010 0101 1011", "0101 0010 1011", "1010 1001 0101",
+ 0x09B6, 0x02BA, 0x0A5B, 0x052B, 0x0A95,
+ //* 1338 -1342 */ "0110 1100 1010", "1010 1110 1001", "0010 1111 0100", "1001 0111 0110", "0010 1011 0110",
+ 0x06CA, 0x0AE9, 0x02F4, 0x0976, 0x02B6,
+ //* 1343 -1347 */ "1001 0101 0110", "1010 1100 1010", "1011 1010 0100", "1011 1101 0010", "0101 1101 1001",
+ 0x0956, 0x0ACA, 0x0BA4, 0x0BD2, 0x05D9,
+ //* 1348 -1352 */ "0010 1101 1100", "1001 0110 1101", "0101 0100 1101", "1010 1010 0101", "1011 0101 0010",
+ 0x02DC, 0x096D, 0x054D, 0x0AA5, 0x0B52,
+ //* 1353 -1357 */ "1011 1010 0101", "0101 1011 0100", "1001 1011 0110", "0101 0101 0111", "0010 1001 0111",
+ 0x0BA5, 0x05B4, 0x09B6, 0x0557, 0x0297,
+ //* 1358 -1362 */ "0101 0100 1011", "0110 1010 0011", "0111 0101 0010", "1011 0110 0101", "0101 0110 1010",
+ 0x054B, 0x06A3, 0x0752, 0x0B65, 0x056A,
+ //* 1363 -1367 */ "1010 1010 1011", "0101 0010 1011", "1100 1001 0101", "1101 0100 1010", "1101 1010 0101",
+ 0x0AAB, 0x052B, 0x0C95, 0x0D4A, 0x0DA5,
+ //* 1368 -1372 */ "0101 1100 1010", "1010 1101 0110", "1001 0101 0111", "0100 1010 1011", "1001 0100 1011",
+ 0x05CA, 0x0AD6, 0x0957, 0x04AB, 0x094B,
+ //* 1373 -1377 */ "1010 1010 0101", "1011 0101 0010", "1011 0110 1010", "0101 0111 0101", "0010 0111 0110",
+ 0x0AA5, 0x0B52, 0x0B6A, 0x0575, 0x0276,
+ //* 1378 -1382 */ "1000 1011 0111", "0100 0101 1011", "0101 0101 0101", "0101 1010 1001", "0101 1011 0100",
+ 0x08B7, 0x045B, 0x0555, 0x05A9, 0x05B4,
+ //* 1383 -1387 */ "1001 1101 1010", "0100 1101 1101", "0010 0110 1110", "1001 0011 0110", "1010 1010 1010",
+ 0x09DA, 0x04DD, 0x026E, 0x0936, 0x0AAA,
+ //* 1388 -1392 */ "1101 0101 0100", "1101 1011 0010", "0101 1101 0101", "0010 1101 1010", "1001 0101 1011",
+ 0x0D54, 0x0DB2, 0x05D5, 0x02DA, 0x095B,
+ //* 1393 -1397 */ "0100 1010 1011", "1010 0101 0101", "1011 0100 1001", "1011 0110 0100", "1011 0111 0001",
+ 0x04AB, 0x0A55, 0x0B49, 0x0B64, 0x0B71,
+ //* 1398 -1402 */ "0101 1011 0100", "1010 1011 0101", "1010 0101 0101", "1101 0010 0101", "1110 1001 0010",
+ 0x05B4, 0x0AB5, 0x0A55, 0x0D25, 0x0E92,
+ //* 1403 -1407 */ "1110 1100 1001", "0110 1101 0100", "1010 1110 1001", "1001 0110 1011", "0100 1010 1011",
+ 0x0EC9, 0x06D4, 0x0AE9, 0x096B, 0x04AB,
+ //* 1408 -1412 */ "1010 1001 0011", "1101 0100 1001", "1101 1010 0100", "1101 1011 0010", "1010 1011 1001",
+ 0x0A93, 0x0D49, 0x0DA4, 0x0DB2, 0x0AB9,
+ //* 1413 -1417 */ "0100 1011 1010", "1010 0101 1011", "0101 0010 1011", "1010 1001 0101", "1011 0010 1010",
+ 0x04BA, 0x0A5B, 0x052B, 0x0A95, 0x0B2A,
+ //* 1418 -1422 */ "1011 0101 0101", "0101 0101 1100", "0100 1011 1101", "0010 0011 1101", "1001 0001 1101",
+ 0x0B55, 0x055C, 0x04BD, 0x023D, 0x091D,
//* 1423 -1427 */ "1010 1001 0101", "1011 0100 1010", "1011 0101 1010", "0101 0110 1101", "0010 1011 0110",
0x0A95, 0x0B4A, 0x0B5A, 0x056D, 0x02B6,
//* 1428 -1432 */ "1001 0011 1011", "0100 1001 1011", "0110 0101 0101", "0110 1010 1001", "0111 0101 0100",
@@ -149,12 +157,38 @@ static const int UMALQURA_MONTHLENGTH[] = {
0x0497, 0x064B, 0x06A5, 0x06AC, 0x0AD6,
//* 1463 -1467 */ "0101 0101 1101", "0100 1001 1101", "1010 0100 1101", "1101 0001 0110", "1101 1001 0101",
0x055D, 0x049D, 0x0A4D, 0x0D16, 0x0D95,
- //* 1468 -1472 */ "0101 1010 1010", "0101 1011 0101", "0010 1001 1010", "1001 0101 1011", "0100 1010 1100",
- 0x05AA, 0x05B5, 0x029A, 0x095B, 0x04AC,
+ //* 1468 -1472 */ "0101 1010 1010", "0101 1011 0101", "0010 1101 1010", "1001 0101 1011", "0100 1010 1101",
+ 0x05AA, 0x05B5, 0x02DA, 0x095B, 0x04AD,
//* 1473 -1477 */ "0101 1001 0101", "0110 1100 1010", "0110 1110 0100", "1010 1110 1010", "0100 1111 0101",
0x0595, 0x06CA, 0x06E4, 0x0AEA, 0x04F5,
- //* 1478 -1480 */ "0010 1011 0110", "1001 0101 0110", "1010 1010 1010"
- 0x02B6, 0x0956, 0x0AAA
+ //* 1478 -1482 */ "0010 1011 0110", "1001 0101 0110", "1010 1010 1010", "1011 0101 0100", "1011 1101 0010",
+ 0x02B6, 0x0956, 0x0AAA, 0x0B54, 0x0BD2,
+ //* 1483 -1487 */ "0101 1101 1001", "0010 1110 1010", "1001 0110 1101", "0100 1010 1101", "1010 1001 0101",
+ 0x05D9, 0x02EA, 0x096D, 0x04AD, 0x0A95,
+ //* 1488 -1492 */ "1011 0100 1010", "1011 1010 0101", "0101 1011 0010", "1001 1011 0101", "0100 1101 0110",
+ 0x0B4A, 0x0BA5, 0x05B2, 0x09B5, 0x04D6,
+ //* 1493 -1497 */ "1010 1001 0111", "0101 0100 0111", "0110 1001 0011", "0111 0100 1001", "1011 0101 0101",
+ 0x0A97, 0x0547, 0x0693, 0x0749, 0x0B55,
+ //* 1498 -1508 */ "0101 0110 1010", "1010 0110 1011", "0101 0010 1011", "1010 1000 1011", "1101 0100 0110", "1101 1010 0011", "0101 1100 1010", "1010 1101 0110", "0100 1101 1011", "0010 0110 1011", "1001 0100 1011",
+ 0x056A, 0x0A6B, 0x052B, 0x0A8B, 0x0D46, 0x0DA3, 0x05CA, 0x0AD6, 0x04DB, 0x026B, 0x094B,
+ //* 1509 -1519 */ "1010 1010 0101", "1011 0101 0010", "1011 0110 1001", "0101 0111 0101", "0001 0111 0110", "1000 1011 0111", "0010 0101 1011", "0101 0010 1011", "0101 0110 0101", "0101 1011 0100", "1001 1101 1010",
+ 0x0AA5, 0x0B52, 0x0B69, 0x0575, 0x0176, 0x08B7, 0x025B, 0x052B, 0x0565, 0x05B4, 0x09DA,
+ //* 1520 -1530 */ "0100 1110 1101", "0001 0110 1101", "1000 1011 0110", "1010 1010 0110", "1101 0101 0010", "1101 1010 1001", "0101 1101 0100", "1010 1101 1010", "1001 0101 1011", "0100 1010 1011", "0110 0101 0011",
+ 0x04ED, 0x016D, 0x08B6, 0x0AA6, 0x0D52, 0x0DA9, 0x05D4, 0x0ADA, 0x095B, 0x04AB, 0x0653,
+ //* 1531 -1541 */ "0111 0010 1001", "0111 0110 0010", "1011 1010 1001", "0101 1011 0010", "1010 1011 0101", "0101 0101 0101", "1011 0010 0101", "1101 1001 0010", "1110 1100 1001", "0110 1101 0010", "1010 1110 1001",
+ 0x0729, 0x0762, 0x0BA9, 0x05B2, 0x0AB5, 0x0555, 0x0B25, 0x0D92, 0x0EC9, 0x06D2, 0x0AE9,
+ //* 1542 -1552 */ "0101 0110 1011", "0100 1010 1011", "1010 0101 0101", "1101 0010 1001", "1101 0101 0100", "1101 1010 1010", "1001 1011 0101", "0100 1011 1010", "1010 0011 1011", "0100 1001 1011", "1010 0100 1101",
+ 0x056B, 0x04AB, 0x0A55, 0x0D29, 0x0D54, 0x0DAA, 0x09B5, 0x04BA, 0x0A3B, 0x049B, 0x0A4D,
+ //* 1553 -1563 */ "1010 1010 1010", "1010 1101 0101", "0010 1101 1010", "1001 0101 1101", "0100 0101 1110", "1010 0010 1110", "1100 1001 1010", "1101 0101 0101", "0110 1011 0010", "0110 1011 1001", "0100 1011 1010",
+ 0x0AAA, 0x0AD5, 0x02DA, 0x095D, 0x045E, 0x0A2E, 0x0C9A, 0x0D55, 0x06B2, 0x06B9, 0x04BA,
+ //* 1564 -1574 */ "1010 0101 1101", "0101 0010 1101", "1010 1001 0101", "1011 0101 0010", "1011 1010 1000", "1011 1011 0100", "0101 1011 1001", "0010 1101 1010", "1001 0101 1010", "1011 0100 1010", "1101 1010 0100",
+ 0x0A5D, 0x052D, 0x0A95, 0x0B52, 0x0BA8, 0x0BB4, 0x05B9, 0x02DA, 0x095A, 0x0B4A, 0x0DA4,
+ //* 1575 -1585 */ "1110 1101 0001", "0110 1110 1000", "1011 0110 1010", "0101 0110 1101", "0101 0011 0101", "0110 1001 0101", "1101 0100 1010", "1101 1010 1000", "1101 1101 0100", "0110 1101 1010", "0101 0101 1011",
+ 0x0ED1, 0x06E8, 0x0B6A, 0x056D, 0x0535, 0x0695, 0x0D4A, 0x0DA8, 0x0DD4, 0x06DA, 0x055B,
+ //* 1586 -1596 */ "0010 1001 1101", "0110 0010 1011", "1011 0001 0101", "1011 0100 1010", "1011 1001 0101", "0101 1010 1010", "1010 1010 1110", "1001 0010 1110", "1100 1000 1111", "0101 0010 0111", "0110 1001 0101",
+ 0x029D, 0x062B, 0x0B15, 0x0B4A, 0x0B95, 0x05AA, 0x0AAE, 0x092E, 0x0C8F, 0x0527, 0x0695,
+ //* 1597 -1600 */ "0110 1010 1010", "1010 1101 0110", "0101 0101 1101", "0010 1001 1101", };
+ 0x06AA, 0x0AD6, 0x055D, 0x029D
};
int32_t getUmalqura_MonthLength(int32_t y, int32_t m) {
@@ -298,7 +332,7 @@ UBool IslamicCalendar::civilLeapYear(int32_t year)
*/
int32_t IslamicCalendar::yearStart(int32_t year) const{
if (cType == CIVIL || cType == TBLA ||
- (cType == UMALQURA && year < UMALQURA_YEAR_START))
+ (cType == UMALQURA && (year < UMALQURA_YEAR_START || year > UMALQURA_YEAR_END)))
{
return (year-1)*354 + ClockMath::floorDivide((3+11*year),30);
} else if(cType==ASTRONOMICAL){
@@ -318,10 +352,11 @@ int32_t IslamicCalendar::yearStart(int32_t year) const{
* from the Hijri epoch, origin 0.
*
* @param year The hijri year
-* @param year The hijri month, 0-based
+* @param year The hijri month, 0-based (assumed to be in range 0..11)
*/
int32_t IslamicCalendar::monthStart(int32_t year, int32_t month) const {
if (cType == CIVIL || cType == TBLA) {
+ // This does not handle months out of the range 0..11
return (int32_t)uprv_ceil(29.5*month)
+ (year-1)*354 + (int32_t)ClockMath::floorDivide((3+11*year),30);
} else if(cType==ASTRONOMICAL){
@@ -467,8 +502,9 @@ int32_t IslamicCalendar::handleGetYearLength(int32_t extendedYear) const {
return (trueMonthStart(month + 12) - trueMonthStart(month));
} else {
int len = 0;
- for(int i=0; i<12; i++)
+ for(int i=0; i<12; i++) {
len += handleGetMonthLength(extendedYear, i);
+ }
return len;
}
}
@@ -478,11 +514,25 @@ int32_t IslamicCalendar::handleGetYearLength(int32_t extendedYear) const {
//-------------------------------------------------------------------------
// Return JD of start of given month/year
+// Calendar says:
+// Get the Julian day of the day BEFORE the start of this year.
+// If useMonth is true, get the day before the start of the month.
+// Hence the -1
/**
* @draft ICU 2.4
*/
int32_t IslamicCalendar::handleComputeMonthStart(int32_t eyear, int32_t month, UBool /* useMonth */) const {
- return monthStart(eyear, month) + 1948439;
+ // This may be called by Calendar::handleComputeJulianDay with months out of the range
+ // 0..11. Need to handle that here since monthStart requires months in the range 0.11.
+ if (month > 11) {
+ eyear += (month / 12);
+ month %= 12;
+ } else if (month < 0) {
+ month++;
+ eyear += (month / 12) - 1;
+ month = (month % 12) + 11;
+ }
+ return monthStart(eyear, month) + ((cType == TBLA)? ASTRONOMICAL_EPOC: CIVIL_EPOC) - 1;
}
//-------------------------------------------------------------------------
@@ -520,12 +570,13 @@ int32_t IslamicCalendar::handleGetExtendedYear() {
*/
void IslamicCalendar::handleComputeFields(int32_t julianDay, UErrorCode &status) {
int32_t year, month, dayOfMonth, dayOfYear;
- UDate startDate;
+ int32_t startDate;
int32_t days = julianDay - CIVIL_EPOC;
if (cType == CIVIL || cType == TBLA) {
- if(cType == TBLA)
+ if(cType == TBLA) {
days = julianDay - ASTRONOMICAL_EPOC;
+ }
// Use the civil calendar approximation, which is just arithmetic
year = (int)ClockMath::floorDivide( (double)(30 * days + 10646) , 10631.0 );
month = (int32_t)uprv_ceil((days - 29 - yearStart(year)) / 29.5 );
@@ -535,7 +586,7 @@ void IslamicCalendar::handleComputeFields(int32_t julianDay, UErrorCode &status)
// Guess at the number of elapsed full months since the epoch
int32_t months = (int32_t)uprv_floor((double)days / CalendarAstronomer::SYNODIC_MONTH);
- startDate = uprv_floor(months * CalendarAstronomer::SYNODIC_MONTH);
+ startDate = (int32_t)uprv_floor(months * CalendarAstronomer::SYNODIC_MONTH);
double age = moonAge(internalGetTime(), status);
if (U_FAILURE(status)) {
@@ -595,7 +646,7 @@ void IslamicCalendar::handleComputeFields(int32_t julianDay, UErrorCode &status)
dayOfMonth = (days - monthStart(year, month)) + 1;
// Now figure out the day of the year.
- dayOfYear = (days - monthStart(year, 0) + 1);
+ dayOfYear = (days - monthStart(year, 0)) + 1;
internalSet(UCAL_ERA, 0);
@@ -610,7 +661,7 @@ UBool
IslamicCalendar::inDaylightTime(UErrorCode& status) const
{
// copied from GregorianCalendar
- if (U_FAILURE(status) || (&(getTimeZone()) == NULL && !getTimeZone().useDaylightTime()))
+ if (U_FAILURE(status) || !getTimeZone().useDaylightTime())
return FALSE;
// Force an update of the state of the Calendar.
« no previous file with comments | « source/i18n/indiancal.cpp ('k') | source/i18n/locdspnm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698