From 7972bb2c97e13e2da8cc4ed4ce791fac69b7fc60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 26 Aug 2025 00:35:29 +0200 Subject: [PATCH] Fixes #305: ("Warnings with -Wstrict-prototypes"). --- doc/container.qbk | 1 + include/boost/container/detail/alloc_lib.h | 18 +++++++++--------- src/dlmalloc_ext_2_8_6.c | 18 +++++++++--------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/doc/container.qbk b/doc/container.qbk index 5557d79..d60f6f1 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -1425,6 +1425,7 @@ use [*Boost.Container]? There are several reasons for that: * Fixed bugs/issues: * [@https://github.com/boostorg/container/pull/294 GitHub #294: ['"CMake: Add option to use header-only Boost::container"]]. + * [@https://github.com/boostorg/container/pull/305 GitHub #305: ['"Warnings with -Wstrict-prototypes"]]. * [@https://github.com/boostorg/container/pull/307 GitHub #307: ['"Fix all instances of MSVC warning C4146 (unsigned negation)"]]. * [@https://github.com/boostorg/container/issues/309 GitHub #309: ['"Performance regression of boost::container::static_vector introduced in boost v1.86"]]. * [@https://github.com/boostorg/container/issues/310 GitHub #310: ['"flat_map: Mention correct type in documentation of emplace and emplace_hint"]]. diff --git a/include/boost/container/detail/alloc_lib.h b/include/boost/container/detail/alloc_lib.h index f5f505c..00bb771 100644 --- a/include/boost/container/detail/alloc_lib.h +++ b/include/boost/container/detail/alloc_lib.h @@ -254,17 +254,17 @@ int boost_cont_multialloc_arrays void boost_cont_multidealloc(boost_cont_memchain *pchain); -size_t boost_cont_footprint(); +size_t boost_cont_footprint(void); -size_t boost_cont_allocated_memory(); +size_t boost_cont_allocated_memory(void); size_t boost_cont_chunksize(const void *p); -int boost_cont_all_deallocated(); +int boost_cont_all_deallocated(void); -boost_cont_malloc_stats_t boost_cont_malloc_stats(); +boost_cont_malloc_stats_t boost_cont_malloc_stats(void); -size_t boost_cont_in_use_memory(); +size_t boost_cont_in_use_memory(void); int boost_cont_trim(size_t pad); @@ -279,7 +279,7 @@ int boost_cont_shrink void* boost_cont_alloc (size_t minbytes, size_t preferred_bytes, size_t *received_bytes); -int boost_cont_malloc_check(); +int boost_cont_malloc_check(void); boost_cont_command_ret_t boost_cont_allocation_command ( allocation_type command @@ -290,7 +290,7 @@ boost_cont_command_ret_t boost_cont_allocation_command , void *reuse_ptr ); -void *boost_cont_sync_create(); +void *boost_cont_sync_create(void); void boost_cont_sync_destroy(void *sync); @@ -298,9 +298,9 @@ int boost_cont_sync_lock(void *sync); void boost_cont_sync_unlock(void *sync); -int boost_cont_global_sync_lock(); +int boost_cont_global_sync_lock(void); -void boost_cont_global_sync_unlock(); +void boost_cont_global_sync_unlock(void); #ifdef __cplusplus } //extern "C" { diff --git a/src/dlmalloc_ext_2_8_6.c b/src/dlmalloc_ext_2_8_6.c index 8eb53a9..e8bd413 100644 --- a/src/dlmalloc_ext_2_8_6.c +++ b/src/dlmalloc_ext_2_8_6.c @@ -1218,12 +1218,12 @@ int boost_cont_multialloc_nodes return ret; } -size_t boost_cont_footprint() +size_t boost_cont_footprint(void) { return ((mstate)gm)->footprint; } -size_t boost_cont_allocated_memory() +size_t boost_cont_allocated_memory(void) { size_t alloc_mem = 0; mstate m = (mstate)gm; @@ -1269,10 +1269,10 @@ size_t boost_cont_allocated_memory() size_t boost_cont_chunksize(const void *p) { return chunksize(mem2chunk(p)); } -int boost_cont_all_deallocated() +int boost_cont_all_deallocated(void) { return !s_allocated_memory; } -boost_cont_malloc_stats_t boost_cont_malloc_stats() +boost_cont_malloc_stats_t boost_cont_malloc_stats(void) { mstate ms = (mstate)gm; if (ok_magic(ms)) { @@ -1285,7 +1285,7 @@ boost_cont_malloc_stats_t boost_cont_malloc_stats() } } -size_t boost_cont_in_use_memory() +size_t boost_cont_in_use_memory(void) { return s_allocated_memory; } int boost_cont_trim(size_t pad) @@ -1354,7 +1354,7 @@ void boost_cont_multidealloc(boost_cont_memchain *pchain) internal_multialloc_free(ms, pchain); } -int boost_cont_malloc_check() +int boost_cont_malloc_check(void) { #ifdef DEBUG mstate ms = (mstate)gm; @@ -1452,7 +1452,7 @@ int boost_cont_mallopt(int param_number, int value) return change_mparam(param_number, value); } -void *boost_cont_sync_create() +void *boost_cont_sync_create(void) { void *p = boost_cont_malloc(sizeof(MLOCK_T)); if(p){ @@ -1478,7 +1478,7 @@ int boost_cont_sync_lock(void *sync) void boost_cont_sync_unlock(void *sync) { RELEASE_LOCK((MLOCK_T*)sync); } -int boost_cont_global_sync_lock() +int boost_cont_global_sync_lock(void) { int ret; ensure_initialization(); @@ -1486,7 +1486,7 @@ int boost_cont_global_sync_lock() return 0 == ret; } -void boost_cont_global_sync_unlock() +void boost_cont_global_sync_unlock(void) { RELEASE_MALLOC_GLOBAL_LOCK() }