Skip to content
Permalink
Browse files
Clean up gcc build warnings about reaching the end of a non void func…
…tion for webrtc classes

https://bugs.webkit.org/show_bug.cgi?id=178721

Patch by Alejandro G. Castro <alex@igalia.com> on 2017-10-24
Reviewed by Youenn Fablet.

Assert when we reach those situations and return some value after that to avoid warning.

No new tests, this is a clean up.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::sessionDescriptionType):
(WebCore::signalingState):
(WebCore::toRTCIceConnectionState):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::bundlePolicyfromConfiguration):
(WebCore::iceTransportPolicyfromConfiguration):

Canonical link: https://commits.webkit.org/194945@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alexgcastro authored and webkit-commit-queue committed Oct 25, 2017
1 parent b4e64a5 commit 0946c16d4b98db8e723c42e7c5ead485fafa43da
@@ -1,3 +1,22 @@
2017-10-24 Alejandro G. Castro <alex@igalia.com>

Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
https://bugs.webkit.org/show_bug.cgi?id=178721

Reviewed by Youenn Fablet.

Assert when we reach those situations and return some value after that to avoid warning.

No new tests, this is a clean up.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::sessionDescriptionType):
(WebCore::signalingState):
(WebCore::toRTCIceConnectionState):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::bundlePolicyfromConfiguration):
(WebCore::iceTransportPolicyfromConfiguration):

2017-10-24 Ryosuke Niwa <rniwa@webkit.org>

RenderSVGModelObject::checkIntersection triggers layout
@@ -93,6 +93,9 @@ static inline const char* sessionDescriptionType(RTCSdpType sdpType)
case RTCSdpType::Rollback:
return "rollback";
}

ASSERT_NOT_REACHED();
return "";
}

static inline RTCSdpType fromSessionDescriptionType(const webrtc::SessionDescriptionInterface& description)
@@ -600,6 +603,9 @@ static RTCSignalingState signalingState(webrtc::PeerConnectionInterface::Signali
case webrtc::PeerConnectionInterface::kClosed:
return RTCSignalingState::Stable;
}

ASSERT_NOT_REACHED();
return RTCSignalingState::Stable;
}

void LibWebRTCMediaEndpoint::OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState rtcState)
@@ -830,9 +836,11 @@ static inline RTCIceConnectionState toRTCIceConnectionState(webrtc::PeerConnecti
case webrtc::PeerConnectionInterface::kIceConnectionClosed:
return RTCIceConnectionState::Closed;
case webrtc::PeerConnectionInterface::kIceConnectionMax:
ASSERT_NOT_REACHED();
return RTCIceConnectionState::New;
break;
}

ASSERT_NOT_REACHED();
return RTCIceConnectionState::New;
}

void LibWebRTCMediaEndpoint::OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState state)
@@ -77,6 +77,9 @@ static inline webrtc::PeerConnectionInterface::BundlePolicy bundlePolicyfromConf
case RTCBundlePolicy::Balanced:
return webrtc::PeerConnectionInterface::kBundlePolicyBalanced;
}

ASSERT_NOT_REACHED();
return webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat;
}

static inline webrtc::PeerConnectionInterface::IceTransportsType iceTransportPolicyfromConfiguration(const MediaEndpointConfiguration& configuration)
@@ -87,6 +90,9 @@ static inline webrtc::PeerConnectionInterface::IceTransportsType iceTransportPol
case RTCIceTransportPolicy::All:
return webrtc::PeerConnectionInterface::kAll;
}

ASSERT_NOT_REACHED();
return webrtc::PeerConnectionInterface::kNone;
}

static webrtc::PeerConnectionInterface::RTCConfiguration configurationFromMediaEndpointConfiguration(MediaEndpointConfiguration&& configuration)

0 comments on commit 0946c16

Please sign in to comment.