From: Vitalii Demianets Date: Fri, 23 Sep 2011 10:03:32 +0000 (+0000) Subject: Make sparse (mostly) happy X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6ed0c4c23c4127c81d0e104105327600bcf0dc1;p=people%2Fms%2Fmstpd.git Make sparse (mostly) happy git-svn-id: http://svn.code.sf.net/p/mstpd/code/trunk@3 fbe50366-0c72-4402-a84b-5d246361dba7 --- diff --git a/bridge_track.c b/bridge_track.c index ba261ca..044fea1 100644 --- a/bridge_track.c +++ b/bridge_track.c @@ -29,6 +29,7 @@ #include #include "bridge_ctl.h" +#include "ctl_functions.h" #include "netif_utils.h" #include "packet.h" #include "log.h" diff --git a/ctl_main.c b/ctl_main.c index 863e9a8..d4b3e60 100644 --- a/ctl_main.c +++ b/ctl_main.c @@ -1010,7 +1010,7 @@ static void command_helpall(void) } } -static void help() +static void help(void) { printf("Usage: mstpctl [commands]\n"); printf("commands:\n"); diff --git a/mstp.c b/mstp.c index 0ab4886..b8f90af 100644 --- a/mstp.c +++ b/mstp.c @@ -1583,7 +1583,7 @@ static port_info_t rcvInfo(per_tree_port_t *ptp) /* 13.26.6.NOTE: A Configuration BPDU implicitly conveys a * Designated Port Role */ roleIsDesignated = true; - assign(mPri->IntRootPathCost, 0u); + assign(mPri->IntRootPathCost, __constant_cpu_to_be32(0)); assign(mPri->DesignatedBridgeID, b->cistRRootID); /* messageTimes.remainingHops */ assign(mTimes->remainingHops, prt->bridge->MaxHops); diff --git a/netif_utils.c b/netif_utils.c index da26a6f..2ca251e 100644 --- a/netif_utils.c +++ b/netif_utils.c @@ -38,7 +38,7 @@ #include "log.h" -int netsock = -1; +static int netsock = -1; int netsock_init(void) { diff --git a/packet.c b/packet.c index 0c08ae7..c1d4ff5 100644 --- a/packet.c +++ b/packet.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "epoll_loop.h" #include "netif_utils.h" @@ -66,7 +67,7 @@ void packet_send(int ifindex, const struct iovec *iov, int iov_count, int len) struct sockaddr_ll sl = { .sll_family = AF_PACKET, - .sll_protocol = htons(ETH_P_802_2), + .sll_protocol = __constant_cpu_to_be16(ETH_P_802_2), .sll_ifindex = ifindex, .sll_halen = ETH_ALEN, };