From c5cae9362cc534b6d39dace66bcfbcb0a9509b25 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sat, 4 Oct 2014 19:57:10 -0300 Subject: added two casts to avoid warnings in VS --- lobject.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lobject.c b/lobject.c index 0d59d344..eb7cb28a 100644 --- 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; } -- cgit v1.2.3-55-g6feb