Skip to content

Commit

Permalink
Merge branch 'master' into reactor-ts-npm
Browse files Browse the repository at this point in the history
  • Loading branch information
petervdonovan committed Aug 26, 2022
2 parents 9be1ad9 + 3d91524 commit f2f04d6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion org.lflang/src/lib/py/reactor-c-py
1 change: 1 addition & 0 deletions org.lflang/src/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2678,6 +2678,7 @@ private void generateSelfStructs(ReactorInstance r) {
// create references to the runtime instances aware of this exception.
// For now, we just create a larger array than needed.
initializeTriggerObjects.pr(CUtil.selfType(r)+"* "+CUtil.reactorRefName(r)+"["+r.getTotalWidth()+"];");
initializeTriggerObjects.pr("SUPPRESS_UNUSED_WARNING("+CUtil.reactorRefName(r)+");");
for (ReactorInstance child : r.children) {
generateSelfStructs(child);
}
Expand Down
4 changes: 2 additions & 2 deletions org.lflang/src/org/lflang/generator/c/CMainGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public String generateCode() {
*/
private String generateMainFunction() {
return String.join("\n",
"int main(int argc, char* argv[]) {",
"int main(int argc, const char* argv[]) {",
" return lf_reactor_c_main(argc, argv);",
"}"
);
Expand All @@ -53,7 +53,7 @@ private String generateSetDefaultCliOption() {
// so start with that.
return runCommand.size() > 0 ?
String.join("\n",
"char* _lf_default_argv[] = { " +
"const char* _lf_default_argv[] = { " +
StringUtil.addDoubleQuotes(
StringUtil.joinObjects(runCommand,
StringUtil.addDoubleQuotes(", ")))+" };",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ class TSConstructorGenerator (
val federateConfigurations = LinkedList<String>()
if (reactor.isFederated) {
for ((key, _) in federate.dependsOn) {
// FIXME: Get delay properly considering the unit instead of hardcoded BigInt(0).
federateConfigurations.add("this.addUpstreamFederate(${key.id}, BigInt(0));")
// FIXME: Get delay properly considering the unit instead of hardcoded TimeValue.NEVER().
federateConfigurations.add("this.addUpstreamFederate(${key.id}, TimeValue.NEVER());")
}
for ((key, _) in federate.sendsTo) {
federateConfigurations.add("this.addDownstreamFederate(${key.id});")
Expand Down

0 comments on commit f2f04d6

Please sign in to comment.