[cppcheck] add const in several places

Found with constParameter, functionConst, constVariable, constArgument

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-03-13 13:59:10 -07:00
committed by ridiculousfish
parent 39861d54c5
commit fee08a87e9
19 changed files with 53 additions and 53 deletions

View File

@@ -120,7 +120,7 @@ struct thread_pool_t {
static void *run_trampoline(void *vpool);
/// Attempt to spawn a new pthread.
bool spawn();
bool spawn() const;
/// No copying or moving.
thread_pool_t(const thread_pool_t &) = delete;
@@ -229,8 +229,8 @@ void *thread_pool_t::run_trampoline(void *pool) {
}
/// Spawn another thread. No lock is held when this is called.
bool thread_pool_t::spawn() {
return make_detached_pthread(&run_trampoline, static_cast<void *>(this));
bool thread_pool_t::spawn() const {
return make_detached_pthread(&run_trampoline, const_cast<thread_pool_t *>(this));
}
int thread_pool_t::perform(void_function_t &&func, void_function_t &&completion, bool cant_wait) {