Sun, 26 Oct 2025 15:46:55 +0100
fix warnings on certain compilers due to implicit cast from fptr to bool
| src/mempool.c | file | annotate | diff | comparison | revisions |
--- a/src/mempool.c Sun Oct 26 13:08:42 2025 +0100 +++ b/src/mempool.c Sun Oct 26 15:46:55 2025 +0100 @@ -179,17 +179,15 @@ } static void cx_mempool_free_all_simple(const struct cx_mempool_s *pool) { - const bool has_destr = pool->destr; - const bool has_destr2 = pool->destr2; for (size_t i = 0; i < pool->size; i++) { struct cx_mempool_memory_s *mem = pool->data[i]; if (mem->destructor) { mem->destructor(mem->c); } - if (has_destr) { + if (pool->destr != NULL) { pool->destr(mem->c); } - if (has_destr2) { + if (pool->destr2 != NULL) { pool->destr2(pool->destr2_data, mem->c); } cxFree(pool->base_allocator, mem);