Source-Changes-HG archive

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

[src/netbsd-7]: src/external/mit/lua/dist/src Pull up following revision(s) (...



details:   https://anonhg.NetBSD.org/src/rev/40b67ce3a824
branches:  netbsd-7
changeset: 799011:40b67ce3a824
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Feb 21 18:16:21 2015 +0000

description:
Pull up following revision(s) (requested by lneto in ticket #534):
        external/mit/lua/dist/src/lvm.c: revision 1.5
        external/mit/lua/dist/src/lapi.c: revision 1.4
        external/mit/lua/dist/src/ldebug.c: revision 1.4
        external/mit/lua/dist/src/lstrlib.c: revision 1.7
        external/mit/lua/dist/src/lua.h: revision 1.4
        external/mit/lua/dist/src/luaconf.h: revision 1.13
        external/mit/lua/dist/src/llimits.h: revision 1.4
        external/mit/lua/dist/src/llex.c: revision 1.4
lua(4): small fixes in kernel Lua
* fixed hex parsing
* restored lua_isnumber
* removed unwanted macros from luaconf.h
* restored <stdarg.h> include in ldebug.c
* removed doubles from unions
* removed unused functions

diffstat:

 external/mit/lua/dist/src/lapi.c    |   4 +---
 external/mit/lua/dist/src/ldebug.c  |   4 ++--
 external/mit/lua/dist/src/llex.c    |   7 +++++--
 external/mit/lua/dist/src/llimits.h |   8 +++++++-
 external/mit/lua/dist/src/lstrlib.c |   8 +++++++-
 external/mit/lua/dist/src/lua.h     |   6 +-----
 external/mit/lua/dist/src/luaconf.h |  14 +++-----------
 external/mit/lua/dist/src/lvm.c     |   4 ++--
 8 files changed, 28 insertions(+), 27 deletions(-)

diffs (242 lines):

diff -r 15da6b38c3f3 -r 40b67ce3a824 external/mit/lua/dist/src/lapi.c
--- a/external/mit/lua/dist/src/lapi.c  Sat Feb 21 13:55:08 2015 +0000
+++ b/external/mit/lua/dist/src/lapi.c  Sat Feb 21 18:16:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lapi.c,v 1.2.2.1 2015/02/04 21:32:46 martin Exp $      */
+/*     $NetBSD: lapi.c,v 1.2.2.2 2015/02/21 18:16:21 martin Exp $      */
 
 /*
 ** Id: lapi.c,v 2.244 2014/12/26 14:43:45 roberto Exp 
@@ -276,13 +276,11 @@
 }
 
 
-#ifndef _KERNEL
 LUA_API int lua_isnumber (lua_State *L, int idx) {
   lua_Number n;
   const TValue *o = index2addr(L, idx);
   return tonumber(o, &n);
 }
-#endif
 
 
 LUA_API int lua_isstring (lua_State *L, int idx) {
diff -r 15da6b38c3f3 -r 40b67ce3a824 external/mit/lua/dist/src/ldebug.c
--- a/external/mit/lua/dist/src/ldebug.c        Sat Feb 21 13:55:08 2015 +0000
+++ b/external/mit/lua/dist/src/ldebug.c        Sat Feb 21 18:16:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldebug.c,v 1.2.2.1 2015/02/04 21:32:46 martin Exp $    */
+/*     $NetBSD: ldebug.c,v 1.2.2.2 2015/02/21 18:16:21 martin Exp $    */
 
 /*
 ** Id: ldebug.c,v 2.110 2015/01/02 12:52:22 roberto Exp 
@@ -12,8 +12,8 @@
 #include "lprefix.h"
 
 
+#include <stdarg.h>
 #ifndef _KERNEL
-#include <stdarg.h>
 #include <stddef.h>
 #include <string.h>
 #endif
diff -r 15da6b38c3f3 -r 40b67ce3a824 external/mit/lua/dist/src/llex.c
--- a/external/mit/lua/dist/src/llex.c  Sat Feb 21 13:55:08 2015 +0000
+++ b/external/mit/lua/dist/src/llex.c  Sat Feb 21 18:16:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: llex.c,v 1.2.2.1 2015/02/04 21:32:46 martin Exp $      */
+/*     $NetBSD: llex.c,v 1.2.2.2 2015/02/21 18:16:21 martin Exp $      */
 
 /*
 ** Id: llex.c,v 2.89 2014/11/14 16:06:09 roberto Exp 
@@ -202,7 +202,6 @@
 }
 
 
-#ifndef _KERNEL
 /*
 ** Check whether current char is in set 'set' (with two chars) and
 ** saves it
@@ -217,6 +216,7 @@
 }
 
 
+#ifndef _KERNEL
 /*
 ** change all characters 'from' in buffer to 'to'
 */
@@ -296,8 +296,11 @@
 
 static int read_numeral (LexState *ls, SemInfo *seminfo) {
   TValue obj;
+  int first = ls->current;
   lua_assert(lisdigit(ls->current));
   save_and_next(ls);
+  if (first == '0')
+    check_next2(ls, "xX");  /* hexadecimal? */
   for (;;) {
     if (lisxdigit(ls->current))
       save_and_next(ls);
diff -r 15da6b38c3f3 -r 40b67ce3a824 external/mit/lua/dist/src/llimits.h
--- a/external/mit/lua/dist/src/llimits.h       Sat Feb 21 13:55:08 2015 +0000
+++ b/external/mit/lua/dist/src/llimits.h       Sat Feb 21 18:16:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: llimits.h,v 1.2.2.1 2015/02/04 21:32:46 martin Exp $   */
+/*     $NetBSD: llimits.h,v 1.2.2.2 2015/02/21 18:16:21 martin Exp $   */
 
 /*
 ** Id: llimits.h,v 1.125 2014/12/19 13:30:23 roberto Exp 
@@ -68,13 +68,19 @@
 #if defined(LUAI_USER_ALIGNMENT_T)
 typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
 #else
+#ifndef _KERNEL
 typedef union { double u; void *s; lua_Integer i; long l; } L_Umaxalign;
+#else /* _KERNEL */
+typedef union { void *s; lua_Integer i; long l; } L_Umaxalign;
+#endif
 #endif
 
 
 
 /* types of 'usual argument conversions' for lua_Number and lua_Integer */
+#ifndef _KERNEL
 typedef LUAI_UACNUMBER l_uacNumber;
+#endif
 typedef LUAI_UACINT l_uacInt;
 
 
diff -r 15da6b38c3f3 -r 40b67ce3a824 external/mit/lua/dist/src/lstrlib.c
--- a/external/mit/lua/dist/src/lstrlib.c       Sat Feb 21 13:55:08 2015 +0000
+++ b/external/mit/lua/dist/src/lstrlib.c       Sat Feb 21 18:16:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstrlib.c,v 1.5.2.1 2015/02/04 21:32:46 martin Exp $   */
+/*     $NetBSD: lstrlib.c,v 1.5.2.2 2015/02/21 18:16:21 martin Exp $   */
 
 /*
 ** Id: lstrlib.c,v 1.221 2014/12/11 14:03:07 roberto Exp 
@@ -985,7 +985,11 @@
 /* dummy structure to get native alignment requirements */
 struct cD {
   char c;
+#ifndef _KERNEL
   union { double d; void *p; lua_Integer i; lua_Number n; } u;
+#else /* _KERNEL */
+  union { void *p; lua_Integer i; lua_Number n; } u;
+#endif
 };
 
 #define MAXALIGN       (offsetof(struct cD, u))
@@ -1172,6 +1176,7 @@
 }
 
 
+#ifndef _KERNEL
 /*
 ** Copy 'size' bytes from 'src' to 'dest', correcting endianness if
 ** given 'islittle' is different from native endianness.
@@ -1188,6 +1193,7 @@
       *(dest--) = *(src++);
   }
 }
+#endif
 
 
 static int str_pack (lua_State *L) {
diff -r 15da6b38c3f3 -r 40b67ce3a824 external/mit/lua/dist/src/lua.h
--- a/external/mit/lua/dist/src/lua.h   Sat Feb 21 13:55:08 2015 +0000
+++ b/external/mit/lua/dist/src/lua.h   Sat Feb 21 18:16:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lua.h,v 1.2.2.1 2015/02/04 21:32:46 martin Exp $       */
+/*     $NetBSD: lua.h,v 1.2.2.2 2015/02/21 18:16:21 martin Exp $       */
 
 /*
 ** Id: lua.h,v 1.325 2014/12/26 17:24:27 roberto Exp 
@@ -182,11 +182,7 @@
 ** access functions (stack -> C)
 */
 
-#ifndef _KERNEL
 LUA_API int             (lua_isnumber) (lua_State *L, int idx);
-#else /* _KERNEL */
-#define lua_isnumber   lua_isinteger
-#endif
 LUA_API int             (lua_isstring) (lua_State *L, int idx);
 LUA_API int             (lua_iscfunction) (lua_State *L, int idx);
 LUA_API int             (lua_isinteger) (lua_State *L, int idx);
diff -r 15da6b38c3f3 -r 40b67ce3a824 external/mit/lua/dist/src/luaconf.h
--- a/external/mit/lua/dist/src/luaconf.h       Sat Feb 21 13:55:08 2015 +0000
+++ b/external/mit/lua/dist/src/luaconf.h       Sat Feb 21 18:16:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: luaconf.h,v 1.9.2.2 2015/02/04 21:32:46 martin Exp $   */
+/*     $NetBSD: luaconf.h,v 1.9.2.3 2015/02/21 18:16:21 martin Exp $   */
 
 /*
 ** Id: luaconf.h,v 1.238 2014/12/29 13:27:55 roberto Exp 
@@ -392,6 +392,7 @@
 ** ===================================================================
 */
 
+#ifndef _KERNEL
 /*
 @@ LUA_NUMBER is the floating-point type used by Lua.
 **
@@ -478,7 +479,6 @@
 ** They should work for any size of floating numbers.
 */
 
-#ifndef _KERNEL
 /* the following operations need the math library */
 #if defined(lobject_c) || defined(lvm_c)
 #include <math.h>
@@ -771,16 +771,8 @@
 
 #else /* _KERNEL */
 
-#undef LUA_NUMBER
-#undef LUA_NUMBER_FMT
-#undef lua_str2number
-
 #define LUA_NUMBER             LUA_INTEGER
 #define LUA_NUMBER_FMT         LUA_INTEGER_FMT
-#define lua_str2number(s,p)    strtoimax((s),(p),10)
-
-#undef lua_numbertointeger
-#define lua_numbertointeger(n,p)       (*(p) = (LUA_INTEGER)(n), 1)
 
 /* setjmp.h */
 #define LUAI_THROW(L,c)                longjmp(&((c)->b))
@@ -793,7 +785,7 @@
 
 /* stdio.h */
 #define lua_writestring(s,l)   printf("%s", (s))
-#define lua_writeline()        printf("\n")
+#define lua_writeline()                printf("\n")
 
 #define sprintf(s,fmt,...)     snprintf(s, sizeof(s), fmt, __VA_ARGS__)
 
diff -r 15da6b38c3f3 -r 40b67ce3a824 external/mit/lua/dist/src/lvm.c
--- a/external/mit/lua/dist/src/lvm.c   Sat Feb 21 13:55:08 2015 +0000
+++ b/external/mit/lua/dist/src/lvm.c   Sat Feb 21 18:16:21 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lvm.c,v 1.3.2.1 2015/02/04 21:32:46 martin Exp $       */
+/*     $NetBSD: lvm.c,v 1.3.2.2 2015/02/21 18:16:21 martin Exp $       */
 
 /*
 ** Id: lvm.c,v 2.232 2014/12/27 20:30:38 roberto Exp 
@@ -65,7 +65,6 @@
   }
   return 1;
 }
-#endif
 
 
 /*
@@ -86,6 +85,7 @@
   else
     return 0;  /* conversion failed */
 }
+#endif
 
 
 /*



Home | Main Index | Thread Index | Old Index