Commit 5899b4ed authored by Sean Cannella's avatar Sean Cannella Committed by Sara Golemon

Fix various compiler warnings

Summary:
This allows projects that use -Wextra (sans -Wunused-parameter) to
compile folly.

Test Plan: compiled with gcc and clang

Reviewed By: meyering@fb.com

Subscribers: njormrod, kmdent, fma, benyluo, shikong, ranjeeth, subodh, pgriess

FB internal diff: D1509827
parent e892dc54
...@@ -322,7 +322,7 @@ void internalSplit(DelimT delim, StringPiece sp, OutputIterator out, ...@@ -322,7 +322,7 @@ void internalSplit(DelimT delim, StringPiece sp, OutputIterator out,
int tokenStartPos = 0; int tokenStartPos = 0;
int tokenSize = 0; int tokenSize = 0;
for (int i = 0; i <= strSize - dSize; ++i) { for (size_t i = 0; i <= strSize - dSize; ++i) {
if (atDelim(&s[i], delim)) { if (atDelim(&s[i], delim)) {
if (!ignoreEmpty || tokenSize > 0) { if (!ignoreEmpty || tokenSize > 0) {
*out++ = conv(StringPiece(&s[tokenStartPos], tokenSize)); *out++ = conv(StringPiece(&s[tokenStartPos], tokenSize));
...@@ -617,7 +617,7 @@ bool hexlify(const InputString& input, OutputString& output, ...@@ -617,7 +617,7 @@ bool hexlify(const InputString& input, OutputString& output,
static char hexValues[] = "0123456789abcdef"; static char hexValues[] = "0123456789abcdef";
int j = output.size(); int j = output.size();
output.resize(2 * input.size() + output.size()); output.resize(2 * input.size() + output.size());
for (int i = 0; i < input.size(); ++i) { for (size_t i = 0; i < input.size(); ++i) {
int ch = input[i]; int ch = input[i];
output[j++] = hexValues[(ch >> 4) & 0xf]; output[j++] = hexValues[(ch >> 4) & 0xf];
output[j++] = hexValues[ch & 0xf]; output[j++] = hexValues[ch & 0xf];
...@@ -639,7 +639,7 @@ bool unhexlify(const InputString& input, OutputString& output) { ...@@ -639,7 +639,7 @@ bool unhexlify(const InputString& input, OutputString& output) {
-1; -1;
}; };
for (int i = 0; i < input.size(); i += 2) { for (size_t i = 0; i < input.size(); i += 2) {
int highBits = unhex(input[i]); int highBits = unhex(input[i]);
int lowBits = unhex(input[i + 1]); int lowBits = unhex(input[i + 1]);
if (highBits < 0 || lowBits < 0) { if (highBits < 0 || lowBits < 0) {
......
...@@ -428,7 +428,8 @@ struct StaticMeta { ...@@ -428,7 +428,8 @@ struct StaticMeta {
#if !__APPLE__ #if !__APPLE__
template <class Tag> template <class Tag>
FOLLY_TLS ThreadEntry StaticMeta<Tag>::threadEntry_ = {0}; FOLLY_TLS ThreadEntry StaticMeta<Tag>::threadEntry_{nullptr, 0,
nullptr, nullptr};
#endif #endif
template <class Tag> StaticMeta<Tag>* StaticMeta<Tag>::inst_ = nullptr; template <class Tag> StaticMeta<Tag>* StaticMeta<Tag>::inst_ = nullptr;
......
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