--- embedaddon/mpd/src/udp.c 2016/11/01 09:56:12 1.1.1.2 +++ embedaddon/mpd/src/udp.c 2021/03/17 00:39:23 1.1.1.3 @@ -89,7 +89,7 @@ static void UdpDoClose(Link l); static void UdpShutdown(Link l); - static int UdpSetCommand(Context ctx, int ac, char *av[], void *arg); + static int UdpSetCommand(Context ctx, int ac, const char *const av[], const void *arg); static void UdpNodeUpdate(Link l); static int UdpListen(Link l); static int UdpUnListen(Link l); @@ -129,7 +129,7 @@ UdpSetCommand, NULL, 2, (void *) SET_ENABLE }, { "disable [opt ...]", "Disable option", UdpSetCommand, NULL, 2, (void *) SET_DISABLE }, - { NULL }, + { NULL, NULL, NULL, NULL, 0, NULL }, }; struct UdpIf { @@ -139,16 +139,13 @@ struct UdpIf { int csock; /* netgraph Control socket */ EventRef ctrlEvent; /* listen for ctrl messages */ }; -struct UdpIf UdpIfs[UDP_MAXPARENTIFS]; +static struct UdpIf UdpIfs[UDP_MAXPARENTIFS]; -int UdpListenUpdateSheduled=0; -struct pppTimer UdpListenUpdateTimer; - /* * INTERNAL VARIABLES */ - static struct confinfo gConfList[] = { + static const struct confinfo gConfList[] = { { 0, UDP_CONF_RESOLVE_ONCE, "resolve-once" }, { 0, 0, NULL }, }; @@ -272,7 +269,7 @@ UdpOpen(Link l) /* Setsockopt socket. */ ksso->level=SOL_SOCKET; ksso->name=SO_REUSEPORT; - ((int *)(ksso->value))[0]=1; + ((int *)(void *)(ksso->value))[0]=1; if (NgSendMsg(csock, path, NGM_KSOCKET_COOKIE, NGM_KSOCKET_SETOPT, &u, sizeof(u)) < 0) { Perror("[%s] can't setsockopt() %s node", @@ -358,10 +355,10 @@ UdpClose(Link l) static void UdpShutdown(Link l) { - UdpInfo const pi = (UdpInfo) l->info; + UdpInfo const pi = (UdpInfo) l->info; - if (pi->conf.fqdn_peer_addr) - Freee(pi->conf.fqdn_peer_addr); + if (pi->conf.fqdn_peer_addr) + Freee(pi->conf.fqdn_peer_addr); UdpDoClose(l); UdpUnListen(l); @@ -416,6 +413,7 @@ UdpOrigination(Link l) static int UdpIsSync(Link l) { + (void)l; return (1); } @@ -734,7 +732,7 @@ UdpNodeUpdate(Link l) */ static int -UdpSetCommand(Context ctx, int ac, char *av[], void *arg) +UdpSetCommand(Context ctx, int ac, const char *const av[], const void *arg) { UdpInfo const pi = (UdpInfo) ctx->lnk->info; char **fqdn_peer_addr = &pi->conf.fqdn_peer_addr;