Module Name:    src
Committed By:   martin
Date:           Sun Mar 13 12:08:24 UTC 2016

Modified Files:
        src/external/mit/lua/dist/src [netbsd-7]: lvm.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #1139):
        external/mit/lua/dist/src/lvm.c: revision 1.8

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.3.2.3 -r1.3.2.4 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.3.2.3 src/external/mit/lua/dist/src/lvm.c:1.3.2.4
--- src/external/mit/lua/dist/src/lvm.c:1.3.2.3	Mon Nov 16 11:14:48 2015
+++ src/external/mit/lua/dist/src/lvm.c	Sun Mar 13 12:08:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: lvm.c,v 1.3.2.3 2015/11/16 11:14:48 msaitoh Exp $	*/
+/*	$NetBSD: lvm.c,v 1.3.2.4 2016/03/13 12:08:24 martin 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))

Reply via email to