mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 04:56:00 +01:00
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:
parent
31e692b20d
commit
ddf6987b53
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ using namespace Hyprutils::Memory;
|
||||||
using namespace Aquamarine;
|
using namespace Aquamarine;
|
||||||
#define SP CSharedPointer
|
#define SP CSharedPointer
|
||||||
|
|
||||||
#define TIMESPEC_NSEC_PER_SEC 1000000000L
|
#define TIMESPEC_NSEC_PER_SEC 1000000000LL
|
||||||
|
|
||||||
static void timespecAddNs(timespec* pTimespec, int64_t delta) {
|
static void timespecAddNs(timespec* pTimespec, int64_t delta) {
|
||||||
int delta_ns_low = delta % TIMESPEC_NSEC_PER_SEC;
|
int delta_ns_low = delta % TIMESPEC_NSEC_PER_SEC;
|
||||||
|
|
|
@ -10,7 +10,7 @@ using namespace Hyprutils::Memory;
|
||||||
using namespace Hyprutils::Math;
|
using namespace Hyprutils::Math;
|
||||||
#define SP CSharedPointer
|
#define SP CSharedPointer
|
||||||
|
|
||||||
#define TIMESPEC_NSEC_PER_SEC 1000000000L
|
#define TIMESPEC_NSEC_PER_SEC 1000000000LL
|
||||||
|
|
||||||
static void timespecAddNs(timespec* pTimespec, int64_t delta) {
|
static void timespecAddNs(timespec* pTimespec, int64_t delta) {
|
||||||
int delta_ns_low = delta % TIMESPEC_NSEC_PER_SEC;
|
int delta_ns_low = delta % TIMESPEC_NSEC_PER_SEC;
|
||||||
|
|
Loading…
Reference in a new issue