Browse code

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]
(cherry picked from commit 658932119824a0576ce708ed0d09fd43c95addfc)

Mikko Lehto authored on 09/06/2015 10:33:58 • Daniel-Constantin Mierla committed on 10/06/2015 10:27:36
Showing 1 changed files
... ...
@@ -1474,7 +1474,7 @@ FixContact(struct sip_msg *msg)
1474 1474
     }
1475 1475
 
1476 1476
     offset = contact->uri.s - msg->buf;
1477
-    anchor = del_lump(msg, offset, contact->uri.len, HDR_CONTACT_F);
1477
+    anchor = del_lump(msg, offset, contact->uri.len, (enum _hdr_types_t)HDR_CONTACT_F);
1478 1478
 
1479 1479
     if (!anchor) {
1480 1480
         pkg_free(buf);
... ...
@@ -1484,7 +1484,7 @@ FixContact(struct sip_msg *msg)
1484 1484
     len = sprintf(buf, "%.*s%s:%d%.*s", before_host.len, before_host.s,
1485 1485
                   newip.s, newport, after.len, after.s);
1486 1486
 
1487
-    if (insert_new_lump_after(anchor, buf, len, HDR_CONTACT_F) == 0) {
1487
+    if (insert_new_lump_after(anchor, buf, len, (enum _hdr_types_t)HDR_CONTACT_F) == 0) {
1488 1488
         pkg_free(buf);
1489 1489
         return -1;
1490 1490
     }