diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-15 13:32:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-15 13:32:49 -0300 |
commit | 037a70dfea9de66e8d27c8d3ce2ed9f159a1b094 (patch) | |
tree | a31c77b6da44e543a1ec01f916e31d99fb64b238 /llimits.h | |
parent | 8f961da3dbf8c45389d1431e6dff8e44e41f1a57 (diff) | |
download | lua-037a70dfea9de66e8d27c8d3ce2ed9f159a1b094.tar.gz lua-037a70dfea9de66e8d27c8d3ce2ed9f159a1b094.tar.bz2 lua-037a70dfea9de66e8d27c8d3ce2ed9f159a1b094.zip |
cast_u2s/cast_s2u renamed l_castS2U/l_castU2S to be configurable from
outside (mostly for testing)
Diffstat (limited to 'llimits.h')
-rw-r--r-- | llimits.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.114 2014/04/12 14:45:10 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.115 2014/04/15 14:28:20 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 | */ |
@@ -107,15 +107,19 @@ typedef LUAI_UACINT l_uacInt; | |||
107 | #define cast_uchar(i) cast(unsigned char, (i)) | 107 | #define cast_uchar(i) cast(unsigned char, (i)) |
108 | 108 | ||
109 | 109 | ||
110 | /* cast a signed lua_Integer to lua_Unsigned */ | ||
111 | #if !defined(l_castS2U) | ||
112 | #define l_castS2U(i) ((lua_Unsigned)(i)) | ||
113 | #endif | ||
114 | |||
110 | /* | 115 | /* |
111 | ** cast a lua_Unsigned to a signed lua_Integer; this cast is | 116 | ** cast a lua_Unsigned to a signed lua_Integer; this cast is |
112 | ** not strict ANSI C, but two-complement architectures should | 117 | ** not strict ANSI C, but two-complement architectures should |
113 | ** work fine. | 118 | ** work fine. |
114 | */ | 119 | */ |
115 | #define cast_u2s(i) ((lua_Integer)(i)) | 120 | #if !defined(l_castU2S) |
116 | 121 | #define l_castU2S(i) ((lua_Integer)(i)) | |
117 | /* cast a signed lua_Integer to lua_Unsigned */ | 122 | #endif |
118 | #define cast_s2u(i) ((lua_Unsigned)(i)) | ||
119 | 123 | ||
120 | 124 | ||
121 | /* | 125 | /* |