Module Name: src
Committed By: mbalmer
Date: Sun Oct 11 09:21:15 UTC 2015
Modified Files:
src/external/mit/lua/dist/src: lvm.c
Log Message:
no floating point in the kernel, also make sure we always return an int
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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/lvm.c
diff -u src/external/mit/lua/dist/src/lvm.c:1.7 src/external/mit/lua/dist/src/lvm.c:1.8
--- src/external/mit/lua/dist/src/lvm.c:1.7 Thu Oct 8 13:40:16 2015
+++ src/external/mit/lua/dist/src/lvm.c Sun Oct 11 09:21:15 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: lvm.c,v 1.7 2015/10/08 13:40:16 mbalmer Exp $ */
+/* $NetBSD: lvm.c,v 1.8 2015/10/11 09:21:15 mbalmer Exp $ */
/*
** Id: lvm.c,v 2.245 2015/06/09 15:53:35 roberto Exp
@@ -315,16 +315,17 @@ static int LEintfloat (lua_Integer i, lu
** Return 'l < r', for numbers.
*/
static int LTnum (const TValue *l, const TValue *r) {
+#ifdef _KERNEL
+ lua_Integer li = ivalue(l);
+ return li < ivalue(r); /* both must be integers */
+#else
if (ttisinteger(l)) {
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))
@@ -342,16 +343,17 @@ static int LTnum (const TValue *l, const
** Return 'l <= r', for numbers.
*/
static int LEnum (const TValue *l, const TValue *r) {
+#ifdef _KERNEL
+ lua_Integer li = ivalue(l);
+ return li <= ivalue(r); /* both must be integers */
+#else
if (ttisinteger(l)) {
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))