Fix casting warnings that prevent using -Werror

The variables used to hold pointers are only 8 bit wide. even if
pointers on AVR are 16 bit wide.

The high byte can be discarded if empty, but this must be somehow
notified to the compiler, otherwise it will emit a warning that
prevents from using ssystem-wide -Werror build flag.

Signed-off-by: Igor Stoppa <igor.stoppa@gmail.com>



git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9878 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Igor Stoppa 2016-10-25 19:31:40 +00:00 committed by Fabio Utzig
parent 56e090a5d0
commit 6172fdfb71
1 changed files with 3 additions and 3 deletions

View File

@ -262,12 +262,12 @@ struct port_context {
#define PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) { \ #define PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) { \
tp->ctx.sp = (struct port_intctx *)((uint8_t *)(wtop) - \ tp->ctx.sp = (struct port_intctx *)((uint8_t *)(wtop) - \
sizeof(struct port_intctx)); \ sizeof(struct port_intctx)); \
tp->ctx.sp->r2 = (uint8_t)(pf); \ tp->ctx.sp->r2 = (uint8_t)(0xff & (uint16_t)pf); \
tp->ctx.sp->r3 = (uint8_t)((uint16_t)(pf) >> 8); \ tp->ctx.sp->r3 = (uint8_t)((uint16_t)(pf) >> 8); \
tp->ctx.sp->r4 = (uint8_t)(arg); \ tp->ctx.sp->r4 = (uint8_t)(0xff & (uint16_t)arg); \
tp->ctx.sp->r5 = (uint8_t)((uint16_t)(arg) >> 8); \ tp->ctx.sp->r5 = (uint8_t)((uint16_t)(arg) >> 8); \
tp->ctx.sp->pcl = (uint16_t)_port_thread_start >> 8; \ tp->ctx.sp->pcl = (uint16_t)_port_thread_start >> 8; \
tp->ctx.sp->pch = (uint8_t)_port_thread_start; \ tp->ctx.sp->pch = (uint8_t)(0xff & (uint16_t)_port_thread_start); \
} }
#endif /* !__AVR_3_BYTE_PC__ */ #endif /* !__AVR_3_BYTE_PC__ */