Module Name: src
Committed By: lneto
Date: Mon Dec 16 23:25:56 UTC 2013
Modified Files:
src/external/mit/lua/dist/src: lstrlib.c luaconf.h
Log Message:
changed lua_Number and lua_Integer to intmax_t in lua(4)
*
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/lua/dist/src/lstrlib.c
cvs rdiff -u -r1.5 -r1.6 src/external/mit/lua/dist/src/luaconf.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/mit/lua/dist/src/lstrlib.c
diff -u src/external/mit/lua/dist/src/lstrlib.c:1.2 src/external/mit/lua/dist/src/lstrlib.c:1.3
--- src/external/mit/lua/dist/src/lstrlib.c:1.2 Mon Dec 2 23:06:35 2013
+++ src/external/mit/lua/dist/src/lstrlib.c Mon Dec 16 23:25:56 2013
@@ -1,7 +1,7 @@
-/* $NetBSD: lstrlib.c,v 1.2 2013/12/02 23:06:35 lneto Exp $ */
+/* $NetBSD: lstrlib.c,v 1.3 2013/12/16 23:25:56 lneto Exp $ */
/*
-** $Id: lstrlib.c,v 1.2 2013/12/02 23:06:35 lneto Exp $
+** $Id: lstrlib.c,v 1.3 2013/12/16 23:25:56 lneto Exp $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -786,7 +786,11 @@ static int str_format (lua_State *L) {
}
case 'o': case 'u': case 'x': case 'X': {
addintlen(form);
+#ifndef _KERNEL
sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg));
+#else
+ sprintf(buff, form, (LUA_UINTFRM_T)luaL_checknumber(L, arg));
+#endif
break;
}
#ifndef _KERNEL
Index: src/external/mit/lua/dist/src/luaconf.h
diff -u src/external/mit/lua/dist/src/luaconf.h:1.5 src/external/mit/lua/dist/src/luaconf.h:1.6
--- src/external/mit/lua/dist/src/luaconf.h:1.5 Mon Dec 2 06:07:22 2013
+++ src/external/mit/lua/dist/src/luaconf.h Mon Dec 16 23:25:56 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: luaconf.h,v 1.5 2013/12/02 06:07:22 lneto Exp $ */
+/* $NetBSD: luaconf.h,v 1.6 2013/12/16 23:25:56 lneto Exp $ */
/*
** Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $
@@ -149,7 +149,11 @@
** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
** machines, ptrdiff_t gives a good choice between int or long.)
*/
+#ifdef _KERNEL
+#define LUA_INTEGER LUA_NUMBER
+#else
#define LUA_INTEGER ptrdiff_t
+#endif
/*
@@ -511,7 +515,8 @@
*/
#ifdef _KERNEL
-#define LUA_NUMBER int64_t
+#include <sys/stdint.h>
+#define LUA_NUMBER intmax_t
#else
#define LUA_NUMBER_DOUBLE
#define LUA_NUMBER double
@@ -531,9 +536,9 @@
@@ lua_str2number converts a string to a number.
*/
#ifdef _KERNEL
-#define LUA_NUMBER_SCAN "%" SCNd64
-#define LUA_NUMBER_FMT "%" PRId64
-#define lua_str2number(s,p) ((int64_t) strtoimax((s), (p), 10))
+#define LUA_NUMBER_SCAN "%jd"
+#define LUA_NUMBER_FMT "%jd"
+#define lua_str2number(s,p) strtoimax((s), (p), 10)
#else
#define LUA_NUMBER_SCAN "%lf"
#define LUA_NUMBER_FMT "%.14g"
@@ -766,7 +771,13 @@ union luai_Cast { double l_d; long l_l;
** CHANGE them if your system supports long long or does not support long.
*/
-#if defined(LUA_USELONGLONG)
+#ifdef _KERNEL
+
+#define LUA_INTFRMLEN "j"
+#define LUA_INTFRM_T intmax_t
+#define LUA_UINTFRM_T uintmax_t
+
+#elif defined(LUA_USELONGLONG)
#define LUA_INTFRMLEN "ll"
#define LUA_INTFRM_T long long