Skip to content
This repository has been archived by the owner on Oct 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #489 from robsavoye/warnings
Browse files Browse the repository at this point in the history
fix: Always uses size_t when comparing with an unsigned int
  • Loading branch information
emi420 authored Apr 2, 2024
2 parents ec54983 + 31bed43 commit d863b9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/bootstrap/bootstrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Bootstrap::threadBootstrapWayTask(WayTask wayTask)
auto wayval = std::make_shared<std::vector<std::shared_ptr<ValidateStatus>>>();

// Proccesing ways
for (int i = taskIndex * page_size; i < (taskIndex + 1) * page_size; ++i) {
for (size_t i = taskIndex * page_size; i < (taskIndex + 1) * page_size; ++i) {
if (i < ways->size()) {
auto way = ways->at(i);
wayval->push_back(validator->checkWay(way, "building"));
Expand Down Expand Up @@ -309,7 +309,7 @@ Bootstrap::threadBootstrapNodeTask(NodeTask nodeTask)

// Proccesing nodes
std::vector<std::string> node_tests = {"building", "natural", "place", "waterway"};
for (int i = taskIndex * page_size; i < (taskIndex + 1) * page_size; ++i) {
for (size_t i = taskIndex * page_size; i < (taskIndex + 1) * page_size; ++i) {
if (i < nodes->size()) {
auto node = nodes->at(i);
for (auto test_it = std::begin(node_tests); test_it != std::end(node_tests); ++test_it) {
Expand Down Expand Up @@ -344,7 +344,7 @@ Bootstrap::threadBootstrapRelationTask(RelationTask relationTask)
// auto relationval = std::make_shared<std::vector<std::shared_ptr<ValidateStatus>>>();

// Proccesing relations
for (int i = taskIndex * page_size; i < (taskIndex + 1) * page_size; ++i) {
for (size_t i = taskIndex * page_size; i < (taskIndex + 1) * page_size; ++i) {
if (i < relations->size()) {
auto relation = relations->at(i);
// relationval->push_back(validator->checkRelation(way, "building"));
Expand All @@ -362,4 +362,4 @@ Bootstrap::threadBootstrapRelationTask(RelationTask relationTask)

}

}
}
2 changes: 1 addition & 1 deletion src/data/pq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ std::string
Pq::escapedString(const std::string &s)
{
std::string newstr;
int i = 0;
size_t i = 0;
while (i < s.size()) {
// Single quote (')
if (s[i] == '\'') {
Expand Down
6 changes: 3 additions & 3 deletions src/validate/semantic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Semantic::checkNode(const osmobjects::OsmNode &node, const std::string &type, ya
auto required_tags = tests.get("required_tags");

std::string key;
int tagexists = 0;
size_t tagexists = 0;
status->center = node.point;

if (node.tags.count(type)) {
Expand Down Expand Up @@ -196,7 +196,7 @@ Semantic::checkWay(const osmobjects::OsmWay &way, const std::string &type, yaml:
return status;
}

int tagexists = 0;
size_t tagexists = 0;
if (way.tags.count(type)) {
for (auto vit = std::begin(way.tags); vit != std::end(way.tags); ++vit) {
if (check_badvalue) {
Expand Down Expand Up @@ -250,7 +250,7 @@ Semantic::checkRelation(const osmobjects::OsmRelation &relation, const std::stri
return status;
}

int tagexists = 0;
size_t tagexists = 0;
if (relation.tags.count(type)) {
for (auto vit = std::begin(relation.tags); vit != std::end(relation.tags); ++vit) {
if (check_badvalue) {
Expand Down

0 comments on commit d863b9d

Please sign in to comment.