diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-07-13 13:06:31 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-07-13 13:06:31 (GMT) |
| commit | 6abb3012d4a69c475e76e779b90400ec16d75cef (patch) | |
| tree | af53162be96d78aebb3302888e21a19a8bac027e /generic/tclClock.c | |
| parent | d5259dab0165d9c7445e14676e009bb55213aace (diff) | |
| parent | a5748bcfeaed4a02c8b11829a0ea0a13dceb8ff9 (diff) | |
| download | tcl-6abb3012d4a69c475e76e779b90400ec16d75cef.zip tcl-6abb3012d4a69c475e76e779b90400ec16d75cef.tar.gz tcl-6abb3012d4a69c475e76e779b90400ec16d75cef.tar.bz2 | |
Merge novem
Diffstat (limited to 'generic/tclClock.c')
| -rw-r--r-- | generic/tclClock.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index fb97b9c..73f3416 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -1499,7 +1499,19 @@ GetJulianDayFromEraYearMonthDay( * Try an initial conversion in the Gregorian calendar. */ +#if 0 /* BUG http://core.tcl.tk/tcl/tktview?name=da340d4f32 */ ym1o4 = ym1 / 4; +#else + /* + * Have to make sure quotient is truncated towards 0 when negative. + * See above bug for details. The casts are necessary. + */ + if (ym1 >= 0) + ym1o4 = ym1 / 4; + else { + ym1o4 = - (int) (((unsigned int) -ym1) / 4); + } +#endif if (ym1 % 4 < 0) { ym1o4--; } |
