Pending mac vm 3.2.6
John M McIntosh
johnmci at smalltalkconsulting.com
Wed Mar 13 02:56:01 UTC 2002
I realize the mac VM for 3.2.5 is broken for users that require
characters over ascii 127. All the accented characters I believe.
Note some bright Squeaker might have a Smalltalk fix for this issue
which could be applied to EventSensor (hint the character 16rCD is
coming up from the VM as 16rFFFFFCD a negative 32bit integer). I'll
leave the code as an exercise to the reader.
I was awaiting confirmation about my code fix for the problem, and
this also which the font issue mentioned in my other note. Also I'd
really like to kill the issue with time that
jean-marie.zajac at laposte.net raised.
So bare with me for another day.
jean-marie.zajac
In the mac menu bar he has 17:52pm
he execute this code
| totalSeconds now secondsForToday |
totalSeconds _ Time totalSeconds.
now _ Time now.
secondsForToday _ Time fromSeconds: totalSeconds \\ 86400.
Transcript space;show: totalSeconds printString;space;
show: now printString;space;
show: secondsForToday printString;space;
show: secondsForToday asSeconds
and we get in the transcript
3193405337 5:02:17 pm 5:02:17 pm 61337
Mmm if some bright unix hacker (old or young) can understand why this
piece of ancient squeak platform code doesn't work as expected,
please chip in
int ioSeconds(void) {
struct tm timeRec;
time_t time1904, timeNow;
/* start of ANSI epoch is midnight of Jan 1, 1904 */
timeRec.tm_sec = 0;
timeRec.tm_min = 0;
timeRec.tm_hour = 0;
timeRec.tm_mday = 1;
timeRec.tm_mon = 0;
timeRec.tm_year = 4;
timeRec.tm_wday = 0;
timeRec.tm_yday = 0;
timeRec.tm_isdst = 0;
time1904 = mktime(&timeRec);
timeNow = time(NULL);
/* Squeak epoch is Jan 1, 1901, 3 non-leap years earlier than
ANSI one */
return (timeNow - time1904) + (3 * 365 * 24 * 60 * 60);
}
mmm Bet I could get rid of that mktime call everytime we do this call eh?
Yes the Unix code is different, but won't compile on the mac, and where does
my 50 minutes go (3000 seconds, an interesting number to be sure).
--
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================
More information about the Squeak-dev
mailing list
|