diff options
author | 2016-09-21 05:55:41 -0800 | |
---|---|---|
committer | 2016-09-21 07:01:05 -0700 | |
commit | 08a6ebc3ad2194a61ef310a1da97e4402a5a00bb (patch) | |
tree | 7a9687a6a991e4375e47eac745c2ffe704e314ef /tensorflow | |
parent | 6333762303f2b858372ca779967d9fc1aa948b86 (diff) |
Clean up warnings and IWYU in tensorflow/core/lib.
Change: 133826999
Diffstat (limited to 'tensorflow')
-rw-r--r-- | tensorflow/core/lib/gtl/inlined_vector.h | 2 | ||||
-rw-r--r-- | tensorflow/core/lib/random/random_distributions.h | 4 | ||||
-rw-r--r-- | tensorflow/core/lib/strings/numbers.cc | 1 | ||||
-rw-r--r-- | tensorflow/core/lib/strings/str_util.h | 2 |
4 files changed, 7 insertions, 2 deletions
diff --git a/tensorflow/core/lib/gtl/inlined_vector.h b/tensorflow/core/lib/gtl/inlined_vector.h index 21af965da2..640bbf6597 100644 --- a/tensorflow/core/lib/gtl/inlined_vector.h +++ b/tensorflow/core/lib/gtl/inlined_vector.h @@ -441,7 +441,7 @@ class InlinedVector { DiscardStorage(); u_.data[kSize - 1] = kSentinel; - u_.data[kSize - 2] = target_lg; + u_.data[kSize - 2] = static_cast<unsigned char>(target_lg); set_size_internal(s); DCHECK_EQ(capacity(), target); set_outofline_pointer(dst); diff --git a/tensorflow/core/lib/random/random_distributions.h b/tensorflow/core/lib/random/random_distributions.h index a48811053a..dc29dc1eaa 100644 --- a/tensorflow/core/lib/random/random_distributions.h +++ b/tensorflow/core/lib/random/random_distributions.h @@ -16,6 +16,10 @@ limitations under the License. #ifndef TENSORFLOW_LIB_RANDOM_RANDOM_DISTRIBUTIONS_H_ #define TENSORFLOW_LIB_RANDOM_RANDOM_DISTRIBUTIONS_H_ +#define _USE_MATH_DEFINES +#include <cmath> +#undef _USE_MATH_DEFINES + #include <math.h> #include <string.h> #include <algorithm> diff --git a/tensorflow/core/lib/strings/numbers.cc b/tensorflow/core/lib/strings/numbers.cc index de7bd30a47..797233e746 100644 --- a/tensorflow/core/lib/strings/numbers.cc +++ b/tensorflow/core/lib/strings/numbers.cc @@ -20,6 +20,7 @@ limitations under the License. #include <stdlib.h> #include <algorithm> #include <cmath> +#include <locale> #include <unordered_map> #include "tensorflow/core/lib/strings/stringprintf.h" diff --git a/tensorflow/core/lib/strings/str_util.h b/tensorflow/core/lib/strings/str_util.h index 288b599441..135d2f744e 100644 --- a/tensorflow/core/lib/strings/str_util.h +++ b/tensorflow/core/lib/strings/str_util.h @@ -162,7 +162,7 @@ inline std::vector<string> Split(StringPiece text, char delim) { template <typename Predicate> std::vector<string> Split(StringPiece text, char delim, Predicate p) { std::vector<string> result; - int token_start = 0; + size_t token_start = 0; if (!text.empty()) { for (size_t i = 0; i < text.size() + 1; i++) { if ((i == text.size()) || (text[i] == delim)) { |