[PATCH] dns: Fix a compile warning by casting explicitly

Kai Blin kai at samba.org
Wed Oct 29 07:18:38 MDT 2014


Signed-off-by: Kai Blin <kai at samba.org>
---
 source4/dns_server/dns_query.c  | 2 +-
 source4/dns_server/dns_update.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/source4/dns_server/dns_query.c b/source4/dns_server/dns_query.c
index b57cdb8..16e14c1 100644
--- a/source4/dns_server/dns_query.c
+++ b/source4/dns_server/dns_query.c
@@ -328,7 +328,7 @@ static WERROR handle_question(struct dns_server *dns,
 			continue;
 		}
 		if ((question->question_type != DNS_QTYPE_ALL) &&
-		    (recs[ri].wType != question->question_type)) {
+		    (recs[ri].wType != (enum dns_record_type) question->question_type)) {
 			werror_return = WERR_OK;
 			continue;
 		}
diff --git a/source4/dns_server/dns_update.c b/source4/dns_server/dns_update.c
index 04e7d9a..b18c3c5 100644
--- a/source4/dns_server/dns_update.c
+++ b/source4/dns_server/dns_update.c
@@ -103,7 +103,7 @@ static WERROR check_one_prerequisite(struct dns_server *dns,
 			W_ERROR_NOT_OK_RETURN(werror);
 
 			for (i = 0; i < acount; i++) {
-				if (ans[i].wType == pr->rr_type) {
+				if (ans[i].wType == (enum dns_record_type) pr->rr_type) {
 					found = true;
 					break;
 				}
@@ -145,7 +145,7 @@ static WERROR check_one_prerequisite(struct dns_server *dns,
 			}
 
 			for (i = 0; i < acount; i++) {
-				if (ans[i].wType == pr->rr_type) {
+				if (ans[i].wType == (enum dns_record_type) pr->rr_type) {
 					found = true;
 					break;
 				}
@@ -309,7 +309,7 @@ static WERROR dns_rr_to_dnsp(TALLOC_CTX *mem_ctx,
 
 	ZERO_STRUCTP(r);
 
-	r->wType = rrec->rr_type;
+	r->wType = (enum dns_record_type) rrec->rr_type;
 	r->dwTtlSeconds = rrec->ttl;
 	r->rank = DNS_RANK_ZONE;
 
@@ -605,7 +605,7 @@ static WERROR handle_one_update(struct dns_server *dns,
 			}
 		}
 		for (i = first; i < rcount; i++) {
-			if (recs[i].wType == update->rr_type) {
+			if (recs[i].wType == (enum dns_record_type) update->rr_type) {
 				recs[i] = (struct dnsp_DnssrvRpcRecord) {
 					.wType = DNS_TYPE_TOMBSTONE,
 				};
-- 
1.9.1



More information about the samba-technical mailing list