added two casts to avoid warnings in VS
This commit is contained in:
@@ -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
|
** Some generic functions over Lua objects
|
||||||
** See Copyright Notice in lua.h
|
** 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) */
|
int n = 1; /* number of bytes put in buffer (backwards) */
|
||||||
lua_assert(x <= 0x10FFFF);
|
lua_assert(x <= 0x10FFFF);
|
||||||
if (x < 0x80) /* ascii? */
|
if (x < 0x80) /* ascii? */
|
||||||
buff[UTF8BUFFSZ - 1] = x;
|
buff[UTF8BUFFSZ - 1] = cast(char, x);
|
||||||
else { /* need continuation bytes */
|
else { /* need continuation bytes */
|
||||||
unsigned int mfb = 0x3f; /* maximum that fits in first byte */
|
unsigned int mfb = 0x3f; /* maximum that fits in first byte */
|
||||||
do {
|
do {
|
||||||
@@ -322,7 +322,7 @@ int luaO_utf8esc (char *buff, unsigned long x) {
|
|||||||
x >>= 6; /* remove added bits */
|
x >>= 6; /* remove added bits */
|
||||||
mfb >>= 1; /* now there is one less bit available in first byte */
|
mfb >>= 1; /* now there is one less bit available in first byte */
|
||||||
} while (x > mfb); /* still needs continuation 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;
|
return n;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user