in resolution of [Wsign-compare] warning ids : [16, 18, 19, 20, 21 ]
This commit is contained in:
parent
e091394605
commit
7581d2a338
tensorflow/core
@ -214,7 +214,7 @@ bool Env::FilesExist(const std::vector<string>& files,
|
||||
}
|
||||
if (fs_status) {
|
||||
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);
|
||||
}
|
||||
} else if (!fs_result) {
|
||||
|
@ -309,7 +309,7 @@ StringPiece FileSystem::Extension(StringPiece path) const {
|
||||
StringPiece basename = this->Basename(path);
|
||||
|
||||
int pos = basename.rfind('.');
|
||||
if (pos == StringPiece::npos) {
|
||||
if (static_cast<size_t>(pos) == StringPiece::npos) {
|
||||
return StringPiece(path.data() + path.size(), 0);
|
||||
} else {
|
||||
return StringPiece(path.data() + pos + 1, path.size() - (pos + 1));
|
||||
|
@ -103,7 +103,7 @@ Status GetMatchingPaths(FileSystem* fs, Env* env, const string& pattern,
|
||||
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]);
|
||||
// If the IsDirectory call was cancelled we bail.
|
||||
if (children_dir_status[i].code() == tensorflow::error::CANCELLED) {
|
||||
|
@ -74,7 +74,7 @@ class StatusLogSink : public TFLogSink {
|
||||
|
||||
mutex_lock lock(mu_);
|
||||
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:
|
||||
|
@ -51,7 +51,7 @@ std::vector<absl::string_view> SplitPairs(absl::string_view metadata) {
|
||||
std::vector<absl::string_view> key_value_pairs;
|
||||
std::stack<char> quotes;
|
||||
int start = 0, end = 0;
|
||||
for (; end < metadata.size(); ++end) {
|
||||
for (; static_cast<size_t>(end) < metadata.size(); ++end) {
|
||||
char ch = metadata[end];
|
||||
switch (ch) {
|
||||
case '\"':
|
||||
|
Loading…
Reference in New Issue
Block a user