LibJS: Fix modulo() template argument deduction on i686

Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp:283:24:
    note: deduced conflicting types for parameter 'T' ('long long int'
    and 'long int')
      283 |     nanosecond = modulo(nanosecond, 1000l);
          |                  ~~~~~~^~~~~~~~~~~~~~~~~~~

Worked fine on x86_84 :yakshrug:
This commit is contained in:
Linus Groh 2021-11-07 21:33:56 +00:00
parent b3ea7332b2
commit a3b8303f3c
Notes: sideshowbarker 2024-07-18 01:26:16 +09:00

View file

@ -280,37 +280,37 @@ DaysAndTime balance_time(i64 hour, i64 minute, i64 second, i64 millisecond, i64
microsecond += nanosecond / 1000;
// 3. Set nanosecond to nanosecond modulo 1000.
nanosecond = modulo(nanosecond, 1000l);
nanosecond = modulo(nanosecond, (i64)1000);
// 4. Set millisecond to millisecond + floor(microsecond / 1000).
millisecond += microsecond / 1000;
// 5. Set microsecond to microsecond modulo 1000.
microsecond = modulo(microsecond, 1000l);
microsecond = modulo(microsecond, (i64)1000);
// 6. Set second to second + floor(millisecond / 1000).
second += millisecond / 1000;
// 7. Set millisecond to millisecond modulo 1000.
millisecond = modulo(millisecond, 1000l);
millisecond = modulo(millisecond, (i64)1000);
// 8. Set minute to minute + floor(second / 60).
minute += second / 60;
// 9. Set second to second modulo 60.
second = modulo(second, 60l);
second = modulo(second, (i64)60);
// 10. Set hour to hour + floor(minute / 60).
hour += minute / 60;
// 11. Set minute to minute modulo 60.
minute = modulo(minute, 60l);
minute = modulo(minute, (i64)60);
// 12. Let days be floor(hour / 24).
u8 days = hour / 24;
// 13. Set hour to hour modulo 24.
hour = modulo(hour, 24l);
hour = modulo(hour, (i64)24);
// 14. Return the Record { [[Days]]: days, [[Hour]]: hour, [[Minute]]: minute, [[Second]]: second, [[Millisecond]]: millisecond, [[Microsecond]]: microsecond, [[Nanosecond]]: nanosecond }.
return DaysAndTime {