From 26ed3732876a649fb02a83e768e4392034d65653 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 17 Oct 2009 10:33:37 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1229 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7X-GCC/Makefile | 4 ++-- demos/ARM7-AT91SAM7X-GCC/main.c | 5 ++++- demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile | 4 ++-- demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c | 2 ++ demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c | 2 ++ demos/ARM7-AT91SAM7X-LWIP-GCC/main.c | 4 ++++ demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c | 6 ++++-- demos/ARM7-AT91SAM7X-UIP-GCC/Makefile | 4 ++-- demos/ARM7-AT91SAM7X-UIP-GCC/main.c | 4 ++++ demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c | 5 +++++ os/io/platforms/AT91SAM7X/mac_lld.c | 4 ++++ os/io/platforms/AT91SAM7X/mii_lld.c | 4 ++++ os/kernel/include/mempools.h | 6 +++++- os/kernel/src/chsys.c | 1 + test/test.c | 1 + test/testbmk.c | 5 ++++- test/testevt.c | 7 ++++--- test/testmtx.c | 10 ++++++++++ test/testsem.c | 2 ++ 19 files changed, 66 insertions(+), 14 deletions(-) diff --git a/demos/ARM7-AT91SAM7X-GCC/Makefile b/demos/ARM7-AT91SAM7X-GCC/Makefile index fa6f56c8c..65a658661 100644 --- a/demos/ARM7-AT91SAM7X-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-GCC/Makefile @@ -125,10 +125,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wstrict-prototypes +CWARN = -Wall -Wextra -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall +CPPWARN = -Wall -Wextra # # Compiler settings diff --git a/demos/ARM7-AT91SAM7X-GCC/main.c b/demos/ARM7-AT91SAM7X-GCC/main.c index f6c297a41..36ae17fae 100644 --- a/demos/ARM7-AT91SAM7X-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-GCC/main.c @@ -25,8 +25,9 @@ #include "board.h" static WORKING_AREA(waThread1, 64); -static msg_t Thread1(void *arg) { +static msg_t Thread1(void *p) { + (void)p; while (TRUE) { palSetPad(IOPORT2, PIOB_LCD_BL); chThdSleepMilliseconds(100); @@ -41,6 +42,8 @@ static msg_t Thread1(void *arg) { * on entry. */ int main(int argc, char **argv) { + (void)argc; + (void)argv; /* * Activates the serial driver 1 using the driver default configuration. diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile b/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile index 62a8d217c..699a8c834 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile @@ -139,10 +139,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wstrict-prototypes +CWARN = -Wall -Wextra -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall +CPPWARN = -Wall -Wextra # # Compiler settings diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c index 65b1b5314..0a78a3653 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c @@ -146,6 +146,7 @@ struct sys_timeouts *sys_arch_timeouts(void) { sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, int stacksize, int prio) { + (void)name; size_t wsz = THD_WA_SIZE(stacksize); void *wsp = chCoreAlloc(wsz); if (wsp == NULL) @@ -161,5 +162,6 @@ sys_prot_t sys_arch_protect(void) { void sys_arch_unprotect(sys_prot_t pval) { + (void)pval; chSysUnlock(); } diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c index c9752cb46..36ca3fd37 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c @@ -108,6 +108,7 @@ static err_t low_level_output(struct netif *netif, struct pbuf *p) { struct pbuf *q; MACTransmitDescriptor td; + (void)netif; if (macWaitTransmitDescriptor(Ð1, &td, MS2ST(LWIP_SEND_TIMEOUT)) != RDY_OK) return ERR_TIMEOUT; @@ -138,6 +139,7 @@ static struct pbuf *low_level_input(struct netif *netif) { struct pbuf *p, *q; u16_t len; + (void)netif; if (macWaitReceiveDescriptor(Ð1, &rd, TIME_IMMEDIATE) == RDY_OK) { len = (u16_t)rd.rd_size; diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c index d7d1836da..14ac139d9 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c @@ -29,6 +29,7 @@ static WORKING_AREA(waThread1, 64); static msg_t Thread1(void *arg) { + (void)arg; while (TRUE) { palClearPad(IOPORT2, PIOB_LCD_BL); chThdSleepMilliseconds(900); @@ -44,6 +45,9 @@ static msg_t Thread1(void *arg) { */ int main(int argc, char **argv) { + (void)argc; + (void)argv; + /* * Activates the serial driver 1 using the driver default configuration. */ diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c index 88701ce3e..c64f2e47d 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c @@ -39,8 +39,8 @@ #if LWIP_NETCONN -const static char http_html_hdr[] = "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n"; -const static char http_index_html[] = "Congrats!

