Skip to content

Commit

Permalink
Merge pull request #6 from jeroendoggen/main
Browse files Browse the repository at this point in the history
Fix compiler warnings (gcc: -Wsign-compare)
  • Loading branch information
z4kn4fein authored Apr 14, 2023
2 parents ff29043 + 37b994d commit 695f77f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/semver/semver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace semver
prerelease_descriptor increment() const {
std::vector<prerelease_part> new_parts = (m_parts);
int last_numeric_index = -1;
for (int i = 0; i < new_parts.size(); ++i) {
for (size_t i = 0; i < new_parts.size(); ++i) {
if (new_parts[i].numeric()) last_numeric_index = i;
}
if (last_numeric_index != -1) {
Expand All @@ -159,7 +159,7 @@ namespace semver
auto other_size = other.m_parts.size();

auto count = std::min(this_size, other_size);
for (int i = 0; i < count; ++i) {
for (size_t i = 0; i < count; ++i) {
int cmp = m_parts[i].compare(other.m_parts[i]);
if (cmp != 0) return cmp;
}
Expand Down Expand Up @@ -370,4 +370,4 @@ namespace semver
}
}

#endif // Z4KN4FEIN_SEMVER_H
#endif // Z4KN4FEIN_SEMVER_H

0 comments on commit 695f77f

Please sign in to comment.