diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-12-10 11:40:22 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-12-10 11:40:22 -0200 |
commit | 75d8470f0f3719594637ddaba4bb9dbbb30e94ec (patch) | |
tree | 1b644d10fd7156408e66dab26e97e13189935ee9 | |
parent | 81646af13b5dc0c36388616b9ea6087952d9b57e (diff) | |
download | lua-75d8470f0f3719594637ddaba4bb9dbbb30e94ec.tar.gz lua-75d8470f0f3719594637ddaba4bb9dbbb30e94ec.tar.bz2 lua-75d8470f0f3719594637ddaba4bb9dbbb30e94ec.zip |
new macro 'cast_uchar'
-rw-r--r-- | llimits.h | 3 | ||||
-rw-r--r-- | ltests.c | 6 |
2 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.83 2010/11/03 15:16:17 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.84 2010/11/08 16:33: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 | */ |
@@ -87,6 +87,7 @@ typedef LUAI_UACNUMBER l_uacNumber; | |||
87 | #define cast_byte(i) cast(lu_byte, (i)) | 87 | #define cast_byte(i) cast(lu_byte, (i)) |
88 | #define cast_num(i) cast(lua_Number, (i)) | 88 | #define cast_num(i) cast(lua_Number, (i)) |
89 | #define cast_int(i) cast(int, (i)) | 89 | #define cast_int(i) cast(int, (i)) |
90 | #define cast_uchar(i) cast(unsigned char, (i)) | ||
90 | 91 | ||
91 | 92 | ||
92 | /* | 93 | /* |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.113 2010/11/16 17:43:29 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.114 2010/11/26 14:32:31 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -937,9 +937,9 @@ static int getnum_aux (lua_State *L, lua_State *L1, const char **pc) { | |||
937 | sig = -1; | 937 | sig = -1; |
938 | (*pc)++; | 938 | (*pc)++; |
939 | } | 939 | } |
940 | if (!lisdigit(cast(unsigned char, **pc))) | 940 | if (!lisdigit(cast_uchar(**pc))) |
941 | luaL_error(L, "number expected (%s)", *pc); | 941 | luaL_error(L, "number expected (%s)", *pc); |
942 | while (lisdigit(cast(unsigned char, **pc))) res = res*10 + (*(*pc)++) - '0'; | 942 | while (lisdigit(cast_uchar(**pc))) res = res*10 + (*(*pc)++) - '0'; |
943 | return sig*res; | 943 | return sig*res; |
944 | } | 944 | } |
945 | 945 | ||