aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lobject.c6
-rw-r--r--lstrlib.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/lobject.c b/lobject.c
index 8e29b383..255a24e2 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.92 2014/10/10 22:23:04 roberto Exp roberto $ 2** $Id: lobject.c,v 2.93 2014/10/17 16:28:21 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*/
@@ -317,8 +317,8 @@ int luaO_utf8esc (char *buff, unsigned long x) {
317 buff[UTF8BUFFSZ - 1] = cast(char, 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 { /* add continuation bytes */
321 buff[UTF8BUFFSZ - (n++)] = 0x80 | (x & 0x3f); /* add continuation byte */ 321 buff[UTF8BUFFSZ - (n++)] = cast(char, 0x80 | (x & 0x3f));
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? */
diff --git a/lstrlib.c b/lstrlib.c
index 28e7355a..765ebd32 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.204 2014/10/17 16:28:21 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.205 2014/10/20 16:44:54 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -1136,10 +1136,10 @@ static void packint (luaL_Buffer *b, lua_Unsigned n,
1136 char *buff = luaL_prepbuffsize(b, size); 1136 char *buff = luaL_prepbuffsize(b, size);
1137 int i; 1137 int i;
1138 for (i = 0; i < size - 1; i++) { 1138 for (i = 0; i < size - 1; i++) {
1139 buff[islittle ? i : size - 1 - i] = (n & MC); 1139 buff[islittle ? i : size - 1 - i] = (char)(n & MC);
1140 n = (n >> NB) | mask; 1140 n = (n >> NB) | mask;
1141 } 1141 }
1142 buff[islittle ? i : size - 1 - i] = (n & MC); 1142 buff[islittle ? i : size - 1 - i] = (char)(n & MC);
1143 luaL_addsize(b, size); /* add result to buffer */ 1143 luaL_addsize(b, size); /* add result to buffer */
1144} 1144}
1145 1145