Large switch statements have been replaced by data-driven array lookups to reduce the amount of code generated and also improve performance. Using DMD 2.056 on OSX x86 this cuts 12KB off of a Hello World program.
The motivation for this change is to try and reduce the size of small D programs as their large size is a common (and valid) complaint amongst newcomers.
The pragmas have not been as effective as we might have liked, since
they only work with templates and can't tell you where in your code you
need to make changes, and they seemed to have been more annoying to
programmers than helpful, so we're going to discontinue them. We'll
leave them in for stuff that's actually been deprecated until deprecated
has been improved enough to take a message, but we'll leave "scheduled
for deprecation" messages to the documentation and changelog.
1. I fixed some issues surrounding DST switches and added much more
thorough unit tests for testing what happens when a DST switch occurs.
2. I also added utcOffsetAt to TimeZone and utcOffset to SysTime to give
the total UTC offset at a specific time.
3. And last but not least, since the unit tests seem to no longer cause
dmd to run out of memory on Windows, std.datetime's unit tests have been
enabled on Windows.
This also fixes Bug# 6181: http://d.puremagic.com/issues/show_bug.cgi?id=6181
Remove use of deprecated typedef from phobos. This mostly consists of changing typedef to alias, and disabling unittests that require typedef. One change to std.registry is needed to work around a bug in typedef (6571).
Before, it wasn't possible to have negative FracSecs (which worked great
for SysTime but not so well for Duration). Now, in order to fix
Duration, negative FracSecs are possible, so SysTime has been changed to
throw if it's given a negative FracSec.
endOfMonthDay is too close to endOfMonth, and std.date had daysInMonth
(which amounts to the same thing), so I'm renaming endOfMonthDay to
daysInMonth. So, endOfMonthDay is now scheduled for deprecation. I also
adjusted the various deprecation messages related to std.datetime so
that they included the month when the items in question would be deprecated.
http://d.puremagic.com/issues/show_bug.cgi?id=5781
Unfortunately, _all_ of the unit tests are now disabled on Windows
(instead of just most of them). Issue #5454 seems to be worse at present.
Hopefully Don's changes to CTFE will help.
toISOExtendedString is annoyingly long - albeit wonderfully accurate -
and toISOExtString seems accurate enough and enough shorter to be worth
the switch. The old names are scheduled to be deprecated.
putenv actually keeps a pointer to the string that it's passed, which
setTZEnvVar didn't take into account, so putenv risked having an invalid
pointer as soon as a garbage collection cycle was run. This is an
example of a bug that's easier to find in C++. The inderministic nature
of garbage collection makes it much more insidious. But it's the kind of
thing that's really only going to happen when interacting with code that
isn't D code.
http://d.puremagic.com/issues/show_bug.cgi?id=5761
A subtle math error involving leap years caused Dec-30 and Dec-31 of A.D.
leap years and Jan-01 and Jan-02 of B.C. leap years to be off by one day.
The revised tests catch the bug.
They tests that were changed are a bit scattered, because I was trying
to pick the tests that were related to the test failure in SysTime's day
getter property (which is a manifestation of bug# 5761).