diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-15 11:29:30 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-15 11:29:30 -0300 |
commit | 8f961da3dbf8c45389d1431e6dff8e44e41f1a57 (patch) | |
tree | ee67fa31c29eab0569c35c62b17f43092f60d940 /llimits.h | |
parent | 5c46b7b8cf3a71cce5572b1fca84542e24723efd (diff) | |
download | lua-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.h | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 | /* |