[sr-dev] git:master:65893211: modules/nat_traversal: avoid clang warnings with cast to (enum _hdr_types_t)

Mikko Lehto mslehto at iki.fi
Tue Jun 9 13:48:25 CEST 2015


Module: kamailio
Branch: master
Commit: 658932119824a0576ce708ed0d09fd43c95addfc
URL: https://github.com/kamailio/kamailio/commit/658932119824a0576ce708ed0d09fd43c95addfc

Author: Mikko Lehto <mslehto at iki.fi>
Committer: Mikko Lehto <mslehto at iki.fi>
Date: 2015-06-09T13:33:58+03:00

modules/nat_traversal: avoid clang warnings with cast to (enum _hdr_types_t)

nat_traversal.c:1477:54: warning: implicit conversion from 'hdr_flags_t' (aka 'unsigned long long') to 'enum _hdr_types_t' changes value from 18446744073709551615 to -1 [-Wconstant-conversion]
nat_traversal.c:1487:49: warning: implicit conversion from 'hdr_flags_t' (aka 'unsigned long long') to 'enum _hdr_types_t' changes value from 18446744073709551615 to -1 [-Wconstant-conversion]

---

Modified: modules/nat_traversal/nat_traversal.c

---

Diff:  https://github.com/kamailio/kamailio/commit/658932119824a0576ce708ed0d09fd43c95addfc.diff
Patch: https://github.com/kamailio/kamailio/commit/658932119824a0576ce708ed0d09fd43c95addfc.patch

---

diff --git a/modules/nat_traversal/nat_traversal.c b/modules/nat_traversal/nat_traversal.c
index 45fa5c0..67b65fa 100644
--- a/modules/nat_traversal/nat_traversal.c
+++ b/modules/nat_traversal/nat_traversal.c
@@ -1474,7 +1474,7 @@ FixContact(struct sip_msg *msg)
     }
 
     offset = contact->uri.s - msg->buf;
-    anchor = del_lump(msg, offset, contact->uri.len, HDR_CONTACT_F);
+    anchor = del_lump(msg, offset, contact->uri.len, (enum _hdr_types_t)HDR_CONTACT_F);
 
     if (!anchor) {
         pkg_free(buf);
@@ -1484,7 +1484,7 @@ FixContact(struct sip_msg *msg)
     len = sprintf(buf, "%.*s%s:%d%.*s", before_host.len, before_host.s,
                   newip.s, newport, after.len, after.s);
 
-    if (insert_new_lump_after(anchor, buf, len, HDR_CONTACT_F) == 0) {
+    if (insert_new_lump_after(anchor, buf, len, (enum _hdr_types_t)HDR_CONTACT_F) == 0) {
         pkg_free(buf);
         return -1;
     }




More information about the sr-dev mailing list