Reformat api_lib.c using astylerc

This commit is contained in:
Dirk Ziegelmeier 2017-09-17 17:40:43 +02:00
parent cdbba6e0d8
commit 30152cea78

View File

@ -119,7 +119,7 @@ netconn_apimsg(tcpip_callback_fn fn, struct api_msg *apimsg)
* @return a newly allocated struct netconn or
* NULL on memory error
*/
struct netconn*
struct netconn *
netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, netconn_callback callback)
{
struct netconn *conn;
@ -266,7 +266,7 @@ netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port)
* and NETCONN_FLAG_IPV6_V6ONLY is 0, use IP_ANY_TYPE to bind
*/
if ((netconn_get_ipv6only(conn) == 0) &&
ip_addr_cmp(addr, IP6_ADDR_ANY)) {
ip_addr_cmp(addr, IP6_ADDR_ANY)) {
addr = IP_ANY_TYPE;
}
#endif /* LWIP_IPV4 && LWIP_IPV6 */
@ -539,7 +539,7 @@ netconn_recv_data(struct netconn *conn, void **new_buf, u8_t apiflags)
}
if (netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK) ||
(conn->flags & NETCONN_FLAG_MBOXCLOSED) || (conn->pending_err != ERR_OK)) {
(conn->flags & NETCONN_FLAG_MBOXCLOSED) || (conn->pending_err != ERR_OK)) {
if (sys_arch_mbox_tryfetch(&conn->recvmbox, &buf) == SYS_ARCH_TIMEOUT) {
err_t err = netconn_err(conn);
if (err != ERR_OK) {
@ -585,7 +585,7 @@ netconn_recv_data(struct netconn *conn, void **new_buf, u8_t apiflags)
#if (LWIP_UDP || LWIP_RAW)
{
LWIP_ASSERT("buf != NULL", buf != NULL);
len = netbuf_len((struct netbuf*)buf);
len = netbuf_len((struct netbuf *)buf);
}
#endif /* (LWIP_UDP || LWIP_RAW) */
@ -604,7 +604,7 @@ netconn_recv_data(struct netconn *conn, void **new_buf, u8_t apiflags)
#if LWIP_TCP
static err_t
netconn_tcp_recvd_msg(struct netconn *conn, size_t len, struct api_msg* msg)
netconn_tcp_recvd_msg(struct netconn *conn, size_t len, struct api_msg *msg)
{
LWIP_ERROR("netconn_recv_tcp_pbuf: invalid conn", (conn != NULL) &&
NETCONNTYPE_GROUP(netconn_type(conn)) == NETCONN_TCP, return ERR_ARG;);
@ -924,7 +924,7 @@ netconn_write_vectors_partly(struct netconn *conn, struct netvector *vectors, u1
int i;
LWIP_ERROR("netconn_write: invalid conn", (conn != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_write: invalid conn->type", (NETCONNTYPE_GROUP(conn->type)== NETCONN_TCP), return ERR_VAL;);
LWIP_ERROR("netconn_write: invalid conn->type", (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP), return ERR_VAL;);
dontblock = netconn_is_nonblocking(conn) || (apiflags & NETCONN_DONTBLOCK);
#if LWIP_SO_SNDTIMEO
if (conn->send_timeout != 0) {
@ -1211,8 +1211,8 @@ netconn_gethostbyname(const char *name, ip_addr_t *addr)
API_VAR_ALLOC(struct dns_api_msg, MEMP_DNS_API_MSG, msg, ERR_MEM);
#if LWIP_MPU_COMPATIBLE
strncpy(API_VAR_REF(msg).name, name, DNS_MAX_NAME_LENGTH-1);
API_VAR_REF(msg).name[DNS_MAX_NAME_LENGTH-1] = 0;
strncpy(API_VAR_REF(msg).name, name, DNS_MAX_NAME_LENGTH - 1);
API_VAR_REF(msg).name[DNS_MAX_NAME_LENGTH - 1] = 0;
#else /* LWIP_MPU_COMPATIBLE */
msg.err = &err;
msg.sem = &sem;