Skip to content

Commit

Permalink
cellRtc: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
capriots committed Apr 16, 2024
1 parent b19391c commit 749d841
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions rpcs3/Emu/Cell/Modules/cellRtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,15 @@ error_code cellRtcFormatRfc2822(vm::ptr<char> pszDateTime, vm::cptr<CellRtcTick>
return CELL_RTC_ERROR_INVALID_POINTER;
}

vm::var<CellRtcTick> rtc_tick{ *pUtc };
vm::var<CellRtcTick> rtc_tick;
if (!pUtc) // Should always evaluate to false, nullptr was already checked above
{
cellRtcGetCurrentTick(rtc_tick);
}
else
{
rtc_tick->tick = pUtc->tick;
}

vm::var<CellRtcDateTime> date_time;

Expand Down Expand Up @@ -333,7 +341,15 @@ error_code cellRtcFormatRfc3339(vm::ptr<char> pszDateTime, vm::cptr<CellRtcTick>
return CELL_RTC_ERROR_INVALID_POINTER;
}

vm::var<CellRtcTick> rtc_tick{ *pUtc };
vm::var<CellRtcTick> rtc_tick;
if (!pUtc) // Should always evaluate to false, nullptr was already checked above
{
cellRtcGetCurrentTick(rtc_tick);
}
else
{
rtc_tick->tick = pUtc->tick;
}

vm::var<CellRtcDateTime> date_time;

Expand Down Expand Up @@ -378,7 +394,7 @@ error_code cellRtcFormatRfc3339(vm::ptr<char> pszDateTime, vm::cptr<CellRtcTick>
pszDateTime[0x12] = ascii(date_time->second % 10);
pszDateTime[0x13] = '.';

// Microseconds - 2020-04-13T10:56:31.XX+66:40
// Hundredths of a second - 2020-04-13T10:56:31.XX+66:40
pszDateTime[0x14] = ascii(date_time->microsecond / 100'000);
pszDateTime[0x15] = ascii(date_time->microsecond / 10'000 % 10);

Expand Down

0 comments on commit 749d841

Please sign in to comment.