lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Okay, thanks. I'll make some safety code around there, using sizeof (time_t) and sizeof(int).

-asko


Mike Pall kirjoitti 11.1.2006 kello 18.46:

Hi,

Asko Kauppi wrote:
Lua 5.1 beta still uses "pushNumber" in the os.time() function, but
as far as I know, any 'time_t' is always an integer, albeit the
interpretation of that value may differ. Is this right?

time_t is always an integral value, but not necessarily an 'int'
and not necessarily 32 bits. It's an int64 on many (but not all)
64 bit systems (but int is still 32 bits there!). Even some 32 bit
systems have switched to int64 (e.g. MSVC8) and others will follow.

If so, the return of os.time() should imho use "pushInteger()" [...]

Nope. This would truncate time_t to an int. See above.

Bye,
     Mike