summaryrefslogtreecommitdiff
path: root/usr.sbin/mopd
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-07-29 07:18:33 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-07-29 07:18:33 +0000
commitfa5adad6e0ca0c2ffcd4bfcd28753788049b59b0 (patch)
treed1e1e61374c010bc3c620d1c8eb2f48474ddbc45 /usr.sbin/mopd
parentc8230b4a2770b067b3ad9762f5124b18d5db837c (diff)
change if ((a == b)) to if (a == b); silences noisy on-by-default
"equality comparison with extraneous parentheses [-Wparentheses-equality]" clang warning. OK deraadt, kettenis
Diffstat (limited to 'usr.sbin/mopd')
-rw-r--r--usr.sbin/mopd/common/dl.c4
-rw-r--r--usr.sbin/mopd/common/print.c10
-rw-r--r--usr.sbin/mopd/common/put.c4
-rw-r--r--usr.sbin/mopd/common/rc.c12
-rw-r--r--usr.sbin/mopd/mopd/process.c34
5 files changed, 32 insertions, 32 deletions
diff --git a/usr.sbin/mopd/common/dl.c b/usr.sbin/mopd/common/dl.c
index 3b7c616cde7..59d9ce2c90d 100644
--- a/usr.sbin/mopd/common/dl.c
+++ b/usr.sbin/mopd/common/dl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dl.c,v 1.10 2017/01/21 08:33:51 krw Exp $ */
+/* $OpenBSD: dl.c,v 1.11 2017/07/29 07:18:03 florian Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -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 a/usr.sbin/mopd/common/print.c b/usr.sbin/mopd/common/print.c
index 0b881938f73..1324c84f0ec 100644
--- a/usr.sbin/mopd/common/print.c
+++ b/usr.sbin/mopd/common/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.12 2009/10/27 23:59:52 deraadt Exp $ */
+/* $OpenBSD: print.c,v 1.13 2017/07/29 07:18:03 florian Exp $ */
/*
* Copyright (c) 1993-96 Mats O Jansson. All rights reserved.
@@ -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 a/usr.sbin/mopd/common/put.c b/usr.sbin/mopd/common/put.c
index 39da5d47293..ea3481886fd 100644
--- a/usr.sbin/mopd/common/put.c
+++ b/usr.sbin/mopd/common/put.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: put.c,v 1.8 2009/10/27 23:59:52 deraadt Exp $ */
+/* $OpenBSD: put.c,v 1.9 2017/07/29 07:18:03 florian Exp $ */
/*
* Copyright (c) 1993-2006 Mats O Jansson. All rights reserved.
@@ -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 a/usr.sbin/mopd/common/rc.c b/usr.sbin/mopd/common/rc.c
index 5a38ba4088f..3ee7f23f836 100644
--- a/usr.sbin/mopd/common/rc.c
+++ b/usr.sbin/mopd/common/rc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rc.c,v 1.8 2009/10/27 23:59:52 deraadt Exp $ */
+/* $OpenBSD: rc.c,v 1.9 2017/07/29 07:18:03 florian Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -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 a/usr.sbin/mopd/mopd/process.c b/usr.sbin/mopd/mopd/process.c
index f63ae1566c7..47add97436c 100644
--- a/usr.sbin/mopd/mopd/process.c
+++ b/usr.sbin/mopd/mopd/process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.c,v 1.21 2015/11/16 23:47:52 millert Exp $ */
+/* $OpenBSD: process.c,v 1.22 2017/07/29 07:18:03 florian Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -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);