Commit 8580f63a authored by Daniel Leung's avatar Daniel Leung Committed by Christopher Friedt
Browse files

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: default avatarDaniel Leung <daniel.leung@intel.com>
parent 1672f6ce
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)