summaryrefslogtreecommitdiffstats
path: root/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/.clang-tidy1
-rw-r--r--benchmark/dict_bench.c2
-rw-r--r--benchmark/tree_bench.c6
3 files changed, 5 insertions, 4 deletions
diff --git a/benchmark/.clang-tidy b/benchmark/.clang-tidy
index 17625d5..eab2452 100644
--- a/benchmark/.clang-tidy
+++ b/benchmark/.clang-tidy
@@ -13,7 +13,6 @@ Checks: >
-cert-msc50-cpp,
-cert-msc51-cpp,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
- -cppcoreguidelines-init-variables,
-hicpp-multiway-paths-covered,
-llvm-header-guard,
-llvmlibc-*,
diff --git a/benchmark/dict_bench.c b/benchmark/dict_bench.c
index 0ed794f..23e2f55 100644
--- a/benchmark/dict_bench.c
+++ b/benchmark/dict_bench.c
@@ -65,7 +65,7 @@ main(int argc, char** argv)
char* buf = (char*)calloc(1, 1);
size_t buf_len = 1;
size_t this_str_len = 0;
- for (int c; (c = fgetc(fd)) != EOF;) {
+ for (int c = 0; (c = fgetc(fd)) != EOF;) {
if (isspace(c)) {
if (this_str_len == 0) {
continue;
diff --git a/benchmark/tree_bench.c b/benchmark/tree_bench.c
index bcf8699..4d1f30f 100644
--- a/benchmark/tree_bench.c
+++ b/benchmark/tree_bench.c
@@ -141,7 +141,8 @@ bench_zix_tree(size_t n_elems,
struct timespec del_start = bench_start();
for (size_t i = 0; i < n_elems; i++) {
r = unique_rand(i);
- ZixTreeIter* item;
+
+ ZixTreeIter* item = NULL;
if (zix_tree_find(t, (void*)r, &item)) {
return test_fail("Failed to find %" PRIdPTR " to delete\n", r);
}
@@ -207,7 +208,8 @@ bench_zix_btree(size_t n_elems,
struct timespec del_start = bench_start();
for (size_t i = 0; i < n_elems; i++) {
r = unique_rand(i);
- void* removed;
+
+ void* removed = NULL;
if (zix_btree_remove(t, (void*)r, &removed, NULL)) {
return test_fail("Failed to remove %" PRIdPTR "\n", r);
}