aboutsummaryrefslogtreecommitdiff
path: root/llimits.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-04-15 11:29:30 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-04-15 11:29:30 -0300
commit8f961da3dbf8c45389d1431e6dff8e44e41f1a57 (patch)
treeee67fa31c29eab0569c35c62b17f43092f60d940 /llimits.h
parent5c46b7b8cf3a71cce5572b1fca84542e24723efd (diff)
downloadlua-8f961da3dbf8c45389d1431e6dff8e44e41f1a57.tar.gz
lua-8f961da3dbf8c45389d1431e6dff8e44e41f1a57.tar.bz2
lua-8f961da3dbf8c45389d1431e6dff8e44e41f1a57.zip
macros cast_integer/cast_unsigned replaced by cast_u2s/cast_s2u, that
should be used only between lua_Integer and lua_Unsigned
Diffstat (limited to 'llimits.h')
-rw-r--r--llimits.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/llimits.h b/llimits.h
index 1286ddba..0feba1d9 100644
--- a/llimits.h
+++ b/llimits.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llimits.h,v 1.113 2014/04/11 19:56:04 roberto Exp roberto $ 2** $Id: llimits.h,v 1.114 2014/04/12 14:45:10 roberto Exp roberto $
3** Limits, basic types, and some other `installation-dependent' definitions 3** Limits, basic types, and some other `installation-dependent' definitions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -105,8 +105,17 @@ typedef LUAI_UACINT l_uacInt;
105#define cast_num(i) cast(lua_Number, (i)) 105#define cast_num(i) cast(lua_Number, (i))
106#define cast_int(i) cast(int, (i)) 106#define cast_int(i) cast(int, (i))
107#define cast_uchar(i) cast(unsigned char, (i)) 107#define cast_uchar(i) cast(unsigned char, (i))
108#define cast_integer(i) cast(lua_Integer, (i)) 108
109#define cast_unsigned(i) cast(lua_Unsigned, (i)) 109
110/*
111** cast a lua_Unsigned to a signed lua_Integer; this cast is
112** not strict ANSI C, but two-complement architectures should
113** work fine.
114*/
115#define cast_u2s(i) ((lua_Integer)(i))
116
117/* cast a signed lua_Integer to lua_Unsigned */
118#define cast_s2u(i) ((lua_Unsigned)(i))
110 119
111 120
112/* 121/*