Fixes #305: ("Warnings with -Wstrict-prototypes").

This commit is contained in:
Ion Gaztañaga
2025-08-26 00:35:29 +02:00
parent db5b2f8a3f
commit 7972bb2c97
3 changed files with 19 additions and 18 deletions

View File

@@ -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"]].

View File

@@ -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" {

View File

@@ -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()
}