Reformat sntp.c using astylerc

This commit is contained in:
Dirk Ziegelmeier 2017-09-17 18:07:26 +02:00
parent 52d65ed1d0
commit 2ab73ad572

View File

@ -222,11 +222,11 @@ static void sntp_request(void *arg);
static u8_t sntp_opmode; static u8_t sntp_opmode;
/** The UDP pcb used by the SNTP client */ /** The UDP pcb used by the SNTP client */
static struct udp_pcb* sntp_pcb; static struct udp_pcb *sntp_pcb;
/** Names/Addresses of servers */ /** Names/Addresses of servers */
struct sntp_server { struct sntp_server {
#if SNTP_SERVER_DNS #if SNTP_SERVER_DNS
char* name; char *name;
#endif /* SNTP_SERVER_DNS */ #endif /* SNTP_SERVER_DNS */
ip_addr_t addr; ip_addr_t addr;
}; };
@ -357,7 +357,7 @@ sntp_initialize_request(struct sntp_msg *req)
* @param arg is unused (only necessary to conform to sys_timeout) * @param arg is unused (only necessary to conform to sys_timeout)
*/ */
static void static void
sntp_retry(void* arg) sntp_retry(void *arg)
{ {
LWIP_UNUSED_ARG(arg); LWIP_UNUSED_ARG(arg);
@ -391,7 +391,7 @@ sntp_retry(void* arg)
* @param arg is unused (only necessary to conform to sys_timeout) * @param arg is unused (only necessary to conform to sys_timeout)
*/ */
static void static void
sntp_try_next_server(void* arg) sntp_try_next_server(void *arg)
{ {
u8_t old_server, i; u8_t old_server, i;
LWIP_UNUSED_ARG(arg); LWIP_UNUSED_ARG(arg);
@ -427,7 +427,7 @@ sntp_try_next_server(void* arg)
/** UDP recv callback for the sntp pcb */ /** UDP recv callback for the sntp pcb */
static void static void
sntp_recv(void *arg, struct udp_pcb* pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) sntp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port)
{ {
struct sntp_timestamps timestamps; struct sntp_timestamps timestamps;
u8_t mode; u8_t mode;
@ -527,7 +527,7 @@ sntp_recv(void *arg, struct udp_pcb* pcb, struct pbuf *p, const ip_addr_t *addr,
static void static void
sntp_send_request(const ip_addr_t *server_addr) sntp_send_request(const ip_addr_t *server_addr)
{ {
struct pbuf* p; struct pbuf *p;
p = pbuf_alloc(PBUF_TRANSPORT, SNTP_MSG_LEN, PBUF_RAM); p = pbuf_alloc(PBUF_TRANSPORT, SNTP_MSG_LEN, PBUF_RAM);
if (p != NULL) { if (p != NULL) {
struct sntp_msg *sntpmsg = (struct sntp_msg *)p->payload; struct sntp_msg *sntpmsg = (struct sntp_msg *)p->payload;
@ -557,7 +557,7 @@ sntp_send_request(const ip_addr_t *server_addr)
* DNS found callback when using DNS names as server address. * DNS found callback when using DNS names as server address.
*/ */
static void static void
sntp_dns_found(const char* hostname, const ip_addr_t *ipaddr, void *arg) sntp_dns_found(const char *hostname, const ip_addr_t *ipaddr, void *arg)
{ {
LWIP_UNUSED_ARG(hostname); LWIP_UNUSED_ARG(hostname);
LWIP_UNUSED_ARG(arg); LWIP_UNUSED_ARG(arg);
@ -677,7 +677,7 @@ sntp_stop(void)
*/ */
u8_t sntp_enabled(void) u8_t sntp_enabled(void)
{ {
return (sntp_pcb != NULL)? 1 : 0; return (sntp_pcb != NULL) ? 1 : 0;
} }
/** /**
@ -775,7 +775,7 @@ dhcp_set_ntp_servers(u8_t num, const ip4_addr_t *server)
* @return IP address of the indexed NTP server or "ip_addr_any" if the NTP * @return IP address of the indexed NTP server or "ip_addr_any" if the NTP
* server has not been configured by address (or at all). * server has not been configured by address (or at all).
*/ */
const ip_addr_t* const ip_addr_t *
sntp_getserver(u8_t idx) sntp_getserver(u8_t idx)
{ {
if (idx < SNTP_MAX_SERVERS) { if (idx < SNTP_MAX_SERVERS) {