macros cast_integer/cast_unsigned replaced by cast_u2s/cast_s2u, that

should be used only between lua_Integer and lua_Unsigned
This commit is contained in:
Roberto Ierusalimschy
2014-04-15 11:29:30 -03:00
parent 5c46b7b8cf
commit 8f961da3db
7 changed files with 33 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: llimits.h,v 1.113 2014/04/11 19:56:04 roberto Exp roberto $
** $Id: llimits.h,v 1.114 2014/04/12 14:45:10 roberto Exp roberto $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -105,8 +105,17 @@ typedef LUAI_UACINT l_uacInt;
#define cast_num(i) cast(lua_Number, (i))
#define cast_int(i) cast(int, (i))
#define cast_uchar(i) cast(unsigned char, (i))
#define cast_integer(i) cast(lua_Integer, (i))
#define cast_unsigned(i) cast(lua_Unsigned, (i))
/*
** 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))
/*