Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/xcalc/dist initial import of xcalc-1.1.0



details:   https://anonhg.NetBSD.org/xsrc/rev/151d797df1f0
branches:  trunk
changeset: 10312:151d797df1f0
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Jul 08 20:37:50 2019 +0000

description:
initial import of xcalc-1.1.0

diffstat:

 external/mit/xcalc/dist/ChangeLog          |   83 ++++++++++++
 external/mit/xcalc/dist/Makefile.am        |    2 +-
 external/mit/xcalc/dist/Makefile.in        |    2 +-
 external/mit/xcalc/dist/actions.c          |  101 ++++++++++++++-
 external/mit/xcalc/dist/app-defaults/XCalc |  192 +++++++++++++++++++++-------
 external/mit/xcalc/dist/configure          |   20 +-
 external/mit/xcalc/dist/configure.ac       |    2 +-
 external/mit/xcalc/dist/man/xcalc.man      |   46 ++++++-
 external/mit/xcalc/dist/math.c             |  185 ++++++++++++++++++++++-----
 external/mit/xcalc/dist/xcalc.c            |   25 ++-
 external/mit/xcalc/dist/xcalc.h            |   19 ++
 11 files changed, 567 insertions(+), 110 deletions(-)

diffs (truncated from 1278 to 300 lines):

diff -r 5818910fdd54 -r 151d797df1f0 external/mit/xcalc/dist/ChangeLog
--- a/external/mit/xcalc/dist/ChangeLog Mon Jul 08 20:37:48 2019 +0000
+++ b/external/mit/xcalc/dist/ChangeLog Mon Jul 08 20:37:50 2019 +0000
@@ -1,3 +1,86 @@
+commit df1721c44e0b357f4d8ae80247861b4a6f7a7bbb
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Sun Jun 9 13:44:24 2019 -0700
+
+    xcalc 1.1.0
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 74a71638ace07252e85106d87f80a62b1f07280f
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Sat Jun 1 17:33:44 2019 -0700
+
+    Fix -Wsign-compare warning in quit() function
+    
+    Reported by gcc 7.3:
+    actions.c: In function â??quitâ??:
+    actions.c:414:60: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
+         if (ev->type == ClientMessage && ev->xclient.data.l[0] != wm_delete_window)
+                                                                ^~
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 012115650d15697e1cdc13edf770ac9775b108f4
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Sat Jun 1 17:29:15 2019 -0700
+
+    Fix -Wsign-compare warning in Syntax() function
+    
+    Reported by gcc 7.3:
+    xcalc.c: In function â??Syntaxâ??:
+    xcalc.c:322:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
+         for (i=0; i < XtNumber(Options); i++)
+                     ^
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 7a04d51cb90b9a314eea117bc36fedb2bfaab516
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Sat Jun 1 17:24:20 2019 -0700
+
+    Pass -D_CONST_X_STRING to make libXt declare String as const char *
+    
+    Clears up 58 of 62 gcc -Wdiscarded-qualifiers warnings in the xcalc build
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit 519e35d2c5649a995d39ee26e39809a3b7ffabc9
+Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+Date:   Sat Jun 1 17:16:11 2019 -0700
+
+    Add bitwise ops and base conversion (DEC/OCT/HEX) to man page
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
+
+commit c4f1bdb16b560d813e6ded83c2d7a4f4d280a90a
+Author: Tim Hentenaar <tim%hentenaar.com@localhost>
+Date:   Sat Mar 22 02:47:33 2014 +0100
+
+    Add bitwise ops and base conversion (DEC/OCT/HEX) in TI mode
+    
+    These operations implicitly truncate their parameters, and result to
+    integers:
+    
+    * not
+    * and
+    * or
+    * xor
+    * shl
+    * shr
+    * mod
+    * trunc
+    
+    Base 2 was left out of the base conversion code intentionally as it
+    would require making the UI at least one third wider.
+    
+    Attempts to change base with negative values will simply display
+    "error." Note that with larger numbers, the result may be inaccurate
+    due to rounding.
+    
+    I've also bound the Return key to the equal() action.
+    
+    Signed-off-by: Tim Hentenaar <tim%hentenaar.com@localhost>
+
 commit be5114cebfdc29788cf038d349c0ed6cce4bb536
 Author: Alan Coopersmith <alan.coopersmith%oracle.com@localhost>
 Date:   Sun Feb 17 13:50:58 2019 -0800
