[BUG][FIX] primSecondsClock ( sqWin32Directory.c -- Windows only)

John Clonts jclonts at mastnet.net
Thu Mar 2 21:06:39 UTC 2000


Jesse Welton wrote:
> 
> John Clonts wrote:
> >
> > The bug is in
> >
> >    convertToSqueakTime()
> >
> > The fix is to replace
> >
> >    if(st.wMonth > 2 && (dy & 0x0003) == 0)  // line 24
> >
> > with
> >
> >    if(st.wMonth > 2 && (++dy & 0x0003) == 0)  // line 24
> 
> I'm finding (on Windows 98) that Squeak gives me the correct date for
> all days up until 2000-02-29, and a date one day too early for all
> days thereafter.

Yes.  That is the problem that I am having, and that this fix corrects.

>  I therefore believe that simply incrementing the day
> will cause Squeak to give incorrect dates for all days prior to
> 2000-03-01, which is certainly not what we're after.
> 

My one-line summary is misleading you, I think, if you're interpreting
++dy to be "incrementing the day".  See the entire function
convertToSqueakTime(), to realize dy ("delta years") = current year -
1901.

> I can't tell precisely where or what the fix should be, but I see that
> Squeak is still distressingly weak in the date department, compared to
> what it should be capable of.  Even if the immediate case is fixed, it
> still won't work past 2099.  So much for "Smalltalk: Guaranteed Y10k
> Compatible".
> 

I wouldn't call it "distressingly weak" :)

Cheers,
John





More information about the Squeak-dev mailing list