Skip to content

Commit

Permalink
Merge pull request #151 from edgar-bonet/signed-compare
Browse files Browse the repository at this point in the history
Fix signed/unsigned compare warnings
  • Loading branch information
drak7 authored Apr 21, 2020
2 parents 4091281 + 13ac614 commit a40bfbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RTClib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ DateTime::DateTime(uint32_t t) {
uint8_t leap;
for (yOff = 0;; ++yOff) {
leap = yOff % 4 == 0;
if (days < 365 + leap)
if (days < 365U + leap)
break;
days -= 365 + leap;
}
Expand Down Expand Up @@ -448,7 +448,7 @@ char *DateTime::toString(char *buffer) {
}
}

for (int i = 0; i < strlen(buffer) - 1; i++) {
for (size_t i = 0; i < strlen(buffer) - 1; i++) {
if (buffer[i] == 'h' && buffer[i + 1] == 'h') {
if (!apTag) { // 24 Hour Mode
buffer[i] = '0' + hh / 10;
Expand Down

0 comments on commit a40bfbc

Please sign in to comment.