Commit 0ea41166 authored by Ming Yi Teo's avatar Ming Yi Teo Committed by Facebook Github Bot

Enable -Wshorten-64-to-32 in wangle

Summary:
1. Add `"-Wshorten-64-to-32"` to `_extra_clang_flags`
2. Fix warnings generated from `buck build --keep-going wangle/...`

Reviewed By: chadaustin

Differential Revision: D19647345

fbshipit-source-id: 417840fe82ed3d5c9c2d989a0acf67e12758c1f9
parent ed9408bf
......@@ -56,7 +56,8 @@ class BlockingSocket : public folly::AsyncSocket::ConnectCallback,
void open(
std::chrono::milliseconds timeout = std::chrono::milliseconds::zero()) {
sock_->connect(this, address_, timeout.count());
DCHECK_LE(timeout.count(), std::numeric_limits<int>::max());
sock_->connect(this, address_, folly::to_narrow(timeout.count()));
eventBase_.loop();
if (err_.hasValue()) {
throw err_.value();
......@@ -79,7 +80,7 @@ class BlockingSocket : public folly::AsyncSocket::ConnectCallback,
if (err_.hasValue()) {
throw err_.value();
}
return len;
return folly::to_narrow(folly::to_signed(len));
}
void flush() {}
......@@ -160,6 +161,6 @@ class BlockingSocket : public folly::AsyncSocket::ConnectCallback,
throw folly::AsyncSocketException(
folly::AsyncSocketException::UNKNOWN, "eof");
}
return len - readLen_;
return folly::to_narrow(folly::to_signed(len - readLen_));
}
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment