diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-04 19:57:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-04 19:57:10 -0300 |
commit | c5cae9362cc534b6d39dace66bcfbcb0a9509b25 (patch) | |
tree | 6a41bb4a066c77015005d31912f1b45e5600ee5e /lobject.c | |
parent | 4f4e0e49bbb72aaeb6ef11ed43d6c0957a80eb9c (diff) | |
download | lua-c5cae9362cc534b6d39dace66bcfbcb0a9509b25.tar.gz lua-c5cae9362cc534b6d39dace66bcfbcb0a9509b25.tar.bz2 lua-c5cae9362cc534b6d39dace66bcfbcb0a9509b25.zip |
added two casts to avoid warnings in VS
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.89 2014/08/01 17:24:02 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.90 2014/10/01 11:52:33 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 | */ |
@@ -314,7 +314,7 @@ int luaO_utf8esc (char *buff, unsigned long x) { | |||
314 | int n = 1; /* number of bytes put in buffer (backwards) */ | 314 | int n = 1; /* number of bytes put in buffer (backwards) */ |
315 | lua_assert(x <= 0x10FFFF); | 315 | lua_assert(x <= 0x10FFFF); |
316 | if (x < 0x80) /* ascii? */ | 316 | if (x < 0x80) /* ascii? */ |
317 | buff[UTF8BUFFSZ - 1] = 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 { |
@@ -322,7 +322,7 @@ int luaO_utf8esc (char *buff, unsigned long x) { | |||
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? */ |
325 | buff[UTF8BUFFSZ - n] = (~mfb << 1) | x; /* add first byte */ | 325 | buff[UTF8BUFFSZ - n] = cast(char, (~mfb << 1) | x); /* add first byte */ |
326 | } | 326 | } |
327 | return n; | 327 | return n; |
328 | } | 328 | } |