summaryrefslogtreecommitdiff
path: root/llimits.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-05-29 11:04:15 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-05-29 11:04:15 -0300
commitfc083f1138c9e78b460445da03d9a37d42e9cd9d (patch)
tree30c32a7f5611c6cbca98a42493a4ad23fc2430e4 /llimits.h
parentee865b9fe768195bb81abec0cbc85136526e6894 (diff)
downloadlua-github-fc083f1138c9e78b460445da03d9a37d42e9cd9d.tar.gz
removed all tricks for conversions + 'luai_hashnum' moved to ltable.c
Diffstat (limited to 'llimits.h')
-rw-r--r--llimits.h44
1 files changed, 1 insertions, 43 deletions
diff --git a/llimits.h b/llimits.h
index 04405019..86af8cfb 100644
--- a/llimits.h
+++ b/llimits.h
@@ -1,5 +1,5 @@
/*
-** $Id: llimits.h,v 1.105 2013/05/23 21:27:06 roberto Exp roberto $
+** $Id: llimits.h,v 1.106 2013/05/27 12:43:37 roberto Exp roberto $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -198,48 +198,6 @@ typedef lu_int32 Instruction;
#define luai_userstateyield(L,n) ((void)L)
#endif
-/*
-** lua_number2int is a macro to convert lua_Number to int.
-** lua_number2integer is a macro to convert lua_Number to lua_Integer.
-** lua_number2unsigned is a macro to convert a lua_Number to a lua_Unsigned.
-** lua_unsigned2number is a macro to convert a lua_Unsigned to a lua_Number.
-** luai_hashnum is a macro to hash a lua_Number value into an integer.
-** The hash must be deterministic and give reasonable values for
-** both small and large values (outside the range of integers).
-*/
-
-#if !defined(lua_number2int)
-#define lua_number2int(i,n) ((i)=(int)(n))
-#endif
-
-#if !defined(lua_number2integer)
-#define lua_number2integer(i,n) ((i)=(lua_Integer)(n))
-#endif
-
-#if !defined(lua_number2unsigned) /* { */
-/* the following definition assures proper modulo behavior */
-#if defined(LUA_NUMBER_DOUBLE) || defined(LUA_NUMBER_FLOAT)
-#include <math.h>
-#define SUPUNSIGNED ((lua_Number)(~(lua_Unsigned)0) + 1)
-#define lua_number2unsigned(i,n) \
- ((i)=(lua_Unsigned)((n) - floor((n)/SUPUNSIGNED)*SUPUNSIGNED))
-#else
-#define lua_number2unsigned(i,n) ((i)=(lua_Unsigned)(n))
-#endif
-#endif /* } */
-
-
-#if defined(ltable_c) && !defined(luai_hashnum)
-
-#include <float.h>
-#include <math.h>
-
-#define luai_hashnum(i,n) { int e; \
- n = l_mathop(frexp)(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \
- lua_number2int(i, n); i += e; }
-
-#endif
-
/*