libqaeda

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs | README | LICENSE

commit 967860a2aa2902235f92b29f622075f608cd31fa
parent 32f99155f24ce45c948b8d39cb6067a0abcb7493
Author: lash <dev@holbrook.no>
Date:   Mon,  3 Mar 2025 13:48:59 +0000

Remove unused code, address warnings

Diffstat:
Msrc/store/mem.c | 7+++----
Msrc/test/test_trust.c | 10+++-------
2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/store/mem.c b/src/store/mem.c @@ -16,11 +16,10 @@ struct pair_t { static int pair_cmp(const void *a, const void *b, void *userdata) { int i; - int c; struct pair_t *pa; struct pair_t *pb; - char *ka; - char *kb; + const char *ka; + const char *kb; pa = (struct pair_t*)a; pb = (struct pair_t*)b; @@ -60,7 +59,7 @@ struct hashmap* lq_mem_init(LQStore *store) { int lq_mem_content_get(enum payload_e typ, LQStore *store, const char *key, size_t key_len, char *value, size_t *value_len) { struct hashmap *o; struct pair_t v; - struct pair_t *p; + const struct pair_t *p; o = lq_mem_init(store); diff --git a/src/test/test_trust.c b/src/test/test_trust.c @@ -42,7 +42,6 @@ extern LQStore LQMemContent; START_TEST(check_trust_none) { int r; - size_t c; unsigned char flag_test[2]; LQPubKey *pubkey_alice; LQPubKey *pubkey_bob; @@ -53,7 +52,7 @@ START_TEST(check_trust_none) { pubkey_alice = lq_publickey_new(pubkey_data_alice); pubkey_bob = lq_publickey_new(pubkey_data_bob); - store->put(LQ_CONTENT_KEY, store, pubkey_alice->lokey, &pubkey_alice->lolen, (unsigned char*)trust_alice, 2); + store->put(LQ_CONTENT_KEY, store, pubkey_alice->lokey, &pubkey_alice->lolen, (char*)trust_alice, 2); lq_set(flag_test, 0, 2); r = lq_trust_check(pubkey_alice, store, TRUST_MATCH_NONE, flag_test); @@ -62,7 +61,7 @@ START_TEST(check_trust_none) { r = lq_trust_check(pubkey_bob, store, TRUST_MATCH_NONE, flag_test); ck_assert_int_eq(r, -1); - store->put(LQ_CONTENT_KEY, store, pubkey_bob->lokey, &pubkey_bob->lolen, (unsigned char*)trust_bob, 2); + store->put(LQ_CONTENT_KEY, store, pubkey_bob->lokey, &pubkey_bob->lolen, (char*)trust_bob, 2); r = lq_trust_check(pubkey_bob, store, TRUST_MATCH_NONE, flag_test); ck_assert_int_eq(r, 1000000); @@ -72,7 +71,6 @@ END_TEST START_TEST(check_trust_one) { int r; - size_t c; unsigned char flag_test[2]; LQPubKey *pubkey_alice; LQStore *store; @@ -81,7 +79,7 @@ START_TEST(check_trust_one) { pubkey_alice = lq_publickey_new(pubkey_data_alice); - store->put(LQ_CONTENT_KEY, store, pubkey_alice->lokey, &pubkey_alice->lolen, (unsigned char*)trust_alice, 2); + store->put(LQ_CONTENT_KEY, store, pubkey_alice->lokey, &pubkey_alice->lolen, (char*)trust_alice, 2); flag_test[0] = 0; flag_test[1] = 0x40; @@ -94,7 +92,6 @@ END_TEST START_TEST(check_trust_best) { int r; - size_t c; unsigned char flag_test[2]; LQPubKey *pubkey_alice; LQStore *store; @@ -116,7 +113,6 @@ END_TEST START_TEST(check_trust_all) { int r; - size_t c; unsigned char flag_test[2]; LQPubKey *pubkey_alice; LQStore *store;