From: Christopher Dykes Date: Sat, 4 Jun 2016 00:43:13 +0000 (-0700) Subject: Deal with a couple of warnings from MSVC X-Git-Tag: 2016.07.26~165 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5911efa17496b5f4645955e143c3c0db40d1f9cc;p=folly.git Deal with a couple of warnings from MSVC Summary: MSVC is warning that `client` may be uninitialized, which is possible if the callback doesn't actually set them for some reason. Solve that by explicitly initializing it to `nullptr`. Also deal with the warning about the initialization of `dynamic::array` using braced syntax by not using that syntax. Reviewed By: yfeldblum Differential Revision: D3387782 fbshipit-source-id: e4d25ad32e99a73d7d062be9a2f2b5bde5d17396 --- diff --git a/folly/experimental/bser/Load.cpp b/folly/experimental/bser/Load.cpp index 2bd473b3..3f82dabb 100644 --- a/folly/experimental/bser/Load.cpp +++ b/folly/experimental/bser/Load.cpp @@ -79,7 +79,7 @@ static std::string decodeString(Cursor& curs) { } static dynamic decodeArray(Cursor& curs) { - dynamic arr{}; + dynamic arr = dynamic::array(); auto size = decodeInt(curs); while (size-- > 0) { arr.push_back(parseBser(curs)); diff --git a/folly/io/async/SSLContext.cpp b/folly/io/async/SSLContext.cpp index f0862263..8854b9be 100644 --- a/folly/io/async/SSLContext.cpp +++ b/folly/io/async/SSLContext.cpp @@ -591,8 +591,8 @@ int SSLContext::selectNextProtocolCallback(SSL* ssl, << "client should be deterministic in selecting protocols."; } - unsigned char *client; - unsigned int client_len; + unsigned char* client = nullptr; + unsigned int client_len = 0; bool filtered = false; auto cpf = ctx->getClientProtocolFilterCallback(); if (cpf) {