> Date: Fri, 28 Jul 2017 20:43:06 +0000
> From: Florian Obser <[email protected]>
>
> this silences
>
> cc -O2 -pipe -I/usr/src/usr.sbin/mopd/mopd -I/usr/src/usr.sbin/mopd/mopd/..
> -I/usr/src/usr.sbin/mopd/mopd/../common -Werror-implicit-function-declaration
> -MD -MP -c /usr/src/usr.sbin/mopd/mopd/process.c
> /usr/src/usr.sbin/mopd/mopd/process.c:139:17: warning: equality comparison
> with extraneous parentheses [-Wparentheses-equality]
> if ((DebugFlag == DEBUG_ONELINE))
> ~~~~~~~~~~^~~~~~~~~~~~~~~~
>
> etc, which is pretty noisy
>
> OK?
ok kettenis@
> diff --git common/dl.c common/dl.c
> index 3b7c616cde7..043a7ed2064 100644
> --- common/dl.c
> +++ common/dl.c
> @@ -162,7 +162,7 @@ mopDumpDL(FILE *fd, u_char *pkt, int trans)
>
> tmpc = mopGetChar(pkt, &idx); /* Error */
> fprintf(fd, "Error : %02x (", tmpc);
> - if ((tmpc == 0))
> + if (tmpc == 0)
> fprintf(fd, "no error)\n");
> else
> fprintf(fd, "error)\n");
> diff --git common/print.c common/print.c
> index 0b881938f73..40988b84e83 100644
> --- common/print.c
> +++ common/print.c
> @@ -506,17 +506,17 @@ mopPrintInfo(FILE *fd, u_char *pkt, int *idx, u_short
> moplen, u_char mopcode,
> case MOP_K_INFO_SFID:
> tmpc = mopGetChar(pkt, idx);
> fprintf(fd, "Software ID : %02x ", tmpc);
> - if ((tmpc == 0))
> + if (tmpc == 0)
> fprintf(fd, "No software id");
> - if ((tmpc == 254)) {
> + if (tmpc == 254) {
> fprintf(fd, "Maintenance system");
> tmpc = 0;
> }
> - if ((tmpc == 255)) {
> + if (tmpc == 255) {
> fprintf(fd, "Standard operating system");
> tmpc = 0;
> }
> - if ((tmpc > 0)) {
> + if (tmpc > 0) {
> fprintf(fd, "'");
> for (i = 0; i < ((int) tmpc); i++)
> fprintf(fd, "%c",
> diff --git common/put.c common/put.c
> index 39da5d47293..fa4c7eaeeae 100644
> --- common/put.c
> +++ common/put.c
> @@ -80,7 +80,7 @@ mopPutTime(u_char *pkt, int *idx, time_t value)
> time_t tnow;
> struct tm *timenow;
>
> - if ((value == 0))
> + if (value == 0)
> tnow = time(NULL);
> else
> tnow = value;
> diff --git common/rc.c common/rc.c
> index 5a38ba4088f..2269b4d9e50 100644
> --- common/rc.c
> +++ common/rc.c
> @@ -62,7 +62,7 @@ mopDumpRC(FILE *fd, u_char *pkt, int trans)
> break;
> case MOP_K_CODE_BOT:
>
> - if ((moplen == 5)) {
> + if (moplen == 5) {
> tmps = mopGetShort(pkt, &idx);
> fprintf(fd, "Verification : %04x\n", tmps);
> } else {
> @@ -97,17 +97,17 @@ mopDumpRC(FILE *fd, u_char *pkt, int trans)
>
> tmpc = mopGetChar(pkt, &idx); /* Software ID */
> fprintf(fd, "Software ID : %02x ", tmpc);
> - if ((tmpc == 0))
> + if (tmpc == 0)
> fprintf(fd, "No software id");
> - if ((tmpc == 254)) {
> + if (tmpc == 254) {
> fprintf(fd, "Maintenance system");
> tmpc = 0;
> }
> - if ((tmpc == 255)) {
> + if (tmpc == 255) {
> fprintf(fd, "Standard operating system");
> tmpc = 0;
> }
> - if ((tmpc > 0)) {
> + if (tmpc > 0) {
> fprintf(fd, "'");
> for (i = 0; i < ((int) tmpc); i++)
> fprintf(fd, "%c",
> diff --git mopd/process.c mopd/process.c
> index f63ae1566c7..2d6bc765840 100644
> --- mopd/process.c
> +++ mopd/process.c
> @@ -136,15 +136,15 @@ mopSendASV(u_char *dst, u_char *src, struct if_info
> *ii, int trans)
>
> mopPutLength(pkt, trans, idx);
>
> - if ((DebugFlag == DEBUG_ONELINE))
> + if (DebugFlag == DEBUG_ONELINE)
> mopPrintOneline(stdout, pkt, trans);
>
> - if ((DebugFlag >= DEBUG_HEADER)) {
> + if (DebugFlag >= DEBUG_HEADER) {
> mopPrintHeader(stdout, pkt, trans);
> mopPrintMopHeader(stdout, pkt, trans);
> }
>
> - if ((DebugFlag >= DEBUG_INFO))
> + if (DebugFlag >= DEBUG_INFO)
> mopDumpDL(stdout, pkt, trans);
>
> if (pfWrite(ii->fd, pkt, idx, trans) != idx)
> @@ -213,15 +213,15 @@ mopStartLoad(u_char *dst, u_char *src, struct dllist
> *dl_rpr, int trans)
>
> mopPutLength(pkt, trans, idx);
>
> - if ((DebugFlag == DEBUG_ONELINE))
> + if (DebugFlag == DEBUG_ONELINE)
> mopPrintOneline(stdout, pkt, trans);
>
> - if ((DebugFlag >= DEBUG_HEADER)) {
> + if (DebugFlag >= DEBUG_HEADER) {
> mopPrintHeader(stdout, pkt, trans);
> mopPrintMopHeader(stdout, pkt, trans);
> }
>
> - if ((DebugFlag >= DEBUG_INFO))
> + if (DebugFlag >= DEBUG_INFO)
> mopDumpDL(stdout, pkt, trans);
>
> if (pfWrite(dllist[slot].ii->fd, pkt, idx, trans) != idx)
> @@ -252,7 +252,7 @@ mopNextLoad(u_char *dst, u_char *src, u_char new_count,
> int trans)
> if (slot == -1)
> return;
>
> - if ((new_count == ((dllist[slot].count+1) % 256))) {
> + if (new_count == ((dllist[slot].count+1) % 256)) {
> dllist[slot].loadaddr = dllist[slot].nloadaddr;
> dllist[slot].count = new_count;
> } else
> @@ -318,15 +318,15 @@ mopNextLoad(u_char *dst, u_char *src, u_char new_count,
> int trans)
> }
> }
>
> - if ((DebugFlag == DEBUG_ONELINE))
> + if (DebugFlag == DEBUG_ONELINE)
> mopPrintOneline(stdout, pkt, trans);
>
> - if ((DebugFlag >= DEBUG_HEADER)) {
> + if (DebugFlag >= DEBUG_HEADER) {
> mopPrintHeader(stdout, pkt, trans);
> mopPrintMopHeader(stdout, pkt, trans);
> }
>
> - if ((DebugFlag >= DEBUG_INFO))
> + if (DebugFlag >= DEBUG_INFO)
> mopDumpDL(stdout, pkt, trans);
>
> if (pfWrite(dllist[slot].ii->fd, pkt, idx, trans) != idx)
> @@ -348,15 +348,15 @@ mopProcessDL(FILE *fd, struct if_info *ii, u_char *pkt,
> int *idx, u_char *dst,
> struct dllist dl, *dl_rpr;
> u_char load;
>
> - if ((DebugFlag == DEBUG_ONELINE))
> + if (DebugFlag == DEBUG_ONELINE)
> mopPrintOneline(stdout, pkt, trans);
>
> - if ((DebugFlag >= DEBUG_HEADER)) {
> + if (DebugFlag >= DEBUG_HEADER) {
> mopPrintHeader(stdout, pkt, trans);
> mopPrintMopHeader(stdout, pkt, trans);
> }
>
> - if ((DebugFlag >= DEBUG_INFO))
> + if (DebugFlag >= DEBUG_INFO)
> mopDumpDL(stdout, pkt, trans);
>
> moplen = mopGetLength(pkt, trans);
> @@ -472,15 +472,15 @@ mopProcessRC(FILE *fd, struct if_info *ii, u_char *pkt,
> int *idx, u_char dst,
> u_char mopcode;
> struct dllist dl, *dl_rpr;
>
> - if ((DebugFlag == DEBUG_ONELINE))
> + if (DebugFlag == DEBUG_ONELINE)
> mopPrintOneline(stdout, pkt, trans);
>
> - if ((DebugFlag >= DEBUG_HEADER)) {
> + if (DebugFlag >= DEBUG_HEADER) {
> mopPrintHeader(stdout, pkt, trans);
> mopPrintMopHeader(stdout, pkt, trans);
> }
>
> - if ((DebugFlag >= DEBUG_INFO))
> + if (DebugFlag >= DEBUG_INFO)
> mopDumpRC(stdout, pkt, trans);
>
> moplen = mopGetLength(pkt, trans);
>
> --
> I'm not entirely sure you are real.
>
>