Make eligible functions static
The codebase is already very disciplined in making any function which can be `static`, but there are a few that appear to have slipped through the cracks.
This commit is contained in:
committed by
Qi Wang
parent
6841110bd6
commit
70344a2d38
@@ -48,7 +48,7 @@ TEST_BEGIN(test_pow2_ceil_zu) {
|
||||
}
|
||||
TEST_END
|
||||
|
||||
void
|
||||
static void
|
||||
expect_lg_ceil_range(size_t input, unsigned answer) {
|
||||
if (input == 1) {
|
||||
expect_u_eq(0, answer, "Got %u as lg_ceil of 1", answer);
|
||||
@@ -60,7 +60,7 @@ expect_lg_ceil_range(size_t input, unsigned answer) {
|
||||
"Got %u as lg_ceil of %zu", answer, input);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
expect_lg_floor_range(size_t input, unsigned answer) {
|
||||
if (input == 1) {
|
||||
expect_u_eq(0, answer, "Got %u as lg_floor of 1", answer);
|
||||
|
@@ -9,19 +9,20 @@ void fake_abort(const char *message) {
|
||||
fake_abort_called = true;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
test_double_free_pre(void) {
|
||||
safety_check_set_abort(&fake_abort);
|
||||
fake_abort_called = false;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
test_double_free_post() {
|
||||
expect_b_eq(fake_abort_called, true, "Double-free check didn't fire.");
|
||||
safety_check_set_abort(NULL);
|
||||
}
|
||||
|
||||
bool tcache_enabled() {
|
||||
static bool
|
||||
tcache_enabled() {
|
||||
bool enabled;
|
||||
size_t sz = sizeof(enabled);
|
||||
assert_d_eq(
|
||||
|
@@ -201,7 +201,7 @@ TEST_BEGIN(test_nstime_divide) {
|
||||
}
|
||||
TEST_END
|
||||
|
||||
void
|
||||
static void
|
||||
test_nstime_since_once(nstime_t *t) {
|
||||
nstime_t old_t;
|
||||
nstime_copy(&old_t, t);
|
||||
|
@@ -48,7 +48,8 @@ struct test_data_s {
|
||||
extent_hooks_t hooks;
|
||||
};
|
||||
|
||||
test_data_t *init_test_data(ssize_t dirty_decay_ms, ssize_t muzzy_decay_ms) {
|
||||
static test_data_t *
|
||||
init_test_data(ssize_t dirty_decay_ms, ssize_t muzzy_decay_ms) {
|
||||
test_data_t *test_data = calloc(1, sizeof(test_data_t));
|
||||
assert_ptr_not_null(test_data, "");
|
||||
init_test_extent_hooks(&test_data->hooks);
|
||||
|
@@ -14,7 +14,7 @@ void fake_abort(const char *message) {
|
||||
#define LARGE_SIZE1 SC_LARGE_MINCLASS
|
||||
#define LARGE_SIZE2 (LARGE_SIZE1 * 2)
|
||||
|
||||
void *
|
||||
static void *
|
||||
test_invalid_size_pre(size_t sz) {
|
||||
safety_check_set_abort(&fake_abort);
|
||||
|
||||
@@ -25,7 +25,7 @@ test_invalid_size_pre(size_t sz) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
test_invalid_size_post(void) {
|
||||
expect_true(fake_abort_called, "Safety check didn't fire");
|
||||
safety_check_set_abort(NULL);
|
||||
|
Reference in New Issue
Block a user