samples: philosophers: fix pointer type mismatch for stack fork

When using the stack fork type in the philosophers sample,
there were a few pointer type mismatch since the k_stack_*()
functions are using stack_data_t but the parameters are uint32_t.
So cast them to void pointer to suppress compiler warnings.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-09-09 10:28:50 -07:00 committed by Christopher Friedt
parent 1672f6cea1
commit 8580f63ad9

View file

@ -81,12 +81,12 @@
uint32_t stack_mem[1];
} fork_obj_t;
#define fork_init(x) do { \
k_stack_init(x, (uint32_t *)((x) + 1), 1); \
k_stack_init(x, (void *)((x) + 1), 1); \
k_stack_push(x, MAGIC); \
} while ((0))
#endif
#define take(x) do { \
uint32_t data; k_stack_pop(x, &data, K_FOREVER); \
uint32_t data; k_stack_pop(x, (void *)&data, K_FOREVER); \
__ASSERT(data == MAGIC, "data was %x\n", data); \
} while ((0))
#define drop(x) k_stack_push(x, MAGIC)