From 86936a047acc793ea7abc80b665ee3e4e538143a Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Mon, 19 Aug 2019 08:25:15 +0100 Subject: [PATCH] Clean up GCC warnings GCC -Wall found a valid issue with a & instead of a && in the keyring DB backend, a buffer assignment missing a cast and some unused variables in the DB4 backend. --- keydb_db4.c | 3 --- keydb_keyring.c | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/keydb_db4.c b/keydb_db4.c index d1947fe..1f306e2 100644 --- a/keydb_db4.c +++ b/keydb_db4.c @@ -403,7 +403,6 @@ static int db4_fetch_key_id(struct onak_dbctx *dbctx, uint64_t keyid, bool intrans) { struct onak_db4_dbctx *privctx = (struct onak_db4_dbctx *) dbctx->priv; - struct openpgp_packet_list *packets = NULL; DBT key, data; DBC *cursor = NULL; int ret = 0; @@ -490,7 +489,6 @@ static int db4_fetch_key_text(struct onak_dbctx *dbctx, const char *search, DBC *cursor = NULL; DBT key, data; int ret; - uint64_t keyid; int i; int numkeys; char *searchtext = NULL; @@ -595,7 +593,6 @@ static int db4_fetch_key_skshash(struct onak_dbctx *dbctx, struct onak_db4_dbctx *privctx = (struct onak_db4_dbctx *) dbctx->priv; DBT key, data; DBC *cursor = NULL; - uint64_t keyid = 0; int ret; int count = 0; struct openpgp_fingerprint fingerprint; diff --git a/keydb_keyring.c b/keydb_keyring.c index e3f8584..0f24366 100644 --- a/keydb_keyring.c +++ b/keydb_keyring.c @@ -85,7 +85,7 @@ static int keyring_fetch_key(struct onak_keyring_dbctx *privctx, if (index > privctx->count) return 0; - buf.buffer = privctx->keys[index].start; + buf.buffer = (char *) privctx->keys[index].start; buf.size = privctx->keys[index].len; buf.offset = 0; @@ -234,7 +234,6 @@ static int keyring_update_keys(struct onak_dbctx *dbctx, */ #define NEED_KEYID2UID 1 #define NEED_GETKEYSIGS 1 -#define NEED_GET_FP 1 #include "keydb.c" static int keyring_parse_keys(struct onak_keyring_dbctx *privctx) @@ -266,7 +265,7 @@ static int keyring_parse_keys(struct onak_keyring_dbctx *privctx) len += privctx->file[pos + 2]; len += 192; len += 1; /* Header */ - } else if (len > 223 & len < 255) { + } else if (len > 223 && len < 255) { // Unsupported } else if (len == 255) { len = privctx->file[pos + 2]; -- 2.39.5