diff options
-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 | } |