diff --git a/pc/peerconnection_bundle_unittest.cc b/pc/peerconnection_bundle_unittest.cc index d36ad2e3c2..8e41d3d139 100644 --- a/pc/peerconnection_bundle_unittest.cc +++ b/pc/peerconnection_bundle_unittest.cc @@ -92,9 +92,10 @@ class PeerConnectionWrapperForBundleTest : public PeerConnectionWrapper { } PeerConnection* GetInternalPeerConnection() { - auto* pci = reinterpret_cast< - PeerConnectionProxyWithInternal*>(pc()); - return reinterpret_cast(pci->internal()); + auto* pci = + static_cast*>( + pc()); + return static_cast(pci->internal()); } // Returns true if the stats indicate that an ICE connection is either in diff --git a/pc/peerconnection_datachannel_unittest.cc b/pc/peerconnection_datachannel_unittest.cc index 918544cc27..02bac685b4 100644 --- a/pc/peerconnection_datachannel_unittest.cc +++ b/pc/peerconnection_datachannel_unittest.cc @@ -74,9 +74,10 @@ class PeerConnectionWrapperForDataChannelTest : public PeerConnectionWrapper { } PeerConnection* GetInternalPeerConnection() { - auto* pci = reinterpret_cast< - PeerConnectionProxyWithInternal*>(pc()); - return reinterpret_cast(pci->internal()); + auto* pci = + static_cast*>( + pc()); + return static_cast(pci->internal()); } private: diff --git a/pc/peerconnection_ice_unittest.cc b/pc/peerconnection_ice_unittest.cc index 52de1f65a4..e6ba598e44 100644 --- a/pc/peerconnection_ice_unittest.cc +++ b/pc/peerconnection_ice_unittest.cc @@ -187,11 +187,10 @@ class PeerConnectionIceUnitTest : public ::testing::Test { // TODO(qingsi): Rewrite this method in terms of the standard IceTransport // after it is implemented. cricket::IceRole GetIceRole(const WrapperPtr& pc_wrapper_ptr) { - auto* pc_proxy = reinterpret_cast< - PeerConnectionProxyWithInternal*>( - pc_wrapper_ptr->pc()); - PeerConnection* pc = - reinterpret_cast(pc_proxy->internal()); + auto* pc_proxy = + static_cast*>( + pc_wrapper_ptr->pc()); + PeerConnection* pc = static_cast(pc_proxy->internal()); return pc->voice_channel() ->rtp_dtls_transport() ->ice_transport() diff --git a/pc/peerconnection_signaling_unittest.cc b/pc/peerconnection_signaling_unittest.cc index 48de0ab540..282ce1ce53 100644 --- a/pc/peerconnection_signaling_unittest.cc +++ b/pc/peerconnection_signaling_unittest.cc @@ -48,9 +48,10 @@ class PeerConnectionWrapperForSignalingTest : public PeerConnectionWrapper { } PeerConnection* GetInternalPeerConnection() { - auto* pci = reinterpret_cast< - PeerConnectionProxyWithInternal*>(pc()); - return reinterpret_cast(pci->internal()); + auto* pci = + static_cast*>( + pc()); + return static_cast(pci->internal()); } };