diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-01-28 13:13:26 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-01-28 13:13:26 -0200 |
commit | e2b15aa21d2f31ccc93e35f50928e26a8d9c84ce (patch) | |
tree | 0c8fe009fffa187be71ea3e268daf1a6e29d6d9a /lstring.c | |
parent | 89110986d7a9e81960261ae682780d5fd06dc4ac (diff) | |
download | lua-e2b15aa21d2f31ccc93e35f50928e26a8d9c84ce.tar.gz lua-e2b15aa21d2f31ccc93e35f50928e26a8d9c84ce.tar.bz2 lua-e2b15aa21d2f31ccc93e35f50928e26a8d9c84ce.zip |
janitor work on casts
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.61 2017/12/12 11:52:35 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 2.62 2017/12/18 13:00:57 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 | */ |
@@ -51,7 +51,7 @@ int luaS_eqlngstr (TString *a, TString *b) { | |||
51 | 51 | ||
52 | 52 | ||
53 | unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { | 53 | unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { |
54 | unsigned int h = seed ^ cast(unsigned int, l); | 54 | unsigned int h = seed ^ cast_uint(l); |
55 | size_t step = (l >> LUAI_HASHLIMIT) + 1; | 55 | size_t step = (l >> LUAI_HASHLIMIT) + 1; |
56 | for (; l >= step; l -= step) | 56 | for (; l >= step; l -= step) |
57 | h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1])); | 57 | h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1])); |