Skip to content

Conversation

@klausschuch
Copy link
Contributor

No description provided.

Vaan5 and others added 30 commits March 5, 2025 10:27
Note: This changes the type in Databus `origInfos` from
`VectorChannelInfo` to `ChannelInfo`, but the uses of
`DatabusGetOutVectorChannelInfo` haven't been updated. That means that
this change breaks all components using `DatabusGetOutVectorChannelInfo`.
Vaan5 and others added 25 commits March 5, 2025 10:38
Previously, only local results were written in Initialize. This
resulted in no timing data being written at startTime (i.e. the
RTFactor results started at startTime + deltaTime).
When the step sizes are multiples of one another (sync and coupling),
it is possible to use a bigger epsilon (half of the smaller step
size) in order to push back the moment when components might fall out
of sync due to floating point operation errors.
- do not flip dimensions from the asix file (dim0-major)
@klausschuch klausschuch changed the base branch from main to catch_signals March 5, 2025 17:43
mcx_log(LOG_ERROR, "Ports: Read port infos: Could not read element specific data of port %zu", i);
return RETURN_ERROR;
}
mcx_log(LOG_ERROR, "Ports: Read port infos: Could not read element specific data of port %d", i);

Check failure

Code scanning / CodeQL

Wrong type of arguments to formatting function High

This format specifier for type 'int' does not match the argument type 'unsigned long'.

Copilot Autofix

AI 10 months ago

To fix the problem, we need to ensure that the format specifier matches the type of the variable i. Since i is of type size_t, the correct format specifier to use is %zu. This change will ensure that the printf function correctly interprets the bits of i as an unsigned long.

  • Change the format specifier from %d to %zu on line 351.
  • No additional methods, imports, or definitions are needed.
Suggested changeset 1
src/core/Databus.c

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/core/Databus.c b/src/core/Databus.c
--- a/src/core/Databus.c
+++ b/src/core/Databus.c
@@ -350,3 +350,3 @@
             if (RETURN_ERROR == retVal) {
-                mcx_log(LOG_ERROR, "Ports: Read port infos: Could not read element specific data of port %d", i);
+                mcx_log(LOG_ERROR, "Ports: Read port infos: Could not read element specific data of port %zu", i);
                 goto cleanup;
EOF
@@ -350,3 +350,3 @@
if (RETURN_ERROR == retVal) {
mcx_log(LOG_ERROR, "Ports: Read port infos: Could not read element specific data of port %d", i);
mcx_log(LOG_ERROR, "Ports: Read port infos: Could not read element specific data of port %zu", i);
goto cleanup;
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
mcx_os_fprintf(dotFile, " <table %s>\n", tableArgs);
for (j = 0; j < GetDependencyNumIn(A); j++) {
mcx_os_fprintf(dotFile, " <tr>\n");
mcx_os_fprintf(dotFile, " <td port=\"in%zu\">%zu</td>\n", j, j);

Check failure

Code scanning / CodeQL

Wrong type of arguments to formatting function High

This format specifier for type 'int' does not match the argument type 'unsigned long'.

Copilot Autofix

AI 10 months ago

To fix the problem, we need to ensure that the format specifier matches the type of the argument. Since c->GetID(c) returns an unsigned long, we should use the format specifier %lu which is intended for unsigned long types.

  • Change the format specifier from %d to %lu on line 1656.
  • Ensure that the argument passed to the format specifier is indeed of type unsigned long.
Suggested changeset 1
src/core/Model.c

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/core/Model.c b/src/core/Model.c
--- a/src/core/Model.c
+++ b/src/core/Model.c
@@ -1655,3 +1655,3 @@
         mcx_os_fprintf(dotFile, "  </tr>\n");
-        mcx_os_fprintf(dotFile, "</table>>] comp%d;\n", c->GetID(c));
+        mcx_os_fprintf(dotFile, "</table>>] comp%lu;\n", c->GetID(c));
     }
EOF
@@ -1655,3 +1655,3 @@
mcx_os_fprintf(dotFile, " </tr>\n");
mcx_os_fprintf(dotFile, "</table>>] comp%d;\n", c->GetID(c));
mcx_os_fprintf(dotFile, "</table>>] comp%lu;\n", c->GetID(c));
}
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
grp = comp->GetInitialOutGroup(comp, j);
} else {
grp = comp->GetOutGroup(comp, j);
}