Welcome to our lwIP HTTP server!

This is a small test page."; +static const char http_html_hdr[] = "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n"; +static const char http_index_html[] = "Congrats!

Welcome to our lwIP HTTP server!

This is a small test page."; static void http_server_serve(struct netconn *conn) { struct netbuf *inbuf; @@ -92,6 +92,8 @@ WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE); msg_t http_server(void *p) { struct netconn *conn, *newconn; + (void)p; + /* Create a new TCP connection handle */ conn = netconn_new(NETCONN_TCP); LWIP_ERROR("http_server: invalid conn", (conn != NULL), return RDY_RESET;); diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/Makefile b/demos/ARM7-AT91SAM7X-UIP-GCC/Makefile index 95d046fef..77695a569 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/Makefile @@ -143,10 +143,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wstrict-prototypes +CWARN = -Wall -Wextra -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall +CPPWARN = -Wall -Wextra # # Compiler settings diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/main.c b/demos/ARM7-AT91SAM7X-UIP-GCC/main.c index 0474ce008..5b366b0b0 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/main.c @@ -31,6 +31,7 @@ static WORKING_AREA(waThread1, 128); static msg_t Thread1(void *arg) { + (void)arg; while (TRUE) { palSetPad(IOPORT2, PIOB_LCD_BL); chThdSleepMilliseconds(100); @@ -46,6 +47,9 @@ static msg_t Thread1(void *arg) { */ int main(int argc, char **argv) { + (void)argc; + (void)argv; + /* * Activates the serial driver 2 using the driver default configuration. */ diff --git a/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c b/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c index 12c3b8405..1be4df645 100644 --- a/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c +++ b/demos/ARM7-AT91SAM7X-UIP-GCC/web/webthread.c @@ -88,6 +88,7 @@ clock_time_t clock_time( void ) static void PeriodicTimerHandler(eventid_t id) { int i; + (void)id; for (i = 0; i < UIP_CONNS; i++) { uip_periodic(i); if (uip_len > 0) { @@ -102,6 +103,7 @@ static void PeriodicTimerHandler(eventid_t id) { */ static void ARPTimerHandler(eventid_t id) { + (void)id; (void)macPollLinkStatus(Ð1); uip_arp_timer(); } @@ -111,6 +113,7 @@ static void ARPTimerHandler(eventid_t id) { */ static void FrameReceivedHandler(eventid_t id) { + (void)id; while ((uip_len = network_device_read()) > 0) { if (BUF->type == HTONS(UIP_ETHTYPE_IP)) { uip_arp_ipin(); @@ -143,6 +146,8 @@ msg_t WebThread(void *p) { EventListener el0, el1, el2; uip_ipaddr_t ipaddr; + (void)p; + /* * Event sources setup. */ diff --git a/os/io/platforms/AT91SAM7X/mac_lld.c b/os/io/platforms/AT91SAM7X/mac_lld.c index 223d54342..85d2812e8 100644 --- a/os/io/platforms/AT91SAM7X/mac_lld.c +++ b/os/io/platforms/AT91SAM7X/mac_lld.c @@ -204,6 +204,7 @@ void mac_lld_init(void) { */ void mac_lld_set_address(MACDriver *macp, const uint8_t *p) { + (void)macp; AT91C_BASE_EMAC->EMAC_SA1L = (AT91_REG)((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]); AT91C_BASE_EMAC->EMAC_SA1H = (AT91_REG)((p[5] << 8) | p[4]); @@ -224,6 +225,8 @@ msg_t max_lld_get_transmit_descriptor(MACDriver *macp, MACTransmitDescriptor *tdp) { EMACDescriptor *edp; + (void)macp; + if (!link_up) return RDY_TIMEOUT; @@ -318,6 +321,7 @@ msg_t max_lld_get_receive_descriptor(MACDriver *macp, unsigned n; EMACDescriptor *edp; + (void)macp; n = EMAC_RECEIVE_DESCRIPTORS; /* diff --git a/os/io/platforms/AT91SAM7X/mii_lld.c b/os/io/platforms/AT91SAM7X/mii_lld.c index 518190d4e..4d69adc43 100644 --- a/os/io/platforms/AT91SAM7X/mii_lld.c +++ b/os/io/platforms/AT91SAM7X/mii_lld.c @@ -42,6 +42,8 @@ void mii_lld_init(void) { */ void mii_lld_reset(MACDriver *macp) { + (void)macp; + /* * Disables the pullups on all the pins that are latched on reset by the PHY. * The status latched into the PHY is: @@ -87,6 +89,7 @@ void mii_lld_reset(MACDriver *macp) { */ phyreg_t mii_lld_get(MACDriver *macp, phyaddr_t addr) { + (void)macp; AT91C_BASE_EMAC->EMAC_MAN = (0b01 << 30) | /* SOF */ (0b10 << 28) | /* RW */ (PHY_ADDRESS << 23) | /* PHYA */ @@ -106,6 +109,7 @@ phyreg_t mii_lld_get(MACDriver *macp, phyaddr_t addr) { */ void mii_lld_put(MACDriver *macp, phyaddr_t addr, phyreg_t value) { + (void)macp; AT91C_BASE_EMAC->EMAC_MAN = (0b01 << 30) | /* SOF */ (0b01 << 28) | /* RW */ (PHY_ADDRESS << 23) | /* PHYA */ diff --git a/os/kernel/include/mempools.h b/os/kernel/include/mempools.h index d5e612426..a458b8e34 100644 --- a/os/kernel/include/mempools.h +++ b/os/kernel/include/mempools.h @@ -56,7 +56,11 @@ typedef struct { * @param name the name of the memory pool variable * @param size size of the memory pool contained objects */ -#define _MEMORYPOOL_DATA(name, size) {NULL, size} +#if CH_USE_MEMCORE || defined(__DOXYGEN__) +#define _MEMORYPOOL_DATA(name, size) {NULL, MEM_ALIGN_SIZE(size), FALSE} +#else +#define _MEMORYPOOL_DATA(name, size) {NULL, MEM_ALIGN_SIZE(size)} +#endif /** * @brief Static memory pool initializer. diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index 7d42eb644..326699ea0 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -40,6 +40,7 @@ static WORKING_AREA(idle_thread_wa, IDLE_THREAD_STACK_SIZE); */ static void idle_thread(void *p) { + (void)p; while (TRUE) { port_wait_for_interrupt(); IDLE_LOOP_HOOK(); diff --git a/test/test.c b/test/test.c index bbeb9adc4..7a9ad51fc 100644 --- a/test/test.c +++ b/test/test.c @@ -211,6 +211,7 @@ static VirtualTimer vt; bool_t test_timer_done; static void tmr(void *p) { + (void)p; test_timer_done = TRUE; } diff --git a/test/testbmk.c b/test/testbmk.c index 0e5c482f8..dd92dcbf6 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -66,6 +66,7 @@ static Mutex mtx1; static msg_t thread1(void *p) { msg_t msg; + (void)p; do { chMsgRelease(msg = chMsgWait()); } while (msg); @@ -223,6 +224,7 @@ msg_t thread4(void *p) { msg_t msg; Thread *self = chThdSelf(); + (void)p; chSysLock(); do { chSchGoSleepS(PRSUSPENDED); @@ -367,6 +369,7 @@ const struct testcase testbmk6 = { static msg_t thread3(void *p) { + (void)p; while (!chThdShouldTerminate()) chSemWait(&sem1); return 0; @@ -544,7 +547,7 @@ static char *bmk10_gettest(void) { return "Benchmark, virtual timers set/reset"; } -static void tmo(void *param) {} +static void tmo(void *param) {(void)param;} static void bmk10_execute(void) { static VirtualTimer vt1, vt2; diff --git a/test/testevt.c b/test/testevt.c index eb7e9275c..ab9b999ca 100644 --- a/test/testevt.c +++ b/test/testevt.c @@ -84,9 +84,9 @@ static void evt1_setup(void) { chEvtClear(ALL_EVENTS); } -static void h1(eventid_t id) {test_emit_token('A');} -static void h2(eventid_t id) {test_emit_token('B');} -static void h3(eventid_t id) {test_emit_token('C');} +static void h1(eventid_t id) {(void)id;test_emit_token('A');} +static void h2(eventid_t id) {(void)id;test_emit_token('B');} +static void h3(eventid_t id) {(void)id;test_emit_token('C');} static const evhandler_t evhndl[] = {h1, h2, h3}; static void evt1_execute(void) { @@ -151,6 +151,7 @@ static msg_t thread1(void *p) { static msg_t thread2(void *p) { + (void)p; chEvtBroadcast(&es1); chThdSleepMilliseconds(50); chEvtBroadcast(&es2); diff --git a/test/testmtx.c b/test/testmtx.c index 368b98fd9..e2101ae4d 100644 --- a/test/testmtx.c +++ b/test/testmtx.c @@ -165,6 +165,7 @@ static void mtx2_setup(void) { /* Low priority thread */ static msg_t thread2L(void *p) { + (void)p; chMtxLock(&m1); test_cpu_pulse(40); chMtxUnlock(); @@ -176,6 +177,7 @@ static msg_t thread2L(void *p) { /* Medium priority thread */ static msg_t thread2M(void *p) { + (void)p; chThdSleepMilliseconds(20); test_cpu_pulse(40); test_emit_token('B'); @@ -185,6 +187,7 @@ static msg_t thread2M(void *p) { /* High priority thread */ static msg_t thread2H(void *p) { + (void)p; chThdSleepMilliseconds(40); chMtxLock(&m1); test_cpu_pulse(10); @@ -257,6 +260,7 @@ static void mtx3_setup(void) { /* Lowest priority thread */ static msg_t thread3LL(void *p) { + (void)p; chMtxLock(&m1); test_cpu_pulse(30); chMtxUnlock(); @@ -267,6 +271,7 @@ static msg_t thread3LL(void *p) { /* Low priority thread */ static msg_t thread3L(void *p) { + (void)p; chThdSleepMilliseconds(10); chMtxLock(&m2); test_cpu_pulse(20); @@ -282,6 +287,7 @@ static msg_t thread3L(void *p) { /* Medium priority thread */ static msg_t thread3M(void *p) { + (void)p; chThdSleepMilliseconds(20); chMtxLock(&m2); test_cpu_pulse(10); @@ -293,6 +299,7 @@ static msg_t thread3M(void *p) { /* High priority thread */ static msg_t thread3H(void *p) { + (void)p; chThdSleepMilliseconds(40); test_cpu_pulse(20); test_emit_token('B'); @@ -302,6 +309,7 @@ static msg_t thread3H(void *p) { /* Highest priority thread */ static msg_t thread3HH(void *p) { + (void)p; chThdSleepMilliseconds(50); chMtxLock(&m2); test_cpu_pulse(10); @@ -355,6 +363,7 @@ static void mtx4_setup(void) { static msg_t thread4a(void *p) { + (void)p; chThdSleepMilliseconds(50); chMtxLock(&m2); chMtxUnlock(); @@ -363,6 +372,7 @@ static msg_t thread4a(void *p) { static msg_t thread4b(void *p) { + (void)p; chThdSleepMilliseconds(150); chMtxLock(&m1); chMtxUnlock(); diff --git a/test/testsem.c b/test/testsem.c index 77025fc71..a49509a91 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -135,6 +135,7 @@ static void sem2_setup(void) { static msg_t thread2(void *p) { + (void)p; chThdSleepMilliseconds(50); chSysLock(); chSemSignalI(&sem1); /* For coverage reasons */ @@ -215,6 +216,7 @@ static void sem3_setup(void) { static msg_t thread3(void *p) { + (void)p; chSemWait(&sem1); chSemSignal(&sem1); return 0; -- cgit v1.2.3