Bug 1304568: Fix some bad casts. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 22 Sep 2016 09:31:30 -0500
changeset 315365 8de3dbbe8e3a3a5cefaf224f8d2764c4998d1afb
parent 315364 40bb8f061490845dca8c73c40bd927a0dc483500
child 315366 c651f7174f37747de99eaafd27b2d78fb10bead3
push id30748
push usercbook@mozilla.com
push dateWed, 28 Sep 2016 13:53:19 +0000
treeherdermozilla-central@8c84b7618840 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1304568
milestone52.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 1304568: Fix some bad casts. r=drno MozReview-Commit-ID: XJhCywlTpg
media/mtransport/nr_socket_prsock.cpp
media/mtransport/test_nr_socket.cpp
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -2244,43 +2244,43 @@ static int nr_socket_local_close(void *o
 
   sock->close();
 
   return 0;
 }
 
 static int nr_socket_local_write(void *obj, const void *msg, size_t len,
                                  size_t *written) {
-  NrSocket *sock = static_cast<NrSocket *>(obj);
+  NrSocketBase *sock = static_cast<NrSocketBase *>(obj);
 
   return sock->write(msg, len, written);
 }
 
 static int nr_socket_local_read(void *obj, void * restrict buf, size_t maxlen,
                                 size_t *len) {
-  NrSocket *sock = static_cast<NrSocket *>(obj);
+  NrSocketBase *sock = static_cast<NrSocketBase *>(obj);
 
   return sock->read(buf, maxlen, len);
 }
 
 static int nr_socket_local_connect(void *obj, nr_transport_addr *addr) {
-  NrSocket *sock = static_cast<NrSocket *>(obj);
+  NrSocketBase *sock = static_cast<NrSocketBase *>(obj);
 
   return sock->connect(addr);
 }
 
 static int nr_socket_local_listen(void *obj, int backlog) {
-  NrSocket *sock = static_cast<NrSocket *>(obj);
+  NrSocketBase *sock = static_cast<NrSocketBase *>(obj);
 
   return sock->listen(backlog);
 }
 
 static int nr_socket_local_accept(void *obj, nr_transport_addr *addrp,
                                   nr_socket **sockp) {
-  NrSocket *sock = static_cast<NrSocket *>(obj);
+  NrSocketBase *sock = static_cast<NrSocketBase *>(obj);
 
   return sock->accept(addrp, sockp);
 }
 
 // Implement async api
 int NR_async_wait(NR_SOCKET sock, int how, NR_async_cb cb,void *cb_arg,
                   char *function,int line) {
   NrSocketBase *s = static_cast<NrSocketBase *>(sock);
--- a/media/mtransport/test_nr_socket.cpp
+++ b/media/mtransport/test_nr_socket.cpp
@@ -686,17 +686,17 @@ void TestNrSocket::destroy_stale_port_ma
     }
   }
 }
 
 void TestNrSocket::socket_readable_callback(void *real_sock_v,
                                              int how,
                                              void *test_sock_v) {
   TestNrSocket *test_socket = static_cast<TestNrSocket*>(test_sock_v);
-  NrSocket *real_socket = static_cast<NrSocket*>(real_sock_v);
+  NrSocketBase *real_socket = static_cast<NrSocketBase*>(real_sock_v);
 
   test_socket->on_socket_readable(real_socket);
 }
 
 void TestNrSocket::on_socket_readable(NrSocketBase *real_socket) {
   if (!readable_socket_ && (real_socket != internal_socket_)) {
     readable_socket_ = real_socket;
   }