aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llex.c4
-rw-r--r--lobject.c4
-rw-r--r--lstring.c4
-rw-r--r--ltable.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/llex.c b/llex.c
index 71b52510..2b9ec68c 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 2.3 2004/04/30 20:13:38 roberto Exp roberto $ 2** $Id: llex.c,v 2.4 2004/09/22 14:02:00 roberto Exp roberto $
3** Lexical Analyzer 3** Lexical Analyzer
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -64,7 +64,7 @@ void luaX_init (lua_State *L) {
64 64
65const char *luaX_token2str (LexState *ls, int token) { 65const char *luaX_token2str (LexState *ls, int token) {
66 if (token < FIRST_RESERVED) { 66 if (token < FIRST_RESERVED) {
67 lua_assert(token == (unsigned char)token); 67 lua_assert(token == cast(unsigned char, token));
68 return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) : 68 return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) :
69 luaO_pushfstring(ls->L, "%c", token); 69 luaO_pushfstring(ls->L, "%c", token);
70 } 70 }
diff --git a/lobject.c b/lobject.c
index 666bb466..3ad1cf98 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.5 2004/10/06 18:34:16 roberto Exp $ 2** $Id: lobject.c,v 2.6 2004/11/01 15:06:50 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -89,7 +89,7 @@ int luaO_str2d (const char *s, lua_Number *result) {
89 char *endptr; 89 char *endptr;
90 lua_Number res = lua_str2number(s, &endptr); 90 lua_Number res = lua_str2number(s, &endptr);
91 if (endptr == s) return 0; /* no conversion */ 91 if (endptr == s) return 0; /* no conversion */
92 while (isspace((unsigned char)(*endptr))) endptr++; 92 while (isspace(cast(unsigned char, *endptr))) endptr++;
93 if (*endptr != '\0') return 0; /* invalid trailing characters? */ 93 if (*endptr != '\0') return 0; /* invalid trailing characters? */
94 *result = res; 94 *result = res;
95 return 1; 95 return 1;
diff --git a/lstring.c b/lstring.c
index 99c3f0b6..995f7ccf 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 2.3 2004/08/24 20:12:06 roberto Exp roberto $ 2** $Id: lstring.c,v 2.4 2004/11/19 15:52:40 roberto Exp roberto $
3** String table (keeps all strings handled by Lua) 3** String table (keeps all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -78,7 +78,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
78 size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ 78 size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */
79 size_t l1; 79 size_t l1;
80 for (l1=l; l1>=step; l1-=step) /* compute hash */ 80 for (l1=l; l1>=step; l1-=step) /* compute hash */
81 h = h ^ ((h<<5)+(h>>2)+(unsigned char)(str[l1-1])); 81 h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1]));
82 for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)]; 82 for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)];
83 o != NULL; 83 o != NULL;
84 o = o->gch.next) { 84 o = o->gch.next) {
diff --git a/ltable.c b/ltable.c
index 968b8395..a55b510d 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.7 2004/10/06 18:34:16 roberto Exp roberto $ 2** $Id: ltable.c,v 2.8 2004/11/24 18:55:42 roberto Exp roberto $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -393,7 +393,7 @@ static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
393*/ 393*/
394const TValue *luaH_getnum (Table *t, int key) { 394const TValue *luaH_getnum (Table *t, int key) {
395 /* (1 <= key && key <= t->sizearray) */ 395 /* (1 <= key && key <= t->sizearray) */
396 if ((unsigned int)(key-1) < (unsigned int)t->sizearray) 396 if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray))
397 return &t->array[key-1]; 397 return &t->array[key-1];
398 else { 398 else {
399 lua_Number nk = cast(lua_Number, key); 399 lua_Number nk = cast(lua_Number, key);