commit c5cae9362cc534b6d39dace66bcfbcb0a9509b25
parent 4f4e0e49bbb72aaeb6ef11ed43d6c0957a80eb9c
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Sat, 4 Oct 2014 19:56:45 -0300
added two casts to avoid warnings in VS
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lobject.c b/lobject.c
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.c,v 2.89 2014/08/01 17:24:02 roberto Exp roberto $
+** $Id: lobject.c,v 2.90 2014/10/01 11:52:33 roberto Exp roberto $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@@ -314,7 +314,7 @@ int luaO_utf8esc (char *buff, unsigned long x) {
int n = 1; /* number of bytes put in buffer (backwards) */
lua_assert(x <= 0x10FFFF);
if (x < 0x80) /* ascii? */
- buff[UTF8BUFFSZ - 1] = x;
+ buff[UTF8BUFFSZ - 1] = cast(char, x);
else { /* need continuation bytes */
unsigned int mfb = 0x3f; /* maximum that fits in first byte */
do {
@@ -322,7 +322,7 @@ int luaO_utf8esc (char *buff, unsigned long x) {
x >>= 6; /* remove added bits */
mfb >>= 1; /* now there is one less bit available in first byte */
} while (x > mfb); /* still needs continuation byte? */
- buff[UTF8BUFFSZ - n] = (~mfb << 1) | x; /* add first byte */
+ buff[UTF8BUFFSZ - n] = cast(char, (~mfb << 1) | x); /* add first byte */
}
return n;
}