diff options
Diffstat (limited to 'apps/examples')
-rw-r--r-- | apps/examples/cc3000/cc3000basic.c | 2 | ||||
-rw-r--r-- | apps/examples/mm/mm_main.c | 2 | ||||
-rw-r--r-- | apps/examples/tcpecho/tcpecho_main.c | 2 | ||||
-rw-r--r-- | apps/examples/uip/uip_main.c | 7 |
4 files changed, 9 insertions, 4 deletions
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; } |