Bug 1389851 - netwerk: Fix -Wunreachable-code-return warning in nsGIOProtocolHandler.cpp. r?karlt draft
authorChris Peterson <cpeterson@mozilla.com>
Wed, 09 Aug 2017 00:38:15 -0700
changeset 647395 41a95f938fc5c05e0e8564bed0f615a483dc3a38
parent 647394 bb01ae0692d6c9ce5b89b1826d472c4d70497ce1
child 647396 cece7c9c21056a8ae9e9f91aaaa46f56aa5ea86e
push id74381
push usercpeterson@mozilla.com
push dateWed, 16 Aug 2017 08:08:22 +0000
reviewerskarlt
bugs1389851
milestone57.0a1
Bug 1389851 - netwerk: Fix -Wunreachable-code-return warning in nsGIOProtocolHandler.cpp. r?karlt netwerk/protocol/gio/nsGIOProtocolHandler.cpp:89:10: warning: 'return' will never be executed [-Wunreachable-code-return] This `return NS_ERROR_FAILURE` statement at the end of this function is unreachable because all of the preceding switch statement's cases return. MozReview-Commit-ID: 3qDu2IqTPrW
netwerk/protocol/gio/nsGIOProtocolHandler.cpp
--- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
+++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
@@ -80,18 +80,16 @@ MapGIOResult(gint code)
   G_IO_ERROR_BUSY,
   G_IO_ERROR_WOULD_MERGE,
   G_IO_ERROR_TOO_MANY_OPEN_FILES
 */
     // Make GCC happy
     default:
       return NS_ERROR_FAILURE;
   }
-
-  return NS_ERROR_FAILURE;
 }
 
 static nsresult
 MapGIOResult(GError *result)
 {
   if (!result)
     return NS_OK;
   return MapGIOResult(result->code);