1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-14 20:10:08 +03:00

Compilation fix

This commit is contained in:
Bertrand Songis 2020-10-03 11:42:23 +02:00
parent a07fb2bb5a
commit 41bb035ce5
No known key found for this signature in database
GPG key ID: F189F79290FEC50F
3 changed files with 11 additions and 11 deletions

View file

@ -170,11 +170,11 @@ char * strAppendStringWithIndex(char * dest, const char * s, int idx)
return strAppendUnsigned(strAppend(dest, s), abs(idx));
}
constexpr int32_t secondsPerDay = 24 * 3600;
constexpr int32_t secondsPer99Hours = 99*3600 + 59*60 + 59;
constexpr int32_t secondsPerYear = 365 * secondsPerDay;
constexpr int secondsPerDay = 24 * 3600;
constexpr int secondsPer99Hours = 99*3600 + 59*60 + 59;
constexpr int secondsPerYear = 365 * secondsPerDay;
char * getTimerString(char * dest, int32_t tme, uint8_t hours)
char * getTimerString(char * dest, int tme, uint8_t hours)
{
char * s = dest;
div_t qr;
@ -208,7 +208,7 @@ char * getTimerString(char * dest, int32_t tme, uint8_t hours)
*s = '\0';
}
else if (tme < secondsPer99Hours) {
qr = div((int) tme, 3600);
qr = div(tme, 3600);
div_t qr2 = div(qr.rem, 60);
*s++ = '0' + (qr.quot / 10);
*s++ = '0' + (qr.quot % 10);
@ -218,7 +218,7 @@ char * getTimerString(char * dest, int32_t tme, uint8_t hours)
*s = '\0';
}
else if (tme < secondsPerYear) {
qr = div((int) tme, secondsPerDay);
qr = div(tme, secondsPerDay);
div_t qr2 = div(qr.rem, 60);
*s++ = '0' + (qr.quot / 100);
*s++ = '0' + (qr.quot / 10);
@ -230,7 +230,7 @@ char * getTimerString(char * dest, int32_t tme, uint8_t hours)
*s = '\0';
}
else {
qr = div((int) tme, secondsPerYear);
qr = div(tme, secondsPerYear);
div_t qr2 = div(qr.rem, secondsPerDay);
*s++ = '0' + (qr.quot / 10);
*s++ = '0' + (qr.quot % 10);