diff --git a/include/reactor-uc/tag.h b/include/reactor-uc/tag.h index 9557927c..d41b839c 100644 --- a/include/reactor-uc/tag.h +++ b/include/reactor-uc/tag.h @@ -99,10 +99,10 @@ tag_t lf_tag(void *env); * If the time field of the second tag is greater than 0, then the microstep of the first tag * is reset to 0 before adding. This models the delay semantics in LF and makes this * addition operation non-commutative. - * @param a The first tag. - * @param b The second tag. + * @param tag1 The first tag. + * @param tag2 The second tag. */ -tag_t lf_tag_add(tag_t a, tag_t b); +tag_t lf_tag_add(tag_t tag1, tag_t tag2); /** * Compare two tags. Return -1 if the first is less than diff --git a/src/scheduler.c b/src/scheduler.c index d8501cfe..07bedbea 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -2,9 +2,10 @@ #include "reactor-uc/reactor-uc.h" #include "reactor-uc/scheduler.h" -static void _reset_is_present_recursive(Reactor *reactor) { - // FIXME: How? -} +// static void _reset_is_present_recursive(Reactor *reactor) { +// (void)reactor; +// // FIXME: How? +// } void Scheduler_prepare_timestep(Scheduler *self) { self->reaction_queue.reset(&self->reaction_queue); @@ -12,7 +13,7 @@ void Scheduler_prepare_timestep(Scheduler *self) { // FIXME: Improve this expensive resetting of all `is_present` fields of triggers. Environment *env = self->env; - for (int i = 0; i < env->reactors_size; i++) { + for (size_t i = 0; i < env->reactors_size; i++) { } } void Scheduler_run(Scheduler *self) { diff --git a/src/tag.c b/src/tag.c index 803331f2..9a0ea9a5 100644 --- a/src/tag.c +++ b/src/tag.c @@ -23,24 +23,24 @@ tag_t lf_tag(void *env) { return ((Environment *)env)->current_tag; } -tag_t lf_tag_add(tag_t a, tag_t b) { - if (a.time == NEVER || b.time == NEVER) { +tag_t lf_tag_add(tag_t tag1, tag_t tag2) { + if (tag1.time == NEVER || tag2.time == NEVER) { return NEVER_TAG; } - if (a.time == FOREVER || b.time == FOREVER) { + if (tag1.time == FOREVER || tag2.time == FOREVER) { return FOREVER_TAG; } - if (b.time > 0) { - a.microstep = 0; // Ignore microstep of first arg if time of second is > 0. + if (tag2.time > 0) { + tag1.microstep = 0; // Ignore microstep of first arg if time of second is > 0. } - tag_t result = {.time = a.time + b.time, .microstep = a.microstep + b.microstep}; - if (result.microstep < a.microstep) { + tag_t result = {.time = tag1.time + tag2.time, .microstep = tag1.microstep + tag2.microstep}; + if (result.microstep < tag1.microstep) { return FOREVER_TAG; } - if (result.time < a.time && b.time > 0) { + if (result.time < tag1.time && tag2.time > 0) { return FOREVER_TAG; } - if (result.time > a.time && b.time < 0) { + if (result.time > tag1.time && tag2.time < 0) { return NEVER_TAG; } return result;