aboutsummaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-10-02 14:41:50 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-10-02 14:41:50 -0300
commit84b6581287298e2ff70dac7e95bdb8f64292a752 (patch)
treeba6dd48298d4aefc8b3f4a314cc9ec1c27b9a049 /lstring.c
parentc6b6024a9d4d23e66bfb1e16f3e7f7062d1742c7 (diff)
downloadlua-84b6581287298e2ff70dac7e95bdb8f64292a752.tar.gz
lua-84b6581287298e2ff70dac7e95bdb8f64292a752.tar.bz2
lua-84b6581287298e2ff70dac7e95bdb8f64292a752.zip
cast to avoid warning in some compilers (size_t x unsigned int)
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstring.c b/lstring.c
index 1fbce6e7..86e3e0e5 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 2.23 2012/03/28 18:28:25 roberto Exp roberto $ 2** $Id: lstring.c,v 2.24 2012/05/11 14:14:42 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*/
@@ -49,7 +49,7 @@ int luaS_eqstr (TString *a, TString *b) {
49 49
50 50
51unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { 51unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) {
52 unsigned int h = seed ^ l; 52 unsigned int h = seed ^ cast(unsigned int, l);
53 size_t l1; 53 size_t l1;
54 size_t step = (l >> LUAI_HASHLIMIT) + 1; 54 size_t step = (l >> LUAI_HASHLIMIT) + 1;
55 for (l1 = l; l1 >= step; l1 -= step) 55 for (l1 = l; l1 >= step; l1 -= step)