Skip to content

Commit 119e594

Browse files
committed
Fix PollChange breaking with uint64_t
1 parent 6822ef5 commit 119e594

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

util/poll_change.hh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
// But only checks at regular periods of `update_ticks`
55
class PollChange {
66
public:
7-
PollChange(int update_ticks)
7+
PollChange(unsigned update_ticks)
88
: update_ticks{update_ticks} {
99
}
1010

1111
void reset() {
1212
change_detected = true;
1313
}
1414

15-
void poll(int now, bool state) {
15+
void poll(unsigned now, bool state) {
1616
if (now - last_update_time >= update_ticks) {
1717
last_update_time = now;
1818

@@ -25,7 +25,7 @@ public:
2525

2626
// Defer calling state_func() until poll time has expired.
2727
// Useful if checking the state is a heavy operation.
28-
void poll(int now, auto state_func) {
28+
void poll(unsigned now, auto state_func) {
2929
if (now - last_update_time >= update_ticks) {
3030
last_update_time = now;
3131

@@ -48,6 +48,6 @@ public:
4848
private:
4949
bool current_state = false;
5050
bool change_detected = false;
51-
int last_update_time = 0;
52-
int update_ticks;
51+
unsigned last_update_time = 0;
52+
unsigned update_ticks;
5353
};

0 commit comments

Comments
 (0)