From 037a70dfea9de66e8d27c8d3ce2ed9f159a1b094 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 15 Apr 2014 13:32:49 -0300 Subject: cast_u2s/cast_s2u renamed l_castS2U/l_castU2S to be configurable from outside (mostly for testing) --- llimits.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'llimits.h') diff --git a/llimits.h b/llimits.h index 0feba1d9..41f207e6 100644 --- a/llimits.h +++ b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.114 2014/04/12 14:45:10 roberto Exp roberto $ +** $Id: llimits.h,v 1.115 2014/04/15 14:28:20 roberto Exp roberto $ ** Limits, basic types, and some other `installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -107,15 +107,19 @@ typedef LUAI_UACINT l_uacInt; #define cast_uchar(i) cast(unsigned char, (i)) +/* cast a signed lua_Integer to lua_Unsigned */ +#if !defined(l_castS2U) +#define l_castS2U(i) ((lua_Unsigned)(i)) +#endif + /* ** cast a lua_Unsigned to a signed lua_Integer; this cast is ** not strict ANSI C, but two-complement architectures should ** work fine. */ -#define cast_u2s(i) ((lua_Integer)(i)) - -/* cast a signed lua_Integer to lua_Unsigned */ -#define cast_s2u(i) ((lua_Unsigned)(i)) +#if !defined(l_castU2S) +#define l_castU2S(i) ((lua_Integer)(i)) +#endif /* -- cgit v1.2.3-55-g6feb