Module Name: src
Committed By: mbalmer
Date: Thu Oct 8 13:40:16 UTC 2015
Modified Files:
src/external/mit/lua/dist/src: llex.c lstrlib.c ltable.c lvm.c lvm.h
Log Message:
fix kernel module build
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/mit/lua/dist/src/llex.c
cvs rdiff -u -r1.8 -r1.9 src/external/mit/lua/dist/src/lstrlib.c
cvs rdiff -u -r1.4 -r1.5 src/external/mit/lua/dist/src/ltable.c \
src/external/mit/lua/dist/src/lvm.h
cvs rdiff -u -r1.6 -r1.7 src/external/mit/lua/dist/src/lvm.c
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/llex.c
diff -u src/external/mit/lua/dist/src/llex.c:1.5 src/external/mit/lua/dist/src/llex.c:1.6
--- src/external/mit/lua/dist/src/llex.c:1.5 Thu Oct 8 13:21:00 2015
+++ src/external/mit/lua/dist/src/llex.c Thu Oct 8 13:40:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: llex.c,v 1.5 2015/10/08 13:21:00 mbalmer Exp $ */
+/* $NetBSD: llex.c,v 1.6 2015/10/08 13:40:16 mbalmer Exp $ */
/*
** Id: llex.c,v 2.93 2015/05/22 17:45:56 roberto Exp
@@ -227,7 +227,7 @@ static void buffreplace (LexState *ls, c
if (p[n] == from) p[n] = to;
}
}
-
+#endif
#define buff2num(b,o) (luaO_str2num(luaZ_buffer(b), o) != 0)
Index: src/external/mit/lua/dist/src/lstrlib.c
diff -u src/external/mit/lua/dist/src/lstrlib.c:1.8 src/external/mit/lua/dist/src/lstrlib.c:1.9
--- src/external/mit/lua/dist/src/lstrlib.c:1.8 Thu Oct 8 13:21:00 2015
+++ src/external/mit/lua/dist/src/lstrlib.c Thu Oct 8 13:40:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lstrlib.c,v 1.8 2015/10/08 13:21:00 mbalmer Exp $ */
+/* $NetBSD: lstrlib.c,v 1.9 2015/10/08 13:40:16 mbalmer Exp $ */
/*
** Id: lstrlib.c,v 1.229 2015/05/20 17:39:23 roberto Exp
@@ -886,8 +886,11 @@ static int lua_number2strx (lua_State *L
** by format('%.99f', minfloat), and is equal to 99 + 2 ('-' and '.') +
** number of decimal digits to represent minfloat.
*/
+#ifndef _KERNEL
#define MAX_ITEM (120 + l_mathlim(MAX_10_EXP))
-
+#else
+#define MAX_ITEM (120)
+#endif
/* valid flags in a format specification */
#define FLAGS "-+ #0"
Index: src/external/mit/lua/dist/src/ltable.c
diff -u src/external/mit/lua/dist/src/ltable.c:1.4 src/external/mit/lua/dist/src/ltable.c:1.5
--- src/external/mit/lua/dist/src/ltable.c:1.4 Thu Oct 8 13:21:00 2015
+++ src/external/mit/lua/dist/src/ltable.c Thu Oct 8 13:40:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ltable.c,v 1.4 2015/10/08 13:21:00 mbalmer Exp $ */
+/* $NetBSD: ltable.c,v 1.5 2015/10/08 13:40:16 mbalmer Exp $ */
/*
** Id: ltable.c,v 2.111 2015/06/09 14:21:13 roberto Exp
@@ -116,7 +116,7 @@ static int l_hashfloat (lua_Number n) {
}
}
#endif
-
+#endif /*_KERNEL */
/*
** returns the 'main' position of an element in a table (that is, the index
Index: src/external/mit/lua/dist/src/lvm.h
diff -u src/external/mit/lua/dist/src/lvm.h:1.4 src/external/mit/lua/dist/src/lvm.h:1.5
--- src/external/mit/lua/dist/src/lvm.h:1.4 Thu Oct 8 13:21:00 2015
+++ src/external/mit/lua/dist/src/lvm.h Thu Oct 8 13:40:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lvm.h,v 1.4 2015/10/08 13:21:00 mbalmer Exp $ */
+/* $NetBSD: lvm.h,v 1.5 2015/10/08 13:40:16 mbalmer Exp $ */
/*
** Id: lvm.h,v 2.35 2015/02/20 14:27:53 roberto Exp
@@ -29,7 +29,6 @@
#endif
-#ifndef _KERNEL
/*
** You can define LUA_FLOORN2I if you want to convert floats to integers
** by flooring them (instead of raising an error if they are not
@@ -40,6 +39,7 @@
#endif
+#ifndef _KERNEL
#define tonumber(o,n) \
(ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))
#else /* _KERNEL */
Index: src/external/mit/lua/dist/src/lvm.c
diff -u src/external/mit/lua/dist/src/lvm.c:1.6 src/external/mit/lua/dist/src/lvm.c:1.7
--- src/external/mit/lua/dist/src/lvm.c:1.6 Thu Oct 8 13:21:00 2015
+++ src/external/mit/lua/dist/src/lvm.c Thu Oct 8 13:40:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lvm.c,v 1.6 2015/10/08 13:21:00 mbalmer Exp $ */
+/* $NetBSD: lvm.c,v 1.7 2015/10/08 13:40:16 mbalmer Exp $ */
/*
** Id: lvm.c,v 2.245 2015/06/09 15:53:35 roberto Exp
@@ -39,7 +39,7 @@
#define MAXTAGLOOP 2000
-
+#ifndef _KERNEL
/*
** 'l_intfitsf' checks whether a given integer can be converted to a
** float without rounding. Used in comparisons. Left undefined if
@@ -66,6 +66,7 @@
#endif
#endif
+#endif /*_KERNEL */
#ifndef _KERNEL
/*
@@ -126,8 +127,8 @@ int luaV_tointeger (const TValue *obj, l
}
-/*
#ifndef _KERNEL
+/*
** Try to convert a 'for' limit to an integer, preserving the
** semantics of the loop.
** (The following explanation assumes a non-negative step; it is valid
@@ -318,9 +319,12 @@ static int LTnum (const TValue *l, const
lua_Integer li = ivalue(l);
if (ttisinteger(r))
return li < ivalue(r); /* both are integers */
+#ifndef _KERNEL
else /* 'l' is int and 'r' is float */
return LTintfloat(li, fltvalue(r)); /* l < r ? */
+#endif
}
+#ifndef _KERNEL
else {
lua_Number lf = fltvalue(l); /* 'l' must be float */
if (ttisfloat(r))
@@ -330,6 +334,7 @@ static int LTnum (const TValue *l, const
else /* without NaN, (l < r) <--> not(r <= l) */
return !LEintfloat(ivalue(r), lf); /* not (r <= l) ? */
}
+#endif
}
@@ -341,9 +346,12 @@ static int LEnum (const TValue *l, const
lua_Integer li = ivalue(l);
if (ttisinteger(r))
return li <= ivalue(r); /* both are integers */
+#ifndef _KERNEL
else /* 'l' is int and 'r' is float */
return LEintfloat(li, fltvalue(r)); /* l <= r ? */
+#endif
}
+#ifndef _KERNEL
else {
lua_Number lf = fltvalue(l); /* 'l' must be float */
if (ttisfloat(r))
@@ -353,6 +361,7 @@ static int LEnum (const TValue *l, const
else /* without NaN, (l <= r) <--> not(r < l) */
return !LTintfloat(ivalue(r), lf); /* not (r < l) ? */
}
+#endif
}