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 no floating point in the kernel, a...



details:   https://anonhg.NetBSD.org/src/rev/740b7115f0b4
branches:  trunk
changeset: 340934:740b7115f0b4
user:      mbalmer <mbalmer%NetBSD.org@localhost>
date:      Sun Oct 11 09:21:15 2015 +0000

description:
no floating point in the kernel, also make sure we always return an int

diffstat:

 external/mit/lua/dist/src/lvm.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (51 lines):

diff -r 55289a40175c -r 740b7115f0b4 external/mit/lua/dist/src/lvm.c
--- a/external/mit/lua/dist/src/lvm.c   Sun Oct 11 09:06:21 2015 +0000
+++ b/external/mit/lua/dist/src/lvm.c   Sun Oct 11 09:21:15 2015 +0000
@@ -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 @@
 ** 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 @@
 ** 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))



Home | Main Index | Thread Index | Old Index