backend: dont overflow on 32bit builds (#64)

make the definition long long as its used as long long later, only the
value was being calculated TIMESPEC_NSEC_PER_SEC * 240 and rolls over
before assigning to the variable.
This commit is contained in:
Tom Englund 2024-08-25 17:48:53 +02:00 committed by GitHub
parent 31e692b20d
commit ddf6987b53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ using namespace Hyprutils::Memory;
using namespace Aquamarine;
#define SP CSharedPointer
#define TIMESPEC_NSEC_PER_SEC 1000000000L
#define TIMESPEC_NSEC_PER_SEC 1000000000LL
static void timespecAddNs(timespec* pTimespec, int64_t delta) {
int delta_ns_low = delta % TIMESPEC_NSEC_PER_SEC;

View file

@ -10,7 +10,7 @@ using namespace Hyprutils::Memory;
using namespace Hyprutils::Math;
#define SP CSharedPointer
#define TIMESPEC_NSEC_PER_SEC 1000000000L
#define TIMESPEC_NSEC_PER_SEC 1000000000LL
static void timespecAddNs(timespec* pTimespec, int64_t delta) {
int delta_ns_low = delta % TIMESPEC_NSEC_PER_SEC;