mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/timex: change type of NS_PER_SEC
Having NS_PER_SEC defined as `1000000000U` is quite a foot gun, as multiplication even with small numbers in 32 bit quickly overflows. Using the `1000000000LLU` instead forces 64 bit math.
This commit is contained in:
parent
3234b918e3
commit
d59607ddb7
@ -66,7 +66,7 @@ extern "C" {
|
||||
/**
|
||||
* @brief The number of nanoseconds per second
|
||||
*/
|
||||
#define NS_PER_SEC (1000000000U)
|
||||
#define NS_PER_SEC (1000000000LLU)
|
||||
|
||||
/**
|
||||
* @brief The maximum length of the string representation of a timex timestamp
|
||||
|
Loading…
Reference in New Issue
Block a user