Re: Algorithm to exploit 32 bit time functions to do time zone calculations
Thorsten Glaser <[email protected]> Wed, 17 Sep 2008 20:01:11 +0000 (UTC)
| Newsgroups | gmane.os.miros.general,gmane.comp.lib.libtai |
|---|---|
| Message-ID | <[email protected]> |
Michael G Schwern dixit: >That said, I do recognize that a lot of my work will boil down to just doi= ng a >search and replace for "time_t" with "Time64_T" and "int" with "Int64_T". Ah. The trick with my implementation is, to change =E2=80=9Cint=E2=80=9D an= d =E2=80=9Clong=E2=80=9D to =E2=80=9Ctime_t=E2=80=9D instead *ONLY* where it is neccessary, and leave t= he remaining narrow integer types alone. In some places, I use int64_t or uint64_t for casts, for either clarity, simplicity or portability, but mostly, I stuck with time_t, as it=E2=80=99s 32-bit on the sparc platform, 64-bit o= n the i386 platform with MirBSD. I wanted to avoid switching EVERY integer type to 64 bit even where not needed, as that can be much slower and is much bigger. bye, //mirabilos --=20 Sometimes they [people] care too much: pretty printers [and syntax highligh= - ting, d.A.] mechanically produce pretty output that accentuates irrelevant detail in the program, which is as sensible as putting all the prepositions in English text in bold font.=09-- Rob Pike in "Notes on Programming in C"