Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardalee committed Dec 28, 2024
1 parent 5d9a03b commit 541fc5b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,9 @@ private static String deferredAllocationForEffectsOnInputs(ReactorInstance react
}

/**
* Set the parent pointer and reactor name. If the reactor is in a bank, the name will
* be the instance name with [index] appended.
* Set the parent pointer and reactor name. If the reactor is in a bank, the name will be the
* instance name with [index] appended.
*
* @param reactor The reactor instance.
*/
private static String deferredSetParentAndName(ReactorInstance reactor) {
Expand All @@ -1099,7 +1100,11 @@ private static String deferredSetParentAndName(ReactorInstance reactor) {
if (parent == null) {
code.pr(CUtil.reactorRef(reactor) + "->base.parent = (self_base_t*)NULL;");
} else {
code.pr(CUtil.reactorRef(reactor) + "->base.parent = (self_base_t*)" + CUtil.reactorRef(parent) + ";");
code.pr(
CUtil.reactorRef(reactor)
+ "->base.parent = (self_base_t*)"
+ CUtil.reactorRef(parent)
+ ";");
}
return code.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/c/reactor-c
4 changes: 3 additions & 1 deletion test/C/src/ReactorName.lf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ reactor A {

reactor B {
a = new A()

reaction(startup) {=
const char* name = lf_reactor_full_name(self);
lf_print("name: %s", name);
Expand All @@ -29,11 +30,12 @@ reactor B {

main reactor {
b = new B()

reaction(startup) {=
const char* name = lf_reactor_full_name(self);
lf_print("name: %s", name);
if (strcmp("ReactorName", name) != 0) {
lf_print_error_and_exit("name does not match");
}
=}
}
}

0 comments on commit 541fc5b

Please sign in to comment.