From: Willem Toorop Date: Tue, 18 Nov 2025 13:10:11 +0000 (+0100) Subject: Fixes for clang statix code analysis failures X-Git-Tag: 1.9.0-rc.1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6a8eb6eb1bea24aa7012ffe90362e4dbaa732ee;p=thirdparty%2Fldns.git Fixes for clang statix code analysis failures --- diff --git a/rr.c b/rr.c index bae06fd5..a37e8d01 100644 --- a/rr.c +++ b/rr.c @@ -405,8 +405,8 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str, } pre_data_pos = ldns_buffer_position(rd_buf); - if (-1 == (c = ldns_bget_token( - rd_buf, rd, delimiters, LDNS_MAX_RDFLEN))) { + if (-1 == ldns_bget_token( + rd_buf, rd, delimiters, LDNS_MAX_RDFLEN)) { done = true; (void)done; /* we're breaking, so done not read anymore */ diff --git a/sha1.c b/sha1.c index 9b7e60ec..470bdfec 100644 --- a/sha1.c +++ b/sha1.c @@ -97,7 +97,7 @@ ldns_sha1_transform(uint32_t state[5], const unsigned char buffer[LDNS_SHA1_BLOC state[4] += e; /* Wipe variables */ a = b = c = d = e = 0; - (void)a; + (void)a; (void)b; (void)c; (void)d; (void)e; } diff --git a/sha2.c b/sha2.c index 6a795b1f..59a6b9d3 100644 --- a/sha2.c +++ b/sha2.c @@ -494,7 +494,8 @@ static void ldns_sha256_Transform(ldns_sha256_CTX* context, /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; - (void)a; + (void)a; (void)b; (void)c; (void)d; (void)e; (void)f; (void)g; (void)h; + (void)T1; (void)T2; } #endif /* SHA2_UNROLL_TRANSFORM */ @@ -528,7 +529,7 @@ void ldns_sha256_update(ldns_sha256_CTX* context, const sha2_byte *data, size_t context->bitcount += len << 3; /* Clean up: */ usedspace = freespace = 0; - (void)usedspace; + (void)usedspace; (void)freespace; return; } } @@ -546,7 +547,7 @@ void ldns_sha256_update(ldns_sha256_CTX* context, const sha2_byte *data, size_t } /* Clean up: */ usedspace = freespace = 0; - (void)usedspace; + (void)usedspace; (void)freespace; } typedef union _ldns_sha2_buffer_union { @@ -809,7 +810,8 @@ static void ldns_sha512_Transform(ldns_sha512_CTX* context, /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; - (void)a; + (void)a; (void)b; (void)c; (void)d; (void)e; (void)f; (void)g; (void)h; + (void)T1; (void)T2; } #endif /* SHA2_UNROLL_TRANSFORM */ @@ -843,7 +845,7 @@ void ldns_sha512_update(ldns_sha512_CTX* context, const sha2_byte *data, size_t ADDINC128(context->bitcount, len << 3); /* Clean up: */ usedspace = freespace = 0; - (void)usedspace; + (void)usedspace; (void)freespace; return; } } @@ -861,7 +863,7 @@ void ldns_sha512_update(ldns_sha512_CTX* context, const sha2_byte *data, size_t } /* Clean up: */ usedspace = freespace = 0; - (void)usedspace; + (void)usedspace; (void)freespace; } static void ldns_sha512_Last(ldns_sha512_CTX* context) {