commit 75d8470f0f3719594637ddaba4bb9dbbb30e94ec
parent 81646af13b5dc0c36388616b9ea6087952d9b57e
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 10 Dec 2010 11:39:58 -0200
new macro 'cast_uchar'
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/llimits.h b/llimits.h
@@ -1,5 +1,5 @@
/*
-** $Id: llimits.h,v 1.83 2010/11/03 15:16:17 roberto Exp roberto $
+** $Id: llimits.h,v 1.84 2010/11/08 16:33:20 roberto Exp roberto $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -87,6 +87,7 @@ typedef LUAI_UACNUMBER l_uacNumber;
#define cast_byte(i) cast(lu_byte, (i))
#define cast_num(i) cast(lua_Number, (i))
#define cast_int(i) cast(int, (i))
+#define cast_uchar(i) cast(unsigned char, (i))
/*
diff --git a/ltests.c b/ltests.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltests.c,v 2.113 2010/11/16 17:43:29 roberto Exp roberto $
+** $Id: ltests.c,v 2.114 2010/11/26 14:32:31 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@@ -937,9 +937,9 @@ static int getnum_aux (lua_State *L, lua_State *L1, const char **pc) {
sig = -1;
(*pc)++;
}
- if (!lisdigit(cast(unsigned char, **pc)))
+ if (!lisdigit(cast_uchar(**pc)))
luaL_error(L, "number expected (%s)", *pc);
- while (lisdigit(cast(unsigned char, **pc))) res = res*10 + (*(*pc)++) - '0';
+ while (lisdigit(cast_uchar(**pc))) res = res*10 + (*(*pc)++) - '0';
return sig*res;
}