From 112c9d53ab47e77fd09d4ecb9b11d432ed906c88 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 18 Jun 1998 13:52:04 -0300 Subject: new version by lhf --- lundump.h | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'lundump.h') diff --git a/lundump.h b/lundump.h index 7e5b286c..d9bc8668 100644 --- a/lundump.h +++ b/lundump.h @@ -1,5 +1,5 @@ /* -** $Id: lundump.h,v 1.5 1998/02/06 20:05:39 lhf Exp lhf $ +** $Id: lundump.h,v 1.6 1998/06/13 16:54:15 lhf Exp $ ** load pre-compiled Lua chunks ** See Copyright Notice in lua.h */ @@ -22,32 +22,36 @@ TProtoFunc* luaU_undump1(ZIO* Z); /* load one chunk */ #define ID_STR 'S' #define ID_FUN 'F' -#define ID_INT4 'l' -#define ID_REAL4 'f' -#define ID_REAL8 'd' -#define ID_NATIVE '?' +/* number representation */ +#define ID_INT4 'l' /* 4-byte integers */ +#define ID_REAL4 'f' /* 4-byte reals */ +#define ID_REAL8 'd' /* 8-byte reals */ +#define ID_NATIVE '?' /* whatever your machine uses */ /* * use a multiple of PI for testing number representation. -* multiplying by 10E8 gives notrivial integer values. +* multiplying by 1E8 gives notrivial integer values. */ #define TEST_NUMBER 3.14159265358979323846E8 -/* LUA_NUMBER */ -/* if you change the definition of real, make sure you set ID_NUMBER -* accordingly, specially if sizeof(long)!=4. +/* LUA_NUMBER +* choose one below for the number representation in precompiled chunks. +* the default is ID_REAL8 because the default for LUA_NUM_TYPE is double. +* if your machine does not use IEEE 754, use ID_NATIVE. +* the next version will support conversion to/from IEEE 754. +* +* if you change LUA_NUM_TYPE, make sure you set ID_NUMBER accordingly, +* specially if sizeof(long)!=4. * for types other than the ones listed below, you'll have to write your own * dump and undump routines. */ -#if real==float - #define ID_NUMBER ID_REAL4 -#elif real==double - #define ID_NUMBER ID_REAL8 -#elif real==long - #define ID_NUMBER ID_INT4 -#else - #define ID_NUMBER ID_NATIVE +#define ID_NUMBER ID_REAL8 + +#if 0 +#define ID_NUMBER ID_REAL4 +#define ID_NUMBER ID_INT4 +#define ID_NUMBER ID_NATIVE #endif #endif -- cgit v1.2.3-55-g6feb