Commit graph

79 commits

Author SHA1 Message Date
Peter Alexander
88ad91f47a Size optimisation of std.datetime (saves 12KB)
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.
2011-12-01 21:13:16 +00:00
simendsjo
fdca5dde0d Bug 4414 has been fixed 2011-11-06 17:01:17 +01:00
dawg
f37038c586 spurious variable in StopWatch.start 2011-10-30 21:19:48 +01:00
jmdavis
256976dddd Removed "scheduled for deprecation" pragmas.
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.
2011-10-23 23:11:17 -07:00
jmdavis
1d9e802a77 Updated link to TZ Database. 2011-10-19 20:25:48 -07:00
Walter Bright
a83c651411 remove redundant 'you' from documentation 2011-10-08 13:13:29 -07:00
jmdavis
fba52fbeba Added link to "Introduction to std.datetime" to std.datetime. 2011-10-06 23:52:19 -07:00
k-hara
cce3e38388 Use new std.windows.registry in std.datetime. 2011-10-03 03:34:41 +09:00
jmdavis
429f5b4155 Disabled some locale-dependent tests in std.datetime. 2011-09-30 23:59:05 -07:00
jmdavis
824f441382 Temporarily disable test so that tests pass on FreeBSD. 2011-09-26 02:05:28 -07:00
jmdavis
d087bac970 Fixed DST issues in std.datetime.
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
2011-09-17 16:51:41 -07:00
Daniel Murphy
1590a5cc38 Issue 6572 - Deprecate typedef
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).
2011-08-30 13:22:10 +10:00
k-hara
0a136cc44c Additional fix for 6546 2011-08-24 11:55:37 +09:00
k-hara
5395df09c2 Remove std.datetime.DTRebindable 2011-08-24 11:55:36 +09:00
Lars T. Kyllingstad
ff4fb88db7 Update std.datetime and std.file for new std.path 2011-08-18 08:30:22 +02:00
jmdavis
80975d1088 Fixed std.datetime to use the new endian swapping functions 2011-08-14 17:51:07 -07:00
Andrei Alexandrescu
537c59c79e Merge pull request #178 from jmdavis/deprecation
Deprecated stuff which was scheduled to be deprecated in August 2011.
2011-08-14 11:04:21 -07:00
Andrei Alexandrescu
d1adcfcd23 Merge pull request #188 from venix1/master
GDC Win64 patch for Phobos2
2011-08-13 20:51:16 -07:00
Daniel Green
dcbfae3364 Merge GDC Win64 changes. 2011-08-14 00:52:10 -04:00
jmdavis
0ec7697819 Fixed enum values in std.traits to follow Phobos naming conventions. 2011-08-13 00:14:13 -07:00
jmdavis
db5051a5af Changed "Warning" to "Notice" in deprecation messages.
Hopefully, they don't get confused with compiler warnings this way.
2011-08-09 00:39:27 -07:00
jmdavis
28ccdeb8dd Deprecated old date/time stuff. 2011-08-09 00:22:39 -07:00
jmdavis
2c62451020 Fixed uses of TABLE in std.datetime so that they don't double up anymore. 2011-07-27 23:27:32 -07:00
jmdavis
9fcaa2c187 Adjusted SysTime to properly deal with negative FracSec values.
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.
2011-07-10 03:04:30 -07:00
jmdavis
302323559a Revert "not really pure"
This reverts commit 4f28db6ffb.

Since Walter put weakly pure back in, these changes need to be undone.

Conflicts:

	std/datetime.d
2011-07-07 01:40:07 -07:00
jmdavis
09b7cf618b Adjusting deprecation dates for a July release. 2011-07-04 01:46:26 -07:00
Jonathan M Davis
da0fd9dbf8 Merge pull request #101 from jmdavis/string
Improvements for std.string, std.uni, and std.ctype.
2011-07-03 00:12:57 -07:00
jmdavis
88c829ca7f Merge branch 'master' into string 2011-06-29 21:25:39 -07:00
jmdavis
e3a592b126 Merged latest master into branch with std.datetime changes.
Conflicts:
	std/datetime.d
2011-06-26 21:14:16 -07:00
Walter Bright
bb53c94eb5 safe function isn't safe 2011-06-26 20:41:03 -07:00
Walter Bright
4f28db6ffb not really pure 2011-06-25 19:58:09 -07:00
jmdavis
a6ef12b6c9 Renamed endOfMonthDay to daysInMonth.
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.
2011-06-25 09:03:48 -07:00
jmdavis
dd3a0c20a2 Created std.ascii to replace std.ctype.
All of the new, properly camelcased functions in std.ctype have been
moved to std.ascii, and std.ctype has been scheduled for deprecation.
2011-06-14 04:06:54 -07:00
jmdavis
654f35a677 Replaced calls to std.string and std.ctype's tolower with their toLower counterparts. 2011-06-12 16:59:52 -07:00
jmdavis
19ae2b4998 Replace calls to std.ctype.isdigt with std.ctype.isDigit. 2011-06-12 16:59:51 -07:00
jmdavis
ba7d70b858 Fix for issue 6113.
I really should have made those static constructors shared in the first
place, since immutable class and global variables are implicitly shared.
2011-06-05 23:23:10 -07:00
jmdavis
3b628aeb50 Fix to get around issue# 6013. 2011-05-15 19:18:01 -07:00
jmdavis
cf497ec89a Made a public alias private like it should have been in the first place. 2011-05-15 04:06:28 -07:00
jmdavis
1077af7e27 Fixed a typo in my fix for typos. :( 2011-05-10 19:18:33 -07:00
jmdavis
a7d5e3889e Fixed some typos in std.datetime's documentation. 2011-05-10 19:15:11 -07:00
jmdavis
fa8aa916d1 A couple of fixes from Andrei's suggestions. 2011-04-25 00:07:48 -07:00
jmdavis
4f27ab5227 Some formatting changes. 2011-04-19 00:40:45 -07:00
jmdavis
ac392c58be Fix for Issue# 5781.
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.
2011-04-18 23:33:59 -07:00
jmdavis
218b3f9bc4 A few documentation adjustments. 2011-04-08 22:51:27 -07:00
jmdavis
09483e8af6 Renamed to/fromISOExtendedString to to/fromISOExtString.
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.
2011-04-08 22:44:00 -07:00
jmdavis
8e4b25d66e Fix Issue# 5794.
Some documentation fixes for StopWatch and benchmark. I reworked some of
the code as well.

http://d.puremagic.com/issues/show_bug.cgi?id=5794
2011-04-06 01:17:20 -07:00
jmdavis
a08e625bad Fixed bug in setTZEnvVar.
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.
2011-04-02 06:13:32 -07:00
jmdavis
cd3a97c0f6 More improvements to std.datetime's unit tests. 2011-04-02 05:08:03 -07:00
jmdavis
a34673cc82 Fix for bug# 5761.
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.
2011-03-26 16:29:28 -07:00
jmdavis
5e9b52a149 More adjustments to std.datetime's unit tests.
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).
2011-03-26 16:29:28 -07:00