Skip to content

Commit

Permalink
headless: dont overflow on 32bit builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gulafaran committed Aug 25, 2024
1 parent 31e692b commit 28f4d83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/Headless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 28f4d83

Please sign in to comment.