RTEMS | score: timespecgetasnanoseconds.c replace magic number with constant (!1534)

Avi Weiss (@thnkslprpt) gitlab at rtems.org
Sat Oct 10 09:17:37 UTC 2026



Avi Weiss created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1534

Project:Branches: thnkslprpt/rtems:score-timespec-use-nanoseconds-constant to rtems/rtos/rtems:main
Author: Avi Weiss

## Summary

`cpukit/score/src/timespecgetasnanoseconds.c`

Replace `1000000000ULL` with already included constant macro
`TOD_NANOSECONDS_PER_SECOND`. I added the `ULL` cast to keep it identical.

Did not test on hardware but I did check it on Godbolt and can confirm that the `x86-64 GCC 13.2` and `ARM GCC 16.1.0` compilations are identical - with optimisation off and also with -O3

<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1534
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/49/sent_notifications/6-egas25upwopvw5w5nbrm2jhog-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20261010/eaaac3aa/attachment.htm>


More information about the bugs mailing list