Skip to content

Commit

Permalink
Fix clang-15 warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Sep 26, 2022
1 parent 10c6500 commit 733b470
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 88 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12)

project(hdr_histogram
VERSION 0.11.4
VERSION 0.11.6
LANGUAGES C
DESCRIPTION "C port of the HdrHistogram"
HOMEPAGE_URL "http://hdrhistogram.github.io/HdrHistogram/")
Expand All @@ -21,7 +21,7 @@ include(CMakePackageConfigHelpers)

set(HDR_SOVERSION_CURRENT 6)
set(HDR_SOVERSION_AGE 1)
set(HDR_SOVERSION_REVISION 1)
set(HDR_SOVERSION_REVISION 2)

set(HDR_VERSION ${HDR_SOVERSION_CURRENT}.${HDR_SOVERSION_AGE}.${HDR_SOVERSION_REVISION})
set(HDR_SOVERSION ${HDR_SOVERSION_CURRENT})
Expand Down
2 changes: 1 addition & 1 deletion src/hdr_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void hdr_mutex_unlock(struct hdr_mutex* mutex)
pthread_mutex_unlock(&mutex->_mutex);
}

void hdr_yield()
void hdr_yield(void)
{
sched_yield();
}
Expand Down
14 changes: 7 additions & 7 deletions test/hdr_atomic_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

int tests_run = 0;

static char* test_store_load_64()
static char* test_store_load_64(void)
{
int64_t value = 45;
int64_t b;
Expand All @@ -28,7 +28,7 @@ static char* test_store_load_64()
return 0;
}

static char* test_store_load_pointer()
static char* test_store_load_pointer(void)
{
int64_t r = 12;
int64_t* q = 0;
Expand All @@ -43,7 +43,7 @@ static char* test_store_load_pointer()
return 0;
}

static char* test_exchange()
static char* test_exchange(void)
{
int64_t val1 = 123124;
int64_t val2 = 987234;
Expand All @@ -57,7 +57,7 @@ static char* test_exchange()
return 0;
}

static char* test_add()
static char* test_add(void)
{
int64_t val1 = 123124;
int64_t val2 = 987234;
Expand All @@ -70,7 +70,7 @@ static char* test_add()
return 0;
}

static struct mu_result all_tests()
static struct mu_result all_tests(void)
{
mu_run_test(test_store_load_64);
mu_run_test(test_store_load_pointer);
Expand All @@ -80,7 +80,7 @@ static struct mu_result all_tests()
mu_ok;
}

static int hdr_atomic_run_tests()
static int hdr_atomic_run_tests(void)
{
struct mu_result result = all_tests();

Expand All @@ -98,7 +98,7 @@ static int hdr_atomic_run_tests()
return result.message == NULL ? 0 : -1;
}

int main()
int main(void)
{
return hdr_atomic_run_tests();
}
8 changes: 4 additions & 4 deletions test/hdr_histogram_atomic_concurrency_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void* record_values(void* thread_context)
}


static char* test_recording_concurrently()
static char* test_recording_concurrently(void)
{
const int value_count = 10000000;
int64_t* values = calloc(value_count, sizeof(int64_t));
Expand Down Expand Up @@ -85,14 +85,14 @@ static char* test_recording_concurrently()
return compare_histograms(expected_histogram, actual_histogram);
}

static struct mu_result all_tests()
static struct mu_result all_tests(void)
{
mu_run_test(test_recording_concurrently);

mu_ok;
}

static int hdr_histogram_run_tests()
static int hdr_histogram_run_tests(void)
{
struct mu_result result = all_tests();

Expand All @@ -110,7 +110,7 @@ static int hdr_histogram_run_tests()
return result.message == NULL ? 0 : -1;
}

int main()
int main(void)
{
return hdr_histogram_run_tests();
}
40 changes: 20 additions & 20 deletions test/hdr_histogram_atomic_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static struct hdr_histogram* cor_histogram = NULL;
static struct hdr_histogram* scaled_raw_histogram = NULL;
static struct hdr_histogram* scaled_cor_histogram = NULL;

static void load_histograms()
static void load_histograms(void)
{
const int64_t highest_trackable_value = INT64_C(3600) * 1000 * 1000;
const int32_t significant_figures = 3;
Expand Down Expand Up @@ -87,7 +87,7 @@ static void load_histograms()
hdr_record_corrected_value_atomic(scaled_cor_histogram, 100000000 * scale, scaled_interval);
}

static char* test_create()
static char* test_create(void)
{
struct hdr_histogram* h = NULL;
int r = hdr_init(1, INT64_C(3600000000), 3, &h);
Expand All @@ -101,7 +101,7 @@ static char* test_create()
return 0;
}

static char* test_create_with_large_values()
static char* test_create_with_large_values(void)
{
struct hdr_histogram* h = NULL;
int r = hdr_init(20000000, 100000000, 5, &h);
Expand Down Expand Up @@ -130,7 +130,7 @@ static char* test_create_with_large_values()
return 0;
}

static char* test_invalid_significant_figures()
static char* test_invalid_significant_figures(void)
{
struct hdr_histogram* h = NULL;

Expand All @@ -145,7 +145,7 @@ static char* test_invalid_significant_figures()
return 0;
}

static char* test_invalid_init()
static char* test_invalid_init(void)
{
struct hdr_histogram* h = NULL;

Expand All @@ -155,7 +155,7 @@ static char* test_invalid_init()
return 0;
}

static char* test_total_count()
static char* test_total_count(void)
{
load_histograms();

Expand All @@ -165,7 +165,7 @@ static char* test_total_count()
return 0;
}

static char* test_get_max_value()
static char* test_get_max_value(void)
{
int64_t actual_raw_max, actual_cor_max;

Expand All @@ -181,7 +181,7 @@ static char* test_get_max_value()
return 0;
}

static char* test_get_min_value()
static char* test_get_min_value(void)
{
load_histograms();

Expand All @@ -191,7 +191,7 @@ static char* test_get_min_value()
return 0;
}

static char* test_percentiles()
static char* test_percentiles(void)
{
load_histograms();

Expand Down Expand Up @@ -225,7 +225,7 @@ static char* test_percentiles()
}


static char* test_recorded_values()
static char* test_recorded_values(void)
{
struct hdr_iter iter;
int index;
Expand Down Expand Up @@ -275,7 +275,7 @@ static char* test_recorded_values()
return 0;
}

static char* test_linear_values()
static char* test_linear_values(void)
{
struct hdr_iter iter;
int index;
Expand Down Expand Up @@ -330,7 +330,7 @@ static char* test_linear_values()
return 0;
}

static char* test_logarithmic_values()
static char* test_logarithmic_values(void)
{
struct hdr_iter iter;
int index;
Expand Down Expand Up @@ -383,7 +383,7 @@ static char* test_logarithmic_values()
return 0;
}

static char* test_reset()
static char* test_reset(void)
{
load_histograms();

Expand All @@ -402,7 +402,7 @@ static char* test_reset()
return 0;
}

static char* test_scaling_equivalence()
static char* test_scaling_equivalence(void)
{
int64_t expected_99th, scaled_99th;
load_histograms();
Expand Down Expand Up @@ -431,7 +431,7 @@ static char* test_scaling_equivalence()
return 0;
}

static char* test_out_of_range_values()
static char* test_out_of_range_values(void)
{
struct hdr_histogram *h;
hdr_init(1, 1000, 4, &h);
Expand All @@ -441,7 +441,7 @@ static char* test_out_of_range_values()
return 0;
}

static char* test_linear_iter_buckets_correctly()
static char* test_linear_iter_buckets_correctly(void)
{
int step_count = 0;
int64_t total_count = 0;
Expand Down Expand Up @@ -477,7 +477,7 @@ static char* test_linear_iter_buckets_correctly()
return 0;
}

static char* test_interval_recording()
static char* test_interval_recording(void)
{
int value_count, i, value;
char* result;
Expand Down Expand Up @@ -521,7 +521,7 @@ static char* test_interval_recording()
return 0;
}

static struct mu_result all_tests()
static struct mu_result all_tests(void)
{
mu_run_test(test_create);
mu_run_test(test_invalid_init);
Expand All @@ -543,7 +543,7 @@ static struct mu_result all_tests()
mu_ok;
}

static int hdr_histogram_run_tests()
static int hdr_histogram_run_tests(void)
{
struct mu_result result = all_tests();

Expand All @@ -561,7 +561,7 @@ static int hdr_histogram_run_tests()
return result.message == NULL ? 0 : -1;
}

int main()
int main(void)
{
return hdr_histogram_run_tests();
}
Loading

0 comments on commit 733b470

Please sign in to comment.