From: Vincent Bernat Date: Sun, 25 Apr 2021 17:08:26 +0000 (+0200) Subject: daemon: fix some use of "if defined" X-Git-Tag: 1.0.11~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe4273974c10a7abf4795c4091bea550e15f71b2;p=thirdparty%2Flldpd.git daemon: fix some use of "if defined" `#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). --- diff --git a/src/daemon/interfaces-bsd.c b/src/daemon/interfaces-bsd.c index 6b7c320c..f21bad1a 100644 --- a/src/daemon/interfaces-bsd.c +++ b/src/daemon/interfaces-bsd.c @@ -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), diff --git a/src/daemon/lldpd.h b/src/daemon/lldpd.h index c3384842..ed538c26 100644 --- a/src/daemon/lldpd.h +++ b/src/daemon/lldpd.h @@ -38,7 +38,7 @@ #include #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 diff --git a/src/daemon/priv.c b/src/daemon/priv.c index a1a0bf95..b8ebd39a 100644 --- a/src/daemon/priv.c +++ b/src/daemon/priv.c @@ -43,7 +43,7 @@ #include #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 #endif #if defined HOST_OS_SOLARIS diff --git a/src/daemon/protocols/cdp.c b/src/daemon/protocols/cdp.c index 7e99919e..06da59ec 100644 --- a/src/daemon/protocols/cdp.c +++ b/src/daemon/protocols/cdp.c @@ -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 #include @@ -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 && diff --git a/src/lldpd-structs.h b/src/lldpd-structs.h index 88d347c1..390b10f4 100644 --- a/src/lldpd-structs.h +++ b/src/lldpd-structs.h @@ -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