diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-24 09:42:29 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-24 09:42:29 -0200 |
commit | ff9ca88aa6cdc6e5409f2481f3d74a2436e81a7b (patch) | |
tree | 9259d73174e52b96d5bf72eaf6fc06c89237b8e3 /lobject.c | |
parent | 463edee2fd6436d9ad6ae9f2f3d36b742416a479 (diff) | |
download | lua-ff9ca88aa6cdc6e5409f2481f3d74a2436e81a7b.tar.gz lua-ff9ca88aa6cdc6e5409f2481f3d74a2436e81a7b.tar.bz2 lua-ff9ca88aa6cdc6e5409f2481f3d74a2436e81a7b.zip |
added some casts to avoid warnings in some compilers
Diffstat (limited to 'lobject.c')
-rw-r--r-- | lobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 2.92 2014/10/10 22:23:04 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.93 2014/10/17 16:28:21 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 | */ |
@@ -317,8 +317,8 @@ int luaO_utf8esc (char *buff, unsigned long x) { | |||
317 | buff[UTF8BUFFSZ - 1] = cast(char, x); | 317 | buff[UTF8BUFFSZ - 1] = cast(char, x); |
318 | else { /* need continuation bytes */ | 318 | else { /* need continuation bytes */ |
319 | unsigned int mfb = 0x3f; /* maximum that fits in first byte */ | 319 | unsigned int mfb = 0x3f; /* maximum that fits in first byte */ |
320 | do { | 320 | do { /* add continuation bytes */ |
321 | buff[UTF8BUFFSZ - (n++)] = 0x80 | (x & 0x3f); /* add continuation byte */ | 321 | buff[UTF8BUFFSZ - (n++)] = cast(char, 0x80 | (x & 0x3f)); |
322 | x >>= 6; /* remove added bits */ | 322 | x >>= 6; /* remove added bits */ |
323 | mfb >>= 1; /* now there is one less bit available in first byte */ | 323 | mfb >>= 1; /* now there is one less bit available in first byte */ |
324 | } while (x > mfb); /* still needs continuation byte? */ | 324 | } while (x > mfb); /* still needs continuation byte? */ |