From 3c8771e929b8a4675c4ca641157be04398aca274 Mon Sep 17 00:00:00 2001 From: deadbeef Date: Tue, 28 Feb 2017 18:30:35 -0800 Subject: [PATCH] Fixing "control reaches end of non-void function" compile warning. Warning is benign in this case, and the returns won't ever actually be hit. BUG=chromium:697060 Review-Url: https://codereview.webrtc.org/2726633004 Cr-Commit-Position: refs/heads/master@{#16926} --- webrtc/api/mediatypes.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webrtc/api/mediatypes.cc b/webrtc/api/mediatypes.cc index fbcb53d85b..2e3538dad8 100644 --- a/webrtc/api/mediatypes.cc +++ b/webrtc/api/mediatypes.cc @@ -28,8 +28,9 @@ std::string MediaTypeToString(MediaType type) { case MEDIA_TYPE_DATA: return kMediaTypeData; } - // Not reachable; avoids compile warning. FATAL(); + // Not reachable; avoids compile warning. + return ""; } MediaType MediaTypeFromString(const std::string& type_str) { @@ -39,9 +40,10 @@ MediaType MediaTypeFromString(const std::string& type_str) { return MEDIA_TYPE_VIDEO; } else if (type_str == kMediaTypeData) { return MEDIA_TYPE_DATA; - } else { - FATAL(); } + FATAL(); + // Not reachable; avoids compile warning. + return static_cast(-1); } } // namespace cricket