Reformat sockets.c using astylerc

This commit is contained in:
Dirk Ziegelmeier 2017-09-17 17:47:47 +02:00
parent fa33db1448
commit 438cfd3f14

View File

@ -2548,8 +2548,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt
break;
#endif /* LWIP_SO_RCVBUF */
#if LWIP_SO_LINGER
case SO_LINGER:
{
case SO_LINGER: {
s16_t conn_linger;
struct linger *linger = (struct linger *)optval;
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, struct linger);
@ -2908,8 +2907,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
/* SO_ERROR is get-only */
#if LWIP_SO_SNDTIMEO
case SO_SNDTIMEO:
{
case SO_SNDTIMEO: {
long ms_long;
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE);
ms_long = LWIP_SO_SNDRCVTIMEO_GET_MS(optval);
@ -2922,8 +2920,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
}
#endif /* LWIP_SO_SNDTIMEO */
#if LWIP_SO_RCVTIMEO
case SO_RCVTIMEO:
{
case SO_RCVTIMEO: {
long ms_long;
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE);
ms_long = LWIP_SO_SNDRCVTIMEO_GET_MS(optval);
@ -2942,8 +2939,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
break;
#endif /* LWIP_SO_RCVBUF */
#if LWIP_SO_LINGER
case SO_LINGER:
{
case SO_LINGER: {
const struct linger *linger = (const struct linger *)optval;
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, struct linger);
if (linger->l_onoff) {
@ -2979,8 +2975,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
}
break;
#endif /* LWIP_UDP */
case SO_BINDTODEVICE:
{
case SO_BINDTODEVICE: {
const struct ifreq *iface;
struct netif *n = NULL;
@ -2995,8 +2990,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
}
}
switch (NETCONNTYPE_GROUP(netconn_type(sock->conn)))
{
switch (NETCONNTYPE_GROUP(netconn_type(sock->conn))) {
#if LWIP_TCP
case NETCONN_TCP:
tcp_bind_netif(sock->conn->pcb.tcp, n);
@ -3056,8 +3050,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP);
udp_set_multicast_ttl(sock->conn->pcb.udp, (u8_t)(*(const u8_t *)optval));
break;
case IP_MULTICAST_IF:
{
case IP_MULTICAST_IF: {
ip4_addr_t if_addr;
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct in_addr, NETCONN_UDP);
inet_addr_to_ip4addr(&if_addr, (const struct in_addr *)optval);
@ -3075,8 +3068,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
#endif /* LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS && LWIP_UDP */
#if LWIP_IGMP
case IP_ADD_MEMBERSHIP:
case IP_DROP_MEMBERSHIP:
{
case IP_DROP_MEMBERSHIP: {
/* If this is a TCP or a RAW socket, ignore these options. */
err_t igmp_err;
const struct ip_mreq *imr = (const struct ip_mreq *)optval;
@ -3178,8 +3170,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
break;
#if LWIP_IPV6_MLD
case IPV6_JOIN_GROUP:
case IPV6_LEAVE_GROUP:
{
case IPV6_LEAVE_GROUP: {
/* If this is a TCP or a RAW socket, ignore these options. */
err_t mld6_err;
struct netif *netif;
@ -3525,8 +3516,7 @@ lwip_inet_pton(int af, const char *src, void *dst)
break;
#endif
#if LWIP_IPV6
case AF_INET6:
{
case AF_INET6: {
/* convert into temporary variable since ip6_addr_t might be larger
than in6_addr when scopes are enabled */
ip6_addr_t addr;