]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence warnings about unnecessary comparisons
authorEvan Hunt <each@isc.org>
Tue, 20 Mar 2018 09:22:57 +0000 (09:22 +0000)
committerEvan Hunt <each@isc.org>
Sun, 22 Apr 2018 20:01:08 +0000 (13:01 -0700)
- these are cases where result has been explicitly set, so
  if (result != ISC_R_SUCCESS) is unnecessary

(cherry picked from commit e00eb55cd2276ab909dba410834667573e24ff47)
(cherry picked from commit 0dcff8f93ce7a5a3940e42b1d16f8ba504e2dc19)

lib/dns/master.c

index e8de7c2730e2b8fa0027457bc8f5066ee9bd1714..13dce9ef578c1409048eada323335fe46de7d130 100644 (file)
@@ -14,8 +14,6 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id$ */
-
 /*! \file */
 
 #include <config.h>
@@ -1350,8 +1348,9 @@ load_text(dns_loadctx_t *lctx) {
                                        if (MANYERRS(lctx, result)) {
                                                SETRESULT(lctx, result);
                                                lctx->ttl = 0;
-                                       } else if (result != ISC_R_SUCCESS)
+                                       } else {
                                                goto insist_and_cleanup;
+                                       }
                                } else if (!explicit_ttl &&
                                           lctx->default_ttl_known) {
                                        lctx->ttl = lctx->default_ttl;
@@ -1382,8 +1381,9 @@ load_text(dns_loadctx_t *lctx) {
                                result = DNS_R_SYNTAX;
                                if (MANYERRS(lctx, result)) {
                                        SETRESULT(lctx, result);
-                               } else if (result != ISC_R_SUCCESS)
+                               } else {
                                        goto insist_and_cleanup;
+                               }
                        }
 
                        /*
@@ -1554,8 +1554,9 @@ load_text(dns_loadctx_t *lctx) {
                                SETRESULT(lctx, result);
                                LOGIT(result);
                                continue;
-                       } else if (result != ISC_R_SUCCESS)
+                       } else {
                                goto insist_and_cleanup;
+                       }
                }
 
                /*
@@ -1594,8 +1595,9 @@ load_text(dns_loadctx_t *lctx) {
                                        SETRESULT(lctx, result);
                                        read_till_eol = ISC_TRUE;
                                        continue;
-                               } else if (result != ISC_R_SUCCESS)
+                               } else {
                                        goto insist_and_cleanup;
+                               }
                        }
 
                        if (ictx->origin_changed) {
@@ -1637,8 +1639,9 @@ load_text(dns_loadctx_t *lctx) {
                                SETRESULT(lctx, result);
                                read_till_eol = ISC_TRUE;
                                continue;
-                       } else if (result != ISC_R_SUCCESS)
+                       } else {
                                goto insist_and_cleanup;
+                       }
                }
 
                if (rdclass == 0 &&
@@ -1655,8 +1658,9 @@ load_text(dns_loadctx_t *lctx) {
                                SETRESULT(lctx, result);
                                read_till_eol = ISC_TRUE;
                                continue;
-                       } else if (result != ISC_R_SUCCESS)
+                       } else {
                                goto insist_and_cleanup;
+                       }
                }
 
                result = dns_rdatatype_fromtext(&type,
@@ -1696,8 +1700,9 @@ load_text(dns_loadctx_t *lctx) {
                                SETRESULT(lctx, result);
                                read_till_eol = ISC_TRUE;
                                continue;
-                       } else if (result != ISC_R_SUCCESS)
+                       } else {
                                goto insist_and_cleanup;
+                       }
                }
 
                if (type == dns_rdatatype_ns && ictx->glue == NULL)
@@ -1809,8 +1814,9 @@ load_text(dns_loadctx_t *lctx) {
                                                            namebuf, desc);
                                        if (MANYERRS(lctx, result)) {
                                                SETRESULT(lctx, result);
-                                       } else if (result != ISC_R_SUCCESS)
+                                       } else {
                                                goto cleanup;
+                                       }
                                } else {
                                        (*callbacks->warn)(callbacks,
                                                           "%s:%lu: %s: %s",
@@ -1861,8 +1867,9 @@ load_text(dns_loadctx_t *lctx) {
                                read_till_eol = ISC_TRUE;
                                target = target_ft;
                                continue;
-                       } else if (result != ISC_R_SUCCESS)
+                       } else {
                                goto insist_and_cleanup;
+                       }
                }