mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
vere: rename behn.c's alm -> alm_o
To adhere to the naming conventions.
This commit is contained in:
parent
afd1808745
commit
e7ab3c037d
@ -16,7 +16,7 @@
|
|||||||
typedef struct _u3_behn {
|
typedef struct _u3_behn {
|
||||||
u3_auto car_u; // driver
|
u3_auto car_u; // driver
|
||||||
uv_timer_t tim_u; // behn timer
|
uv_timer_t tim_u; // behn timer
|
||||||
c3_o alm; // alarm
|
c3_o alm_o; // alarm
|
||||||
} u3_behn;
|
} u3_behn;
|
||||||
|
|
||||||
static void _behn_scry_cb(void* vod_p, u3_noun nun);
|
static void _behn_scry_cb(void* vod_p, u3_noun nun);
|
||||||
@ -27,7 +27,7 @@ static void
|
|||||||
_behn_time_cb(uv_timer_t* tim_u)
|
_behn_time_cb(uv_timer_t* tim_u)
|
||||||
{
|
{
|
||||||
u3_behn* teh_u = tim_u->data;
|
u3_behn* teh_u = tim_u->data;
|
||||||
teh_u->alm = c3n;
|
teh_u->alm_o = c3n;
|
||||||
|
|
||||||
// take initiative to start the next timer, just in case
|
// take initiative to start the next timer, just in case
|
||||||
//
|
//
|
||||||
@ -62,9 +62,9 @@ _behn_ef_doze(u3_behn* teh_u, u3_noun wen)
|
|||||||
teh_u->car_u.liv_o = c3y;
|
teh_u->car_u.liv_o = c3y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( c3y == teh_u->alm ) {
|
if ( c3y == teh_u->alm_o ) {
|
||||||
uv_timer_stop(&teh_u->tim_u);
|
uv_timer_stop(&teh_u->tim_u);
|
||||||
teh_u->alm = c3n;
|
teh_u->alm_o = c3n;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (c3y == u3du(wen)) &&
|
if ( (c3y == u3du(wen)) &&
|
||||||
@ -76,7 +76,7 @@ _behn_ef_doze(u3_behn* teh_u, u3_noun wen)
|
|||||||
u3_noun now = u3_time_in_tv(&tim_tv);
|
u3_noun now = u3_time_in_tv(&tim_tv);
|
||||||
c3_d gap_d = u3_time_gap_ms(now, u3k(u3t(wen)));
|
c3_d gap_d = u3_time_gap_ms(now, u3k(u3t(wen)));
|
||||||
|
|
||||||
teh_u->alm = c3y;
|
teh_u->alm_o = c3y;
|
||||||
uv_timer_start(&teh_u->tim_u, _behn_time_cb, gap_d, 0);
|
uv_timer_start(&teh_u->tim_u, _behn_time_cb, gap_d, 0);
|
||||||
} else if (u3_nul != wen) {
|
} else if (u3_nul != wen) {
|
||||||
u3m_p("behn: invalid doze", wen);
|
u3m_p("behn: invalid doze", wen);
|
||||||
@ -93,14 +93,14 @@ _behn_scry_cb(void* vod_p, u3_noun nun)
|
|||||||
u3_behn* teh_u = vod_p;
|
u3_behn* teh_u = vod_p;
|
||||||
u3_weak tim = u3r_at(7, nun);
|
u3_weak tim = u3r_at(7, nun);
|
||||||
|
|
||||||
if (c3y == teh_u->alm) {
|
if (c3y == teh_u->alm_o) {
|
||||||
// timer already set while we were scrying, no-op
|
// timer already set while we were scrying, no-op
|
||||||
}
|
}
|
||||||
else if (u3_none == tim) {
|
else if (u3_none == tim) {
|
||||||
// fall back to a timer for 10 minutes
|
// fall back to a timer for 10 minutes
|
||||||
//
|
//
|
||||||
c3_d gap_d = 10 * 60 * 1000;
|
c3_d gap_d = 10 * 60 * 1000;
|
||||||
teh_u->alm = c3y;
|
teh_u->alm_o = c3y;
|
||||||
uv_timer_start(&teh_u->tim_u, _behn_time_cb, gap_d, 0);
|
uv_timer_start(&teh_u->tim_u, _behn_time_cb, gap_d, 0);
|
||||||
} else {
|
} else {
|
||||||
_behn_ef_doze(teh_u, u3k(tim));
|
_behn_ef_doze(teh_u, u3k(tim));
|
||||||
@ -170,7 +170,7 @@ u3_auto*
|
|||||||
u3_behn_io_init(u3_pier* pir_u)
|
u3_behn_io_init(u3_pier* pir_u)
|
||||||
{
|
{
|
||||||
u3_behn* teh_u = c3_calloc(sizeof(*teh_u));
|
u3_behn* teh_u = c3_calloc(sizeof(*teh_u));
|
||||||
teh_u->alm = c3n;
|
teh_u->alm_o = c3n;
|
||||||
|
|
||||||
uv_timer_init(u3L, &teh_u->tim_u);
|
uv_timer_init(u3L, &teh_u->tim_u);
|
||||||
teh_u->tim_u.data = teh_u;
|
teh_u->tim_u.data = teh_u;
|
||||||
|
Loading…
Reference in New Issue
Block a user