X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FIPAddress.cpp;h=792b75a4afac5a1da4b6c39580f4185e0bf517fb;hb=6b1a43fd0712c15cb98f134bc2d8c89713b24513;hp=e1ac5b890d1b6f0765633911eff7c843f534d774;hpb=4dd1dd685b0397a36b21a057f588191ac0cfe6c6;p=folly.git diff --git a/folly/IPAddress.cpp b/folly/IPAddress.cpp index e1ac5b89..792b75a4 100644 --- a/folly/IPAddress.cpp +++ b/folly/IPAddress.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,8 @@ CIDRNetwork IPAddress::createNetwork(StringPiece ipSlashCidr, "'")); } IPAddress subnet(vec.at(0)); - uint8_t cidr = (defaultCidr > -1) ? defaultCidr : (subnet.isV4() ? 32 : 128); + auto cidr = + uint8_t((defaultCidr > -1) ? defaultCidr : (subnet.isV4() ? 32 : 128)); if (elemCount == 2) { try { @@ -419,7 +420,6 @@ IPAddress::longestCommonPrefix(const CIDRNetwork& one, const CIDRNetwork& two) { } else { throw std::invalid_argument("Unknown address family"); } - return {IPAddress(0), uint8_t(0)}; } [[noreturn]] void IPAddress::asV4Throw() const {