mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-26 21:04:23 +08:00
protoc-c: Fix -Wsign-compare diagnostics
This commit fixes the following compiler diagnostics: ../protoc-c/c_helpers.cc: In function ‘void google::protobuf::compiler::c::PrintComment(google::protobuf::io::Printer*, std::__cxx11::string)’: ../protoc-c/c_helpers.cc:221:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] for (int i = 0; i < comment_lines.size(); i++) ~~^~~~~~~~~~~~~~~~~~~~~~ ../protoc-c/c_helpers.cc: In function ‘std::set<std::__cxx11::basic_string<char> > google::protobuf::compiler::c::MakeKeywordsMap()’: ../protoc-c/c_helpers.cc:273:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] for (int i = 0; i < GOOGLE_ARRAYSIZE(kKeywordList); i++) { ^
This commit is contained in:
parent
69fc2f13bb
commit
2c63d76205
@ -234,7 +234,7 @@ void PrintComment (io::Printer* printer, std::string comment)
|
||||
std::vector<std::string> comment_lines;
|
||||
SplitStringUsing (comment, "\r\n", &comment_lines);
|
||||
printer->Print ("/*\n");
|
||||
for (int i = 0; i < comment_lines.size(); i++)
|
||||
for (size_t i = 0; i < comment_lines.size(); i++)
|
||||
{
|
||||
if (!comment_lines[i].empty())
|
||||
{
|
||||
@ -286,7 +286,7 @@ const char* const kKeywordList[] = {
|
||||
|
||||
std::set<std::string> MakeKeywordsMap() {
|
||||
std::set<std::string> result;
|
||||
for (int i = 0; i < GOOGLE_ARRAYSIZE(kKeywordList); i++) {
|
||||
for (size_t i = 0; i < GOOGLE_ARRAYSIZE(kKeywordList); i++) {
|
||||
result.insert(kKeywordList[i]);
|
||||
}
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user