Bug 980810 - Part 3: Fix clang -Wstring-conversion warnings in UDPSocket and mtransport code. r=bwc
authorChris Peterson <cpeterson@mozilla.com>
Fri, 07 Mar 2014 22:57:15 -0800
changeset 190914 d3ebc96a208016cf87f3b5d7b146a0017508db3b
parent 190913 18cf810962ab12f6a682416c1df2c980b9fa9681
child 190915 3622141b21655dd80b36f931cfac0b3d8fe129ac
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs980810
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 980810 - Part 3: Fix clang -Wstring-conversion warnings in UDPSocket and mtransport code. r=bwc
dom/network/src/UDPSocketChild.cpp
dom/network/src/UDPSocketParent.cpp
media/mtransport/nr_socket_prsock.cpp
--- a/dom/network/src/UDPSocketChild.cpp
+++ b/dom/network/src/UDPSocketChild.cpp
@@ -15,16 +15,17 @@ NS_IMPL_ISUPPORTS1(UDPSocketChildBase, n
 UDPSocketChildBase::UDPSocketChildBase()
 : mIPCOpen(false)
 {
 }
 
 UDPSocketChildBase::~UDPSocketChildBase()
 {
 }
+
 void
 UDPSocketChildBase::ReleaseIPDLReference()
 {
   MOZ_ASSERT(mIPCOpen);
   mIPCOpen = false;
   this->Release();
 }
 
@@ -193,17 +194,17 @@ UDPSocketChild::RecvCallback(const nsCSt
     const UDPAddressInfo& addressInfo(aData.get_UDPAddressInfo());
     mLocalAddress = addressInfo.local();
     mLocalPort = addressInfo.port();
     rv = mSocket->CallListenerVoid(aType);
   } else if (aData.type() == UDPCallbackData::TUDPSendResult) {
     const UDPSendResult& returnValue(aData.get_UDPSendResult());
     rv = mSocket->CallListenerSent(aType, returnValue.value());
   } else {
-    MOZ_ASSERT("Invalid callback type!");
+    MOZ_ASSERT(false, "Invalid callback type!");
   }
 
   NS_ENSURE_SUCCESS(rv, true);
 
   return true;
 }
 
 } // namespace dom
--- a/dom/network/src/UDPSocketParent.cpp
+++ b/dom/network/src/UDPSocketParent.cpp
@@ -40,17 +40,17 @@ ConvertNetAddrToString(mozilla::net::Net
     bufSize = mozilla::net::kIPv4CStrBufSize;
     break;
   case AF_INET6:
     *port = PR_ntohs(netAddr.inet6.port);
     bufSize = mozilla::net::kIPv6CStrBufSize;
     break;
   default:
     //impossible
-    MOZ_ASSERT("Unexpected address family");
+    MOZ_ASSERT(false, "Unexpected address family");
     return NS_ERROR_INVALID_ARG;
   }
 
   address->SetCapacity(bufSize);
   NetAddrToString(&netAddr, address->BeginWriting(), bufSize);
   address->SetLength(strlen(address->BeginReading()));
 
   return NS_OK;
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -511,17 +511,18 @@ int NrSocket::sendto(const void *msg, si
     // Tolerate rate of 3.6k/sec over twenty seconds.
     static SimpleTokenBucket sustained(3686*20, 3686);
 
     // Check number of tokens in each bucket.
     if (burst.getTokens(UINT32_MAX) < len ||
         sustained.getTokens(UINT32_MAX) < len) {
       r_log(LOG_GENERIC, LOG_ERR,
                  "Global rate limit for STUN requests exceeded.");
-      MOZ_ASSERT("Global rate limit for STUN requests exceeded. Go bug "
+      MOZ_ASSERT(false,
+                 "Global rate limit for STUN requests exceeded. Go bug "
                  "bcampen@mozilla.com if you weren't intentionally spamming "
                  "ICE candidates, or don't know what that means.");
       ABORT(R_WOULDBLOCK);
     }
 
     // Take len tokens from both buckets.
     // (not threadsafe, but no problem since this is only called from STS)
     burst.getTokens(len);