Module Name:    src
Committed By:   rillig
Date:           Tue Jan  5 23:07:49 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: d_long_double_int.exp msg_124.exp
            msg_230.exp
        src/usr.bin/xlint/lint1: ops.def

Log Message:
lint: clean up symbolic operator names that are used in the messages

Including the "p" in the symbolic operator names was questionable, for
several reasons:

1.  The "p" could be taken to mean an actual variable name, which is
    confusing if the function doesn't have such a variable, or even more
    so if the line contains an unrelated variable called "p".

2.  For the binary operators, having the "p" mentioned on both sides of
    the operator (such as in "p + p") wrongly suggested that both
    operands of the expression were the same.

3.  The name "p" often stands for a pointer.  Most of the operators
    don't accept pointers, therefore the name was misleading.

For these reasons, the "p" was removed from the symbolic name of all
operators.  This makes several pairs of operators indistinguishable:

    INCBEF == INCAFT
    DECBEF == DECAFT
    UPLUS == PLUS
    UMINUS == MINUS
    STAR == MULT
    AMPER == AND

This is not expected to create any confusion since C programmers are
expected to know these double meanings.

The symbolic names for SHLASS and SHRASS were missing the '=' before.
This was added since omitting it was probably an oversight.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp \
    src/tests/usr.bin/xlint/lint1/msg_230.exp
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_124.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/lint1/ops.def

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/lint1/d_long_double_int.exp
diff -u src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.2 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.3
--- src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.2	Sun Jan  3 15:51:16 2021
+++ src/tests/usr.bin/xlint/lint1/d_long_double_int.exp	Tue Jan  5 23:07:49 2021
@@ -1 +1 @@
-(9): warning: illegal pointer combination (pointer to long double) and (pointer to long), op p == p [124]
+(9): warning: illegal pointer combination (pointer to long double) and (pointer to long), op == [124]
Index: src/tests/usr.bin/xlint/lint1/msg_230.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_230.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_230.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_230.exp:1.2	Sun Jan  3 15:35:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_230.exp	Tue Jan  5 23:07:49 2021
@@ -1,3 +1,3 @@
-msg_230.c(11): warning: comparison of unsigned char with 0, op p < p [162]
-msg_230.c(22): warning: nonportable character comparison, op p <= p [230]
-msg_230.c(23): warning: comparison of unsigned char with negative constant, op p <= p [162]
+msg_230.c(11): warning: comparison of unsigned char with 0, op < [162]
+msg_230.c(22): warning: nonportable character comparison, op <= [230]
+msg_230.c(23): warning: comparison of unsigned char with negative constant, op <= [162]

Index: src/tests/usr.bin/xlint/lint1/msg_124.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_124.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_124.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_124.exp:1.4	Sun Jan  3 15:55:18 2021
+++ src/tests/usr.bin/xlint/lint1/msg_124.exp	Tue Jan  5 23:07:49 2021
@@ -1,3 +1,3 @@
-msg_124.c(16): warning: illegal pointer combination (pointer to function(int) returning void) and (pointer to int), op p = p [124]
-msg_124.c(17): warning: illegal pointer combination (pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void) and (pointer to int), op p = p [124]
-msg_124.c(18): warning: illegal pointer combination (pointer to function(pointer to const char, ...) returning int) and (pointer to int), op p = p [124]
+msg_124.c(16): warning: illegal pointer combination (pointer to function(int) returning void) and (pointer to int), op = [124]
+msg_124.c(17): warning: illegal pointer combination (pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void) and (pointer to int), op = [124]
+msg_124.c(18): warning: illegal pointer combination (pointer to function(pointer to const char, ...) returning int) and (pointer to int), op = [124]

Index: src/usr.bin/xlint/lint1/ops.def
diff -u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