Check failure

Code scanning / CodeQL

Wrong type of arguments to formatting function High

This format specifier for type 'int' does not match the argument type 'unsigned long'.

Copilot Autofix

AI 10 months ago

To fix the problem, we need to ensure that the format specifier matches the type of the argument. Since j is of type unsigned long, we should use the %lu format specifier instead of %d. This change will ensure that the printf function correctly interprets the argument type, preventing undefined behavior.

Suggested changeset 1
src/core/Model.c

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/core/Model.c b/src/core/Model.c
--- a/src/core/Model.c
+++ b/src/core/Model.c
@@ -1670,3 +1670,3 @@
         mcx_os_fprintf(dotFile, "        <tr>\n");
-        mcx_os_fprintf(dotFile, "          <td port=\"in%d\">%d</td>\n", j, j);
+        mcx_os_fprintf(dotFile, "          <td port=\"in%lu\">%lu</td>\n", j, j);
         mcx_os_fprintf(dotFile, "        </tr>\n");
EOF
@@ -1670,3 +1670,3 @@
mcx_os_fprintf(dotFile, " <tr>\n");
mcx_os_fprintf(dotFile, " <td port=\"in%d\">%d</td>\n", j, j);
mcx_os_fprintf(dotFile, " <td port=\"in%lu\">%lu</td>\n", j, j);
mcx_os_fprintf(dotFile, " </tr>\n");
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
grp = comp->GetInitialOutGroup(comp, j);
} else {
grp = comp->GetOutGroup(comp, j);
}

Check failure

Code scanning / CodeQL

Wrong type of arguments to formatting function High

This format specifier for type 'int' does not match the argument type 'unsigned long'.

Copilot Autofix

AI 10 months ago

To fix the problem, we need to ensure that the format specifier matches the type of the argument being passed. In this case, the variable j is of type unsigned long, so we should use the %lu format specifier instead of %d. This change will ensure that the mcx_os_fprintf function correctly interprets the argument type and produces the expected output.

Suggested changeset 1
src/core/Model.c

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/core/Model.c b/src/core/Model.c
--- a/src/core/Model.c
+++ b/src/core/Model.c
@@ -1670,3 +1670,3 @@
         mcx_os_fprintf(dotFile, "        <tr>\n");
-        mcx_os_fprintf(dotFile, "          <td port=\"in%d\">%d</td>\n", j, j);
+        mcx_os_fprintf(dotFile, "          <td port=\"in%lu\">%lu</td>\n", j, j);
         mcx_os_fprintf(dotFile, "        </tr>\n");
EOF
@@ -1670,3 +1670,3 @@
mcx_os_fprintf(dotFile, " <tr>\n");
mcx_os_fprintf(dotFile, " <td port=\"in%d\">%d</td>\n", j, j);
mcx_os_fprintf(dotFile, " <td port=\"in%lu\">%lu</td>\n", j, j);
mcx_os_fprintf(dotFile, " </tr>\n");
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@@ -1499,14 +1609,14 @@

Check failure

Code scanning / CodeQL

Wrong type of arguments to formatting function High

This format specifier for type 'int' does not match the argument type 'unsigned long'.

Copilot Autofix

AI 10 months ago

To fix the problem, we need to ensure that the format specifier matches the type of the argument being passed. In this case, the argument comps->Size(comps) + 1 is of type unsigned long, so we should use the %lu format specifier instead of %d. This change will ensure that the value is correctly interpreted and printed.

Suggested changeset 1
src/core/Model.c

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/core/Model.c b/src/core/Model.c
--- a/src/core/Model.c
+++ b/src/core/Model.c
@@ -1678,3 +1678,3 @@
         mcx_os_fprintf(dotFile, "  </tr>\n");
-        mcx_os_fprintf(dotFile, "</table>>] comp%d;\n", comps->Size(comps) + 1);
+        mcx_os_fprintf(dotFile, "</table>>] comp%lu;\n", comps->Size(comps) + 1);
     }
EOF
@@ -1678,3 +1678,3 @@
mcx_os_fprintf(dotFile, " </tr>\n");
mcx_os_fprintf(dotFile, "</table>>] comp%d;\n", comps->Size(comps) + 1);
mcx_os_fprintf(dotFile, "</table>>] comp%lu;\n", comps->Size(comps) + 1);
}
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants