Skip to content

Commit 733b470

Browse files
committed
Fix clang-15 warnings.
1 parent 10c6500 commit 733b470

File tree

8 files changed

+88
-88
lines changed

8 files changed

+88
-88
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.12)
22

33
project(hdr_histogram
4-
VERSION 0.11.4
4+
VERSION 0.11.6
55
LANGUAGES C
66
DESCRIPTION "C port of the HdrHistogram"
77
HOMEPAGE_URL "http://hdrhistogram.github.io/HdrHistogram/")
@@ -21,7 +21,7 @@ include(CMakePackageConfigHelpers)
2121

2222
set(HDR_SOVERSION_CURRENT 6)
2323
set(HDR_SOVERSION_AGE 1)
24-
set(HDR_SOVERSION_REVISION 1)
24+
set(HDR_SOVERSION_REVISION 2)
2525

2626
set(HDR_VERSION ${HDR_SOVERSION_CURRENT}.${HDR_SOVERSION_AGE}.${HDR_SOVERSION_REVISION})
2727
set(HDR_SOVERSION ${HDR_SOVERSION_CURRENT})

src/hdr_thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void hdr_mutex_unlock(struct hdr_mutex* mutex)
9494
pthread_mutex_unlock(&mutex->_mutex);
9595
}
9696

97-
void hdr_yield()
97+
void hdr_yield(void)
9898
{
9999
sched_yield();
100100
}

test/hdr_atomic_test.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
int tests_run = 0;
1515

16-
static char* test_store_load_64()
16+
static char* test_store_load_64(void)
1717
{
1818
int64_t value = 45;
1919
int64_t b;
@@ -28,7 +28,7 @@ static char* test_store_load_64()
2828
return 0;
2929
}
3030

31-
static char* test_store_load_pointer()
31+
static char* test_store_load_pointer(void)
3232
{
3333
int64_t r = 12;
3434
int64_t* q = 0;
@@ -43,7 +43,7 @@ static char* test_store_load_pointer()
4343
return 0;
4444
}
4545

46-
static char* test_exchange()
46+
static char* test_exchange(void)
4747
{
4848
int64_t val1 = 123124;
4949
int64_t val2 = 987234;
@@ -57,7 +57,7 @@ static char* test_exchange()
5757
return 0;
5858
}
5959

60-
static char* test_add()
60+
static char* test_add(void)
6161
{
6262
int64_t val1 = 123124;
6363
int64_t val2 = 987234;
@@ -70,7 +70,7 @@ static char* test_add()
7070
return 0;
7171
}
7272

73-
static struct mu_result all_tests()
73+
static struct mu_result all_tests(void)
7474
{
7575
mu_run_test(test_store_load_64);
7676
mu_run_test(test_store_load_pointer);
@@ -80,7 +80,7 @@ static struct mu_result all_tests()
8080
mu_ok;
8181
}
8282

83-
static int hdr_atomic_run_tests()
83+
static int hdr_atomic_run_tests(void)
8484
{
8585
struct mu_result result = all_tests();
8686

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

101-
int main()
101+
int main(void)
102102
{
103103
return hdr_atomic_run_tests();
104104
}

test/hdr_histogram_atomic_concurrency_test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static void* record_values(void* thread_context)
4040
}
4141

4242

43-
static char* test_recording_concurrently()
43+
static char* test_recording_concurrently(void)
4444
{
4545
const int value_count = 10000000;
4646
int64_t* values = calloc(value_count, sizeof(int64_t));
@@ -85,14 +85,14 @@ static char* test_recording_concurrently()
8585
return compare_histograms(expected_histogram, actual_histogram);
8686
}
8787

88-
static struct mu_result all_tests()
88+
static struct mu_result all_tests(void)
8989
{
9090
mu_run_test(test_recording_concurrently);
9191

9292
mu_ok;
9393
}
9494

95-
static int hdr_histogram_run_tests()
95+
static int hdr_histogram_run_tests(void)
9696
{
9797
struct mu_result result = all_tests();
9898

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

113-
int main()
113+
int main(void)
114114
{
115115
return hdr_histogram_run_tests();
116116
}

test/hdr_histogram_atomic_test.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static struct hdr_histogram* cor_histogram = NULL;
3434
static struct hdr_histogram* scaled_raw_histogram = NULL;
3535
static struct hdr_histogram* scaled_cor_histogram = NULL;
3636

37-
static void load_histograms()
37+
static void load_histograms(void)
3838
{
3939
const int64_t highest_trackable_value = INT64_C(3600) * 1000 * 1000;
4040
const int32_t significant_figures = 3;
@@ -87,7 +87,7 @@ static void load_histograms()
8787
hdr_record_corrected_value_atomic(scaled_cor_histogram, 100000000 * scale, scaled_interval);
8888
}
8989

90-
static char* test_create()
90+
static char* test_create(void)
9191
{
9292
struct hdr_histogram* h = NULL;
9393
int r = hdr_init(1, INT64_C(3600000000), 3, &h);
@@ -101,7 +101,7 @@ static char* test_create()
101101
return 0;
102102
}
103103

104-
static char* test_create_with_large_values()
104+
static char* test_create_with_large_values(void)
105105
{
106106
struct hdr_histogram* h = NULL;
107107
int r = hdr_init(20000000, 100000000, 5, &h);
@@ -130,7 +130,7 @@ static char* test_create_with_large_values()
130130
return 0;
131131
}
132132

133-
static char* test_invalid_significant_figures()
133+
static char* test_invalid_significant_figures(void)
134134
{
135135
struct hdr_histogram* h = NULL;
136136

@@ -145,7 +145,7 @@ static char* test_invalid_significant_figures()
145145
return 0;
146146
}
147147

148-
static char* test_invalid_init()
148+
static char* test_invalid_init(void)
149149
{
150150
struct hdr_histogram* h = NULL;
151151

@@ -155,7 +155,7 @@ static char* test_invalid_init()
155155
return 0;
156156
}
157157

158-
static char* test_total_count()
158+
static char* test_total_count(void)
159159
{
160160
load_histograms();
161161

@@ -165,7 +165,7 @@ static char* test_total_count()
165165
return 0;
166166
}
167167

168-
static char* test_get_max_value()
168+
static char* test_get_max_value(void)
169169
{
170170
int64_t actual_raw_max, actual_cor_max;
171171

@@ -181,7 +181,7 @@ static char* test_get_max_value()
181181
return 0;
182182
}
183183

184-
static char* test_get_min_value()
184+
static char* test_get_min_value(void)
185185
{
186186
load_histograms();
187187

@@ -191,7 +191,7 @@ static char* test_get_min_value()
191191
return 0;
192192
}
193193

194-
static char* test_percentiles()
194+
static char* test_percentiles(void)
195195
{
196196
load_histograms();
197197

@@ -225,7 +225,7 @@ static char* test_percentiles()
225225
}
226226

227227

228-
static char* test_recorded_values()
228+
static char* test_recorded_values(void)
229229
{
230230
struct hdr_iter iter;
231231
int index;
@@ -275,7 +275,7 @@ static char* test_recorded_values()
275275
return 0;
276276
}
277277

278-
static char* test_linear_values()
278+
static char* test_linear_values(void)
279279
{
280280
struct hdr_iter iter;
281281
int index;
@@ -330,7 +330,7 @@ static char* test_linear_values()
330330
return 0;
331331
}
332332

333-
static char* test_logarithmic_values()
333+
static char* test_logarithmic_values(void)
334334
{
335335
struct hdr_iter iter;
336336
int index;
@@ -383,7 +383,7 @@ static char* test_logarithmic_values()
383383
return 0;
384384
}
385385

386-
static char* test_reset()
386+
static char* test_reset(void)
387387
{
388388
load_histograms();
389389

@@ -402,7 +402,7 @@ static char* test_reset()
402402
return 0;
403403
}
404404

405-
static char* test_scaling_equivalence()
405+
static char* test_scaling_equivalence(void)
406406
{
407407
int64_t expected_99th, scaled_99th;
408408
load_histograms();
@@ -431,7 +431,7 @@ static char* test_scaling_equivalence()
431431
return 0;
432432
}
433433

434-
static char* test_out_of_range_values()
434+
static char* test_out_of_range_values(void)
435435
{
436436
struct hdr_histogram *h;
437437
hdr_init(1, 1000, 4, &h);
@@ -441,7 +441,7 @@ static char* test_out_of_range_values()
441441
return 0;
442442
}
443443

444-
static char* test_linear_iter_buckets_correctly()
444+
static char* test_linear_iter_buckets_correctly(void)
445445
{
446446
int step_count = 0;
447447
int64_t total_count = 0;
@@ -477,7 +477,7 @@ static char* test_linear_iter_buckets_correctly()
477477
return 0;
478478
}
479479

480-
static char* test_interval_recording()
480+
static char* test_interval_recording(void)
481481
{
482482
int value_count, i, value;
483483
char* result;
@@ -521,7 +521,7 @@ static char* test_interval_recording()
521521
return 0;
522522
}
523523

524-
static struct mu_result all_tests()
524+
static struct mu_result all_tests(void)
525525
{
526526
mu_run_test(test_create);
527527
mu_run_test(test_invalid_init);
@@ -543,7 +543,7 @@ static struct mu_result all_tests()
543543
mu_ok;
544544
}
545545

546-
static int hdr_histogram_run_tests()
546+
static int hdr_histogram_run_tests(void)
547547
{
548548
struct mu_result result = all_tests();
549549

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

564-
int main()
564+
int main(void)
565565
{
566566
return hdr_histogram_run_tests();
567567
}

0 commit comments

Comments
 (0)