diff --git a/include/libbase/def.h b/include/libbase/def.h index 4b8ce04..d887db7 100644 --- a/include/libbase/def.h +++ b/include/libbase/def.h @@ -67,10 +67,10 @@ ({ \ __typeof__(elem_ptr) __elem_ptr = (elem_ptr); \ (NULL == __elem_ptr ? \ - (container_type*)__elem_ptr : \ - (container_type*)( \ - (uint8_t*)(elem_ptr) - \ - offsetof(container_type, elem_field))); \ + (container_type*)__elem_ptr : \ + (container_type*)( \ + (uint8_t*)(__elem_ptr) - \ + offsetof(container_type, elem_field))); \ }) #endif /* __LIBBASE_DEF_H__ */ diff --git a/src/signal.c b/src/signal.c index c4e8128..7d89703 100644 --- a/src/signal.c +++ b/src/signal.c @@ -148,11 +148,10 @@ void _bs_signal_test_simple(bs_test_t *test_ptr) test_ptr, &tl1, BS_CONTAINER_OF(&tl1.calls, struct bs_test_listener, calls)); - void *p = NULL; BS_TEST_VERIFY_EQ( test_ptr, NULL, - BS_CONTAINER_OF(p, struct bs_test_listener, calls)); + BS_CONTAINER_OF(NULL, struct bs_test_listener, calls)); BS_TEST_VERIFY_EQ(test_ptr, 0, tl1.calls); BS_TEST_VERIFY_EQ(test_ptr, 0, tl2.calls);