diff -r 5818910fdd54 -r 151d797df1f0 external/mit/xcalc/dist/Makefile.am
--- a/external/mit/xcalc/dist/Makefile.am       Mon Jul 08 20:37:48 2019 +0000
+++ b/external/mit/xcalc/dist/Makefile.am       Mon Jul 08 20:37:50 2019 +0000
@@ -22,7 +22,7 @@
 SUBDIRS = man
 bin_PROGRAMS = xcalc
 
-AM_CFLAGS = $(XCALC_CFLAGS) $(CWARNFLAGS)
+AM_CFLAGS = $(XCALC_CFLAGS) $(CWARNFLAGS) -D_CONST_X_STRING
 xcalc_LDADD = $(XCALC_LIBS) -lm
 
 xcalc_SOURCES =        \
diff -r 5818910fdd54 -r 151d797df1f0 external/mit/xcalc/dist/Makefile.in
--- a/external/mit/xcalc/dist/Makefile.in       Mon Jul 08 20:37:48 2019 +0000
+++ b/external/mit/xcalc/dist/Makefile.in       Mon Jul 08 20:37:50 2019 +0000
@@ -401,7 +401,7 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = man
-AM_CFLAGS = $(XCALC_CFLAGS) $(CWARNFLAGS)
+AM_CFLAGS = $(XCALC_CFLAGS) $(CWARNFLAGS) -D_CONST_X_STRING
 xcalc_LDADD = $(XCALC_LIBS) -lm
 xcalc_SOURCES = \
         actions.c \
diff -r 5818910fdd54 -r 151d797df1f0 external/mit/xcalc/dist/actions.c
--- a/external/mit/xcalc/dist/actions.c Mon Jul 08 20:37:48 2019 +0000
+++ b/external/mit/xcalc/dist/actions.c Mon Jul 08 20:37:50 2019 +0000
@@ -46,7 +46,9 @@
 #endif
 
 static void add(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void and(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void back(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void base(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void bell(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void clearit(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void cosine(Widget w, XEvent *ev, String *vector, Cardinal *count);
@@ -63,11 +65,14 @@
 static void inverse(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void leftParen(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void logarithm(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void mod(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void multiply(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void naturalLog(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void negate(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void nop(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void not(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void off(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void or(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void pi(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void power(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void quit(Widget w, XEvent *ev, String *vector, Cardinal *count);
@@ -77,6 +82,8 @@
 static void roll(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void scientific(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void selection(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void shl(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void shr(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void sine(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void square(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void squareRoot(Widget w, XEvent *ev, String *vector, Cardinal *count);
@@ -85,6 +92,8 @@
 static void sum(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void tangent(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void tenpower(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void xtrunc(Widget w, XEvent *ev, String *vector, Cardinal *count);
+static void xor(Widget w, XEvent *ev, String *vector, Cardinal *count);
 static void XexchangeY(Widget w, XEvent *ev, String *vector, Cardinal *count);
 
 /*
@@ -93,7 +102,9 @@
 
 XtActionsRec   Actions[] = {
 {"add",                add},           /* addition */
+{"and",                and},           /* bitwise and */
 {"back",       back},          /* HP-specific backspace */
+{"base",       base},          /* base conversion */
 {"bell",       bell},          /* ring bell */
 {"clear",      clearit},       /* TI-specific clear calculator state */
 {"cosine",     cosine},        /* trigonometric function cosine */
@@ -110,11 +121,14 @@
 {"inverse",    inverse},       /* inverse */
 {"leftParen",  leftParen},     /* TI-specific left parenthesis */
 {"logarithm",  logarithm},     /* logarithm base 10 */
+{"mod",                mod},           /* modulus */
 {"multiply",   multiply},      /* multiplication */
 {"naturalLog", naturalLog},    /* natural logarithm base e */
 {"negate",     negate},        /* change sign */
 {"nop",                nop},           /* no operation, rings bell */
+{"not",                not},           /* bitwise not */
 {"off",                off},           /* clear state */
+{"or",         or},            /* bitwise or */
 {"pi",         pi},            /* the number pi */
 {"power",      power},         /* raise to an arbitrary power */
 {"quit",       quit},          /* quit */
@@ -124,6 +138,8 @@
 {"roll",       roll},          /* HP-specific roll stack */
 {"scientific", scientific},    /* scientfic notation (EE) */
 {"selection",  selection},     /* copy selection */
+{"shl",                shl},           /* arithmetic shift left */
+{"shr",                shr},           /* arithmetic shift right */
 {"sine",       sine},          /* trigonometric function sine */
 {"square",     square},        /* square */
 {"squareRoot", squareRoot},    /* square root */
@@ -132,6 +148,8 @@
 {"sum",                sum},           /* memory summation */
 {"tangent",    tangent},       /* trigonometric function tangent */
 {"tenpower",   tenpower},      /* 10 raised to to an arbitrary power */
+{"trunc",      xtrunc},        /* truncate to integer */
+{"xor",                xor},           /* bitwise xor */
 {"XexchangeY", XexchangeY}     /* HP-specific exchange X and Y registers */
 };
 
@@ -146,6 +164,14 @@
 }
 
 /*ARGSUSED*/
+static void and(Widget w, XEvent *ev, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kAND);
+    rpn ? twof(kAND) : twoop(kAND);
+    post_op();
+}
+
+/*ARGSUSED*/
 static void back(Widget w, XEvent *ev, String *vector, Cardinal *count)
 {
     XCALC_PRE_OP(kBKSP);
@@ -154,6 +180,14 @@
 }
 
 /*ARGSUSED*/
+static void base(Widget w, XEvent *ev, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kBASE);
+    change_base();
+    post_op();
+}
+
+/*ARGSUSED*/
 static void bell(Widget w, XEvent *ev, String *vector, Cardinal *count)
 {
     ringbell();
@@ -196,6 +230,7 @@
 {
     switch (vector[0][0])
     {
+      case '0': XCALC_PRE_OP(kZERO); numeric(kZERO); break;
       case '1':        XCALC_PRE_OP(kONE); numeric(kONE); break;
       case '2': XCALC_PRE_OP(kTWO); numeric(kTWO); break;
       case '3': XCALC_PRE_OP(kTHREE); numeric(kTHREE); break;
@@ -205,7 +240,12 @@
       case '7': XCALC_PRE_OP(kSEVEN); numeric(kSEVEN); break;
       case '8': XCALC_PRE_OP(kEIGHT); numeric(kEIGHT); break;
       case '9': XCALC_PRE_OP(kNINE); numeric(kNINE); break;
-      case '0': XCALC_PRE_OP(kZERO); numeric(kZERO); break;
+      case 'A': XCALC_PRE_OP(kxA); numeric(kxA); break;
+      case 'B': XCALC_PRE_OP(kxB); numeric(kxB); break;
+      case 'C': XCALC_PRE_OP(kxC); numeric(kxC); break;
+      case 'D': XCALC_PRE_OP(kxD); numeric(kxD); break;
+      case 'E': XCALC_PRE_OP(kxE); numeric(kxE); break;
+      case 'F': XCALC_PRE_OP(kxF); numeric(kxF); break;
     }
     post_op();
 }
@@ -291,6 +331,14 @@
 }
 
 /*ARGSUSED*/
+static void mod(Widget w, XEvent *ev, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kMOD);
+    rpn ? twof(kMOD) : twoop(kMOD);
+    post_op();
+}
+
+/*ARGSUSED*/
 static void multiply(Widget w, XEvent *ev, String *vector, Cardinal *count)
 {
     XCALC_PRE_OP(kMUL);
@@ -321,6 +369,14 @@
 }
 
 /*ARGSUSED*/
+static void not(Widget w, XEvent *ev, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kNOT);
+    oneop(kNOT);
+    post_op();
+}
+
+/*ARGSUSED*/
 static void off(Widget w, XEvent *ev, String *vector, Cardinal *count)
 {
     XCALC_PRE_OP(kOFF);
@@ -329,6 +385,14 @@
 }
 
 /*ARGSUSED*/
+static void or(Widget w, XEvent *ev, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kOR);
+    rpn ? twof(kOR) : twoop(kOR);
+    post_op();
+}
+
+/*ARGSUSED*/
 static void pi(Widget w, XEvent *ev, String *vector, Cardinal *count)
 {
     XCALC_PRE_OP(kPI);



Home | Main Index | Thread Index | Old Index