diff options
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 | /* |