From 5d99549aca261d40abf3e0d7180c2bddca3522b3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Apr 2014 13:09:48 -0600 Subject: Make sure that there is one space between while and condition --- apps/examples/cc3000/cc3000basic.c | 2 +- apps/examples/mm/mm_main.c | 2 +- apps/examples/tcpecho/tcpecho_main.c | 2 +- apps/examples/uip/uip_main.c | 7 ++++++- apps/netutils/dnsclient/dns_socket.c | 6 +++--- apps/netutils/ftpc/ftpc_transfer.c | 1 - apps/netutils/uiplib/uiplib.c | 5 +++-- apps/nshlib/nsh_codeccmd.c | 2 +- apps/system/install/install.c | 4 ++-- 9 files changed, 18 insertions(+), 13 deletions(-) (limited to 'apps') diff --git a/apps/examples/cc3000/cc3000basic.c b/apps/examples/cc3000/cc3000basic.c index 2e5fcd7cf..2530680b6 100644 --- a/apps/examples/cc3000/cc3000basic.c +++ b/apps/examples/cc3000/cc3000basic.c @@ -969,7 +969,7 @@ int c3b_main(int argc, char *argv[]) ch = getchar(); } - while(execute(ch) == 0); + while (execute(ch) == 0); return 0; } diff --git a/apps/examples/mm/mm_main.c b/apps/examples/mm/mm_main.c index 0c8532d70..c15004a34 100644 --- a/apps/examples/mm/mm_main.c +++ b/apps/examples/mm/mm_main.c @@ -47,7 +47,7 @@ #define NTEST_ALLOCS 32 -/* #define STOP_ON_ERRORS do{}while(0) */ +/* #define STOP_ON_ERRORS do {} while (0) */ #define STOP_ON_ERRORS exit(1) /* All other definitions derive from these two */ diff --git a/apps/examples/tcpecho/tcpecho_main.c b/apps/examples/tcpecho/tcpecho_main.c index a8a86a7b2..8b26656f4 100644 --- a/apps/examples/tcpecho/tcpecho_main.c +++ b/apps/examples/tcpecho/tcpecho_main.c @@ -246,7 +246,7 @@ static int tcpecho_server(void) maxi = 0; /* max index into client[] array */ - while(!stop) + while (!stop) { nready = poll(client, maxi+1, TCPECHO_POLLTIMEOUT); diff --git a/apps/examples/uip/uip_main.c b/apps/examples/uip/uip_main.c index 9d2fcf9b2..3dbf0eb82 100644 --- a/apps/examples/uip/uip_main.c +++ b/apps/examples/uip/uip_main.c @@ -174,18 +174,22 @@ int uip_main(int argc, char *argv[]) struct dhcpc_state ds; (void)dhcpc_request(handle, &ds); uip_sethostaddr("eth1", &ds.ipaddr); + if (ds.netmask.s_addr != 0) { uip_setnetmask("eth0", &ds.netmask); } + if (ds.default_router.s_addr != 0) { uip_setdraddr("eth0", &ds.default_router); } + if (ds.dnsaddr.s_addr != 0) { dns_setserver(&ds.dnsaddr); } + dhcpc_close(handle); printf("IP: %s\n", inet_ntoa(ds.ipaddr)); } @@ -198,7 +202,7 @@ int uip_main(int argc, char *argv[]) httpd_listen(); #endif - while(1) + while (1) { sleep(3); printf("uip_main: Still running\n"); @@ -206,5 +210,6 @@ int uip_main(int argc, char *argv[]) fflush(stdout); #endif } + return 0; } diff --git a/apps/netutils/dnsclient/dns_socket.c b/apps/netutils/dnsclient/dns_socket.c index c61032685..002d48674 100644 --- a/apps/netutils/dnsclient/dns_socket.c +++ b/apps/netutils/dnsclient/dns_socket.c @@ -188,13 +188,13 @@ static FAR unsigned char *dns_parse_name(FAR unsigned char *query) { n = *query++; - while(n > 0) + while (n > 0) { ++query; --n; } } - while(*query != 0); + while (*query != 0); return query + 1; } @@ -247,7 +247,7 @@ static int dns_send_query(int sockfd, FAR const char *name, *nptr = n; } - while(*nameptr != 0); + while (*nameptr != 0); memcpy(query, endquery, 5); diff --git a/apps/netutils/ftpc/ftpc_transfer.c b/apps/netutils/ftpc/ftpc_transfer.c index 0eb9130f3..46ec88ec9 100644 --- a/apps/netutils/ftpc/ftpc_transfer.c +++ b/apps/netutils/ftpc/ftpc_transfer.c @@ -426,7 +426,6 @@ int ftpc_xfrabort(FAR struct ftpc_session_s *session, FAR FILE *stream) /* Read remaining bytes from connection */ while (stream && fread(session->buffer, 1, CONFIG_FTP_BUFSIZE, stream) > 0); - while(stream && fread(session->buffer, 1, CONFIG_FTP_BUFSIZE, stream) > 0) /* Get the ABORt reply */ diff --git a/apps/netutils/uiplib/uiplib.c b/apps/netutils/uiplib/uiplib.c index 8106789c7..c8051233e 100644 --- a/apps/netutils/uiplib/uiplib.c +++ b/apps/netutils/uiplib/uiplib.c @@ -92,8 +92,9 @@ bool uiplib_ipaddrconv(const char *addrstr, uint8_t *ipaddr) } ++addrstr; } - while(c != '.' && c != 0); + while (c != '.' && c != 0); } + return true; } @@ -149,7 +150,7 @@ bool uiplib_hwmacconv(const char *hwstr, uint8_t *hw) ++hwstr; } - while(c != ':' && c != 0); + while (c != ':' && c != 0); } return true; diff --git a/apps/nshlib/nsh_codeccmd.c b/apps/nshlib/nsh_codeccmd.c index 8947edd67..3576f8c84 100644 --- a/apps/nshlib/nsh_codeccmd.c +++ b/apps/nshlib/nsh_codeccmd.c @@ -338,7 +338,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, buff_len = calc_codec_buffsize(src_buff_len+2, mode); buffer = malloc(buff_len); - while(true) + while (true) { memset(src_buffer, 0, src_buff_len+2); ret=read(fd, src_buffer, src_buff_len); diff --git a/apps/system/install/install.c b/apps/system/install/install.c index cc60df7c3..807744a7d 100644 --- a/apps/system/install/install.c +++ b/apps/system/install/install.c @@ -174,7 +174,7 @@ static int install_programflash(int startaddr, const char *source) startaddr += count; totalsize += count; } - while(count); + while (count); } else { @@ -308,7 +308,7 @@ static int install_remove(const char *scriptname) progsize -= up_progmem_pagesize(page); } - while(progsize > 0); + while (progsize > 0); if (status < 0) { -- cgit v1.2.3