Commit 4d813de0 authored by Michael Avrukin's avatar Michael Avrukin Committed by GitHub

Fix compiler warnings when running :protobuf_test

When running >bazel test :protobuf_test a few compiler warnings came up.  They were centered around the usage of "int" as the loop counter where the value should have been a size_t.
parent 8fcd24b8
...@@ -61,7 +61,7 @@ namespace compiler { ...@@ -61,7 +61,7 @@ namespace compiler {
// comma-separated string. // comma-separated string.
string CommaSeparatedList(const vector<const FileDescriptor*> all_files) { string CommaSeparatedList(const vector<const FileDescriptor*> all_files) {
vector<string> names; vector<string> names;
for (int i = 0; i < all_files.size(); i++) { for (size_t i = 0; i < all_files.size(); i++) {
names.push_back(all_files[i]->name()); names.push_back(all_files[i]->name());
} }
return Join(names, ","); return Join(names, ",");
...@@ -97,7 +97,7 @@ void MockCodeGenerator::ExpectGenerated( ...@@ -97,7 +97,7 @@ void MockCodeGenerator::ExpectGenerated(
while (!lines.empty() && lines.back().empty()) { while (!lines.empty() && lines.back().empty()) {
lines.pop_back(); lines.pop_back();
} }
for (int i = 0; i < lines.size(); i++) { for (size_t i = 0; i < lines.size(); i++) {
lines[i] += "\n"; lines[i] += "\n";
} }
...@@ -114,7 +114,7 @@ void MockCodeGenerator::ExpectGenerated( ...@@ -114,7 +114,7 @@ void MockCodeGenerator::ExpectGenerated(
EXPECT_EQ(kFirstInsertionPoint, lines[1 + insertion_list.size()]); EXPECT_EQ(kFirstInsertionPoint, lines[1 + insertion_list.size()]);
EXPECT_EQ(kSecondInsertionPoint, lines[2 + insertion_list.size() * 2]); EXPECT_EQ(kSecondInsertionPoint, lines[2 + insertion_list.size() * 2]);
for (int i = 0; i < insertion_list.size(); i++) { for (size_t i = 0; i < insertion_list.size(); i++) {
EXPECT_EQ(GetOutputFileContent(insertion_list[i], "first_insert", EXPECT_EQ(GetOutputFileContent(insertion_list[i], "first_insert",
file, file, first_message_name), file, file, first_message_name),
lines[1 + i]); lines[1 + i]);
...@@ -170,7 +170,7 @@ bool MockCodeGenerator::Generate( ...@@ -170,7 +170,7 @@ bool MockCodeGenerator::Generate(
SplitStringUsing(StripPrefixString(parameter, "insert="), SplitStringUsing(StripPrefixString(parameter, "insert="),
",", &insert_into); ",", &insert_into);
for (int i = 0; i < insert_into.size(); i++) { for (size_t i = 0; i < insert_into.size(); i++) {
{ {
google::protobuf::scoped_ptr<io::ZeroCopyOutputStream> output(context->OpenForInsert( google::protobuf::scoped_ptr<io::ZeroCopyOutputStream> output(context->OpenForInsert(
GetOutputFileName(insert_into[i], file), kFirstInsertionPointName)); GetOutputFileName(insert_into[i], file), kFirstInsertionPointName));
......
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