diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-11-24 17:16:03 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-11-24 17:16:03 -0200 |
commit | 1d99a7360beaf1a50a3739413b1ad6ed4b71491d (patch) | |
tree | c34e5b49da29838858f2e9bfc46eac29816cd13f /lstring.c | |
parent | 2f82bf6fe940557fb5258c65c03e18f097ff831f (diff) | |
download | lua-1d99a7360beaf1a50a3739413b1ad6ed4b71491d.tar.gz lua-1d99a7360beaf1a50a3739413b1ad6ed4b71491d.tar.bz2 lua-1d99a7360beaf1a50a3739413b1ad6ed4b71491d.zip |
details
Diffstat (limited to 'lstring.c')
-rw-r--r-- | lstring.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) { |