Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/mit/lua/dist/src fix misplaced kernel Lua ifndef



details:   https://anonhg.NetBSD.org/src/rev/4377159f0d1d
branches:  trunk
changeset: 347636:4377159f0d1d
user:      salazar <salazar%NetBSD.org@localhost>
date:      Thu Sep 08 02:51:53 2016 +0000

description:
fix misplaced kernel Lua ifndef

diffstat:

 external/mit/lua/dist/src/lstrlib.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r fc8bd0bb68ed -r 4377159f0d1d external/mit/lua/dist/src/lstrlib.c
--- a/external/mit/lua/dist/src/lstrlib.c       Thu Sep 08 02:34:25 2016 +0000
+++ b/external/mit/lua/dist/src/lstrlib.c       Thu Sep 08 02:51:53 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstrlib.c,v 1.13 2016/09/08 02:21:31 salazar Exp $     */
+/*     $NetBSD: lstrlib.c,v 1.14 2016/09/08 02:51:53 salazar Exp $     */
 
 /*
 ** Id: lstrlib.c,v 1.251 2016/05/20 14:13:21 roberto Exp 
@@ -956,22 +956,20 @@
     case LUA_TNUMBER: {
       char *buff = luaL_prepbuffsize(b, MAX_ITEM);
       int nb;
+      if (!lua_isinteger(L, arg)) {  /* float? */
 #ifndef _KERNEL
-      if (!lua_isinteger(L, arg)) {  /* float? */
         lua_Number n = lua_tonumber(L, arg);  /* write as hexa ('%a') */
         nb = lua_number2strx(L, buff, MAX_ITEM, "%" LUA_NUMBER_FRMLEN "a", n);
         checkdp(buff, nb);  /* ensure it uses a dot */
+#endif
       }
       else {  /* integers */
-#else
-      {
         lua_Integer n = lua_tointeger(L, arg);
         const char *format = (n == LUA_MININTEGER)  /* corner case? */
                            ? "0x%" LUA_INTEGER_FRMLEN "x"  /* use hexa */
                            : LUA_INTEGER_FMT;  /* else use default format */
         nb = l_sprintf(buff, MAX_ITEM, format, n);
       }
-#endif
       luaL_addsize(b, nb);
       break;
     }



Home | Main Index | Thread Index | Old Index