DMD 0.153 release

Stewart Gordon smjg_1998 at yahoo.com
Sun Apr 16 06:40:47 PDT 2006


Walter Bright wrote:
> Stewart Gordon wrote:
<snip>
>> What you've done here makes no sense to me.  Why is abusing the d_time 
>> type necessary to prevent an overflow?  I.e. how does any of the 
>> following:
>>
>> - making the parameters long, considering that d_time is an alias of 
>> long anyway
>> - casting the ints to longs within the function
>> - making TicksPerHour et al long
>>
>> still lead to an overflow?
> 
> Because sometimes very large values are passed to these functions. I 
> have a test app that does that.

But what is the practical use of being able to pass such huge arguments 
as the day or month?

Still, people are no doubt already confused by the idea that you're 
supposed to pass a number of milliseconds since 1970 as the year, month, 
day, hour, minute, second or millisecond component when constructing a 
date/time.  At least, these parameters should be long rather than 
d_time.  Unless I'm missing something then there's nothing to lose, and 
some sanity in the code (and eventual documentation) to gain.

Stewart.



More information about the Digitalmars-d-announce mailing list