]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon: fix some use of "if defined"
authorVincent Bernat <vincent@bernat.ch>
Sun, 25 Apr 2021 17:08:26 +0000 (19:08 +0200)
committerVincent Bernat <vincent@bernat.ch>
Sun, 25 Apr 2021 17:08:26 +0000 (19:08 +0200)
`#if defined HOST_OS_FREEBSD || HOST_OS_NETBSD` is not the same as
`#if defined HOST_OS_FREEBSD || defined HOST_OS_NETBSD`. This doesn't
really matter in our case, but for consistency, fix these cases. Also,
don't use parentheses as they are not useful in our case (or we should
put them everywhere).

src/daemon/interfaces-bsd.c
src/daemon/lldpd.h
src/daemon/priv.c
src/daemon/protocols/cdp.c
src/lldpd-structs.h

index 6b7c320c31f118fafa3d0ed7ccf10c98f63c58c9..f21bad1a6f4ecb0dd38d7c5f957915b662755c2e 100644 (file)
@@ -78,7 +78,7 @@ ifbsd_check_bridge(struct lldpd *cfg,
                .ifbic_req = req
        };
 
-#if defined HOST_OS_FREEBSD || defined HOST_OS_NETBSD || defined HOST_OS_OSX || HOST_OS_DRAGONFLY
+#if defined HOST_OS_FREEBSD || defined HOST_OS_NETBSD || defined HOST_OS_OSX || defined HOST_OS_DRAGONFLY
        struct ifdrv ifd = {
                .ifd_cmd = BRDGGIFS,
                .ifd_len = sizeof(bifc),
index c338484276734024cecfd175067ef5d26ccbd3bc..ed538c260eac575c2ddb6ba30ced53e99d4f45e6 100644 (file)
@@ -38,7 +38,7 @@
 #include <sys/un.h>
 
 #include "lldp-tlv.h"
-#if defined (ENABLE_CDP) || defined (ENABLE_FDP)
+#if defined ENABLE_CDP || defined ENABLE_FDP
 #  include "protocols/cdp.h"
 #endif
 #ifdef ENABLE_SONMP
@@ -142,7 +142,7 @@ int  cdpv2_send(PROTO_SEND_SIG);
 int     cdpv1_guess(PROTO_GUESS_SIG);
 int     cdpv2_guess(PROTO_GUESS_SIG);
 #endif
-#if defined (ENABLE_CDP) || defined (ENABLE_FDP)
+#if defined ENABLE_CDP || defined ENABLE_FDP
 int     cdp_decode(PROTO_DECODE_SIG);
 #endif
 #ifdef ENABLE_FDP
index a1a0bf951f92ed2f8af6b8bf1f0e0cefc5aefcb0..b8ebd39adfeb5cd41943d388c5d83a003454578f 100644 (file)
@@ -43,7 +43,7 @@
 #include <sys/prctl.h>
 #endif
 
-#if defined HOST_OS_FREEBSD || HOST_OS_OSX || HOST_OS_DRAGONFLY
+#if defined HOST_OS_FREEBSD || defined HOST_OS_OSX || defined HOST_OS_DRAGONFLY
 # include <net/if_dl.h>
 #endif
 #if defined HOST_OS_SOLARIS
index 7e99919e45a85f7d6168dfbe2f97e7dba0a52aa5..06da59ecf41751d782132189c91355af2220b683 100644 (file)
@@ -30,7 +30,7 @@
 #define CDP_SWITCH_POE_CLASS_4_OFFSET     45  /* 4.5W  max loss from cable */
 #define CDP_SWITCH_POE_CLASS_3_OFFSET     24  /* 2.4W  max loss from cable */
 
-#if defined (ENABLE_CDP) || defined (ENABLE_FDP)
+#if defined ENABLE_CDP || defined ENABLE_FDP
 
 #include <stdio.h>
 #include <unistd.h>
@@ -256,7 +256,7 @@ cdp_send(struct lldpd *global,
                      POKE_END_CDP_TLV))
                        goto toobig;
        }
-#elif defined(ENABLE_LLDPMED)
+#elif defined ENABLE_LLDPMED
        /* Power use */
        if ((version >= 2) &&
            port->p_med_cap_enabled &&
index 88d347c1cea679eed491405453d600040e50b472..390b10f45917edfff13e03d3894a6e39030db663 100644 (file)
@@ -145,7 +145,7 @@ struct lldpd_dot3_power {
 MARSHAL(lldpd_dot3_power);
 #endif
 
-#if defined (ENABLE_CDP) || defined (ENABLE_FDP)
+#if defined ENABLE_CDP || defined ENABLE_FDP
 struct cdpv2_power {
        u_int16_t request_id;
        u_int16_t management_id;
@@ -291,7 +291,7 @@ struct lldpd_port {
        struct lldpd_med_power   p_med_power;
 #endif
 
-#if defined (ENABLE_CDP) || defined (ENABLE_FDP)
+#if defined ENABLE_CDP || defined ENABLE_FDP
        struct cdpv2_power p_cdp_power;
 #endif