Fix-Point commented on code in PR #21491:
URL: https://github.com/apache/nuttx/pull/21491#discussion_r4625724592
##########
libs/libc/time/lib_gmtimer.c:
##########
@@ -301,15 +307,18 @@ FAR struct tm *gmtime_r(FAR const time_t *timep, FAR
struct tm *result)
epoch = *timep;
linfo("timer=%d\n", (int)epoch);
- /* Convert to days, hours, minutes, and seconds since the EPOCH */
+ /* Convert to days, hours, minutes, and seconds since the EPOCH.
+ * div_const() keeps the time math out of the division library; it
+ * needs a non-negative epoch.
+ */
- jdn = epoch / SEC_PER_DAY;
+ jdn = div_const(epoch, SEC_PER_DAY);
Review Comment:
Thank you for suggestions. The change you refer to came from
*"libs/libc/time: fold the gmtime time split out of 64-bit division"*, which
was dropped from the series in an earlier revision.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]