Bug 1333686 - Part 2: Fix "unary minus operator applied to unsigned type" MSVC warnings in webrtc/signaling. r=bwc
☠☠ backed out by 98ab69f5f624 ☠ ☠
authorChris Peterson <cpeterson@mozilla.com>
Sun, 15 Jan 2017 23:06:40 -0800
changeset 466725 313a9604211fd7de198d8b1956fcf17d138e1bd3
parent 466724 5c610ccf76de4c8faba7ac7bfafd26120597b12e
child 466726 514fdfd43d6372cc4955b12026b7f209b06ff33c
push id42980
push userbmo:jhofmann@mozilla.com
push dateThu, 26 Jan 2017 12:29:21 +0000
reviewersbwc
bugs1333686
milestone54.0a1
Bug 1333686 - Part 2: Fix "unary minus operator applied to unsigned type" MSVC warnings in webrtc/signaling. r=bwc Replace -1UL with ULONG_MAX. media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c(584): warning C4146: unary minus operator applied to unsigned type, result still unsigned media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c(585): warning C4146: unary minus operator applied to unsigned type, result still unsigned media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c(586): warning C4146: unary minus operator applied to unsigned type, result still unsigned MozReview-Commit-ID: EepB2xf4MZr
media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c
@@ -576,28 +576,27 @@ sdp_result_e sdp_get_fmtp_tok_val(sdp_t 
   result1 = sdp_get_fmtp_tok(sdp_p, fmtp_ptr, fmtp_name, buf, buf_size, tok);
   if (result1 != SDP_SUCCESS) return result1;
 
   errno = 0;
   value = strtoul(*tok, &strtoul_end, 10);
 
   if (errno
       || (*tok == strtoul_end)
-      || (illegal_value != -1UL && value == illegal_value)
-      || (min_limit != -1UL && value < min_limit)
-      || (max_limit != -1UL && value > max_limit)) {
+      || (illegal_value != ULONG_MAX && value == illegal_value)
+      || (min_limit != ULONG_MAX && value < min_limit)
+      || (max_limit != ULONG_MAX && value > max_limit)) {
     sdp_attr_fmtp_invalid_value(sdp_p, fmtp_name, *tok);
     return SDP_INVALID_PARAMETER;
   }
   *strtoul_result = value;
 
   return SDP_SUCCESS;
 }
 
-
 sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p,
                                   const char *ptr)
 {
     uint16_t           i;
     uint32_t           mapword;
     uint32_t           bmap;
     uint8_t            low_val;
     uint8_t            high_val;