garbage collect a few functions that are not really needed; from kshe
authorotto <otto@openbsd.org>
Tue, 28 Nov 2017 08:03:01 +0000 (08:03 +0000)
committerotto <otto@openbsd.org>
Tue, 28 Nov 2017 08:03:01 +0000 (08:03 +0000)
usr.bin/dc/bcode.c

index e38c7a6..760d816 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: bcode.c,v 1.52 2017/11/27 21:32:33 tom Exp $  */
+/*     $OpenBSD: bcode.c,v 1.53 2017/11/28 08:03:01 otto Exp $ */
 
 /*
  * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -102,11 +102,8 @@ static void                equal_numbers(void);
 static void            less_numbers(void);
 static void            lesseq_numbers(void);
 static void            equal(void);
-static void            not_equal(void);
 static void            less(void);
-static void            not_less(void);
 static void            greater(void);
-static void            not_greater(void);
 static void            not_compare(void);
 static bool            compare_numbers(enum bcode_compare, struct number *,
                            struct number *);
@@ -1204,7 +1201,7 @@ bexp(void)
                negate(p);
                rscale = bmachine.scale;
        } else {
-               /* Posix bc says min(a.scale * b, max(a.scale, scale) */
+               /* Posix bc says min(a.scale * b, max(a.scale, scale)) */
                u_long  b;
                u_int   m;
 
@@ -1410,12 +1407,6 @@ lesseq_numbers(void)
        push_number(r);
 }
 
-static void
-not_equal(void)
-{
-       compare(BCODE_NOT_EQUAL);
-}
-
 static void
 less(void)
 {
@@ -1427,39 +1418,27 @@ not_compare(void)
 {
        switch (readch()) {
        case '<':
-               not_less();
+               compare(BCODE_NOT_LESS);
                break;
        case '>':
-               not_greater();
+               compare(BCODE_NOT_GREATER);
                break;
        case '=':
-               not_equal();
+               compare(BCODE_NOT_EQUAL);
                break;
        default:
                unreadch();
-               (void)fprintf(stderr, "! command is deprecated\n");
+               warnx("! command is deprecated\n");
                break;
        }
 }
 
-static void
-not_less(void)
-{
-       compare(BCODE_NOT_LESS);
-}
-
 static void
 greater(void)
 {
        compare(BCODE_GREATER);
 }
 
-static void
-not_greater(void)
-{
-       compare(BCODE_NOT_GREATER);
-}
-
 static bool
 compare_numbers(enum bcode_compare type, struct number *a, struct number *b)
 {