in resolution of [Wsign-compare] warning ids : [16, 18, 19, 20, 21 ]

This commit is contained in:
Tare Gaskin 2020-06-03 22:29:16 +00:00
parent e091394605
commit 7581d2a338
5 changed files with 5 additions and 5 deletions

View File

@ -214,7 +214,7 @@ bool Env::FilesExist(const std::vector<string>& files,
} }
if (fs_status) { if (fs_status) {
result &= fs_result; result &= fs_result;
for (int i = 0; i < itr.second.size(); ++i) { for (size_t i = 0; i < itr.second.size(); ++i) {
per_file_status[itr.second[i]] = fs_status->at(i); per_file_status[itr.second[i]] = fs_status->at(i);
} }
} else if (!fs_result) { } else if (!fs_result) {

View File

@ -309,7 +309,7 @@ StringPiece FileSystem::Extension(StringPiece path) const {
StringPiece basename = this->Basename(path); StringPiece basename = this->Basename(path);
int pos = basename.rfind('.'); int pos = basename.rfind('.');
if (pos == StringPiece::npos) { if (static_cast<size_t>(pos) == StringPiece::npos) {
return StringPiece(path.data() + path.size(), 0); return StringPiece(path.data() + path.size(), 0);
} else { } else {
return StringPiece(path.data() + pos + 1, path.size() - (pos + 1)); return StringPiece(path.data() + pos + 1, path.size() - (pos + 1));

View File

@ -103,7 +103,7 @@ Status GetMatchingPaths(FileSystem* fs, Env* env, const string& pattern,
children_dir_status[i] = fs->IsDirectory(child_path); children_dir_status[i] = fs->IsDirectory(child_path);
} }
}); });
for (int i = 0; i < children.size(); ++i) { for (size_t i = 0; i < children.size(); ++i) {
const string child_path = io::JoinPath(current_dir, children[i]); const string child_path = io::JoinPath(current_dir, children[i]);
// If the IsDirectory call was cancelled we bail. // If the IsDirectory call was cancelled we bail.
if (children_dir_status[i].code() == tensorflow::error::CANCELLED) { if (children_dir_status[i].code() == tensorflow::error::CANCELLED) {

View File

@ -74,7 +74,7 @@ class StatusLogSink : public TFLogSink {
mutex_lock lock(mu_); mutex_lock lock(mu_);
messages_.emplace_back(entry.ToString()); messages_.emplace_back(entry.ToString());
if (messages_.size() > num_messages_) messages_.pop_front(); if (messages_.size() > static_cast<size_t>(num_messages_)) messages_.pop_front();
} }
private: private:

View File

@ -51,7 +51,7 @@ std::vector<absl::string_view> SplitPairs(absl::string_view metadata) {
std::vector<absl::string_view> key_value_pairs; std::vector<absl::string_view> key_value_pairs;
std::stack<char> quotes; std::stack<char> quotes;
int start = 0, end = 0; int start = 0, end = 0;
for (; end < metadata.size(); ++end) { for (; static_cast<size_t>(end) < metadata.size(); ++end) {
char ch = metadata[end]; char ch = metadata[end];
switch (ch) { switch (ch) {
case '\"': case '\"':