Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Sep 2019 09:04:48 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351837 - head/stand/ficl
Message-ID:  <201909050904.x8594m8h010007@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Thu Sep  5 09:04:48 2019
New Revision: 351837
URL: https://svnweb.freebsd.org/changeset/base/351837

Log:
  ficl: add uIsGreater word
  
  For some reason we have u< but not u>, fix it.

Modified:
  head/stand/ficl/words.c

Modified: head/stand/ficl/words.c
==============================================================================
--- head/stand/ficl/words.c	Thu Sep  5 03:16:14 2019	(r351836)
+++ head/stand/ficl/words.c	Thu Sep  5 09:04:48 2019	(r351837)
@@ -1930,6 +1930,18 @@ static void isGreater(FICL_VM *pVM)
     return;
 }
 
+static void uIsGreater(FICL_VM *pVM)
+{
+    FICL_UNS u1, u2;
+#if FICL_ROBUST > 1
+    vmCheckStack(pVM, 2, 1);
+#endif
+    u2 = stackPopUNS(pVM->pStack);
+    u1 = stackPopUNS(pVM->pStack);
+    PUSHINT(FICL_BOOL(u1 > u2));
+    return;
+}
+
 static void bitwiseAnd(FICL_VM *pVM)
 {
     CELL x, y;
@@ -4975,6 +4987,7 @@ void ficlCompileCore(FICL_SYSTEM *pSys)
     dictAppendWord(dp, "type",      type,           FW_DEFAULT);
     dictAppendWord(dp, "u.",        uDot,           FW_DEFAULT);
     dictAppendWord(dp, "u<",        uIsLess,        FW_DEFAULT);
+    dictAppendWord(dp, "u>",        uIsGreater,     FW_DEFAULT);
     dictAppendWord(dp, "um*",       umStar,         FW_DEFAULT);
     dictAppendWord(dp, "um/mod",    umSlashMod,     FW_DEFAULT);
     dictAppendWord(dp, "unloop",    unloopCo,       FW_COMPILE);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909050904.x8594m8h010007>