refactor: remove guarded helper headers

This commit is contained in:
2026-08-12 16:45:27 +09:00
parent 4e8720a40d
commit 211a6917b2
17 changed files with 45 additions and 75 deletions

View File

@@ -1,4 +1,5 @@
#include "wayland_state.h"
#include "dat.h"
#include "fn.h"
#include <limits.h>
#include <string.h>
@@ -39,10 +40,9 @@ wlstaterepeatinfo(Wlstate *s, int rate, int delay)
}
int
wlstatepress(Wlstate *s, uint32_t key, int eaten, int repeatable,
uint64_t now)
wlstatepress(Wlstate *s, u32int key, int eaten, int repeatable, uvlong now)
{
uint64_t delay;
uvlong delay;
if(key >= Wlkeymax)
return 0;
@@ -50,8 +50,8 @@ wlstatepress(Wlstate *s, uint32_t key, int eaten, int repeatable,
wlstatecancelrepeat(s);
if(eaten && repeatable && s->rate > 0){
delay = s->delay;
if(UINT64_MAX - now < delay)
s->repeatat = UINT64_MAX;
if(~(uvlong)0 - now < delay)
s->repeatat = ~(uvlong)0;
else
s->repeatat = now + delay;
s->repeatkey = key;
@@ -61,7 +61,7 @@ wlstatepress(Wlstate *s, uint32_t key, int eaten, int repeatable,
}
int
wlstaterelease(Wlstate *s, uint32_t key)
wlstaterelease(Wlstate *s, u32int key)
{
int forward;
@@ -75,9 +75,9 @@ wlstaterelease(Wlstate *s, uint32_t key)
}
int
wlstatetimeout(Wlstate *s, uint64_t now)
wlstatetimeout(Wlstate *s, uvlong now)
{
uint64_t d;
uvlong d;
if(!s->repeating)
return -1;
@@ -88,9 +88,9 @@ wlstatetimeout(Wlstate *s, uint64_t now)
}
int
wlstaterepeat(Wlstate *s, uint64_t now, uint32_t *key)
wlstaterepeat(Wlstate *s, uvlong now, u32int *key)
{
uint64_t step;
uvlong step;
if(!s->repeating || now < s->repeatat)
return 0;
@@ -99,8 +99,8 @@ wlstaterepeat(Wlstate *s, uint64_t now, uint32_t *key)
step = 1000 / s->rate;
if(step == 0)
step = 1;
if(UINT64_MAX - now < step)
s->repeatat = UINT64_MAX;
if(~(uvlong)0 - now < step)
s->repeatat = ~(uvlong)0;
else
s->repeatat = now + step;
return 1;