-
Notifications
You must be signed in to change notification settings - Fork 19
Draft: Prepare for arrays #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: catch_signals
Are you sure you want to change the base?
Conversation
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`.
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)
src/core/Databus.c
Outdated
| 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
Show autofix suggestion
Hide autofix suggestion
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
%dto%zuon line 351. - No additional methods, imports, or definitions are needed.
-
Copy modified line R351
| @@ -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; |
| 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
Show autofix suggestion
Hide autofix suggestion
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
%dto%luon line 1656. - Ensure that the argument passed to the format specifier is indeed of type
unsigned long.
-
Copy modified line R1656
| @@ -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)); | ||
| } |
| grp = comp->GetInitialOutGroup(comp, j); | ||
| } else { | ||
| grp = comp->GetOutGroup(comp, j); | ||
| } |
Check failure
Code scanning / CodeQL
Wrong type of arguments to formatting function High
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R1671
| @@ -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"); |
| grp = comp->GetInitialOutGroup(comp, j); | ||
| } else { | ||
| grp = comp->GetOutGroup(comp, j); | ||
| } |
Check failure
Code scanning / CodeQL
Wrong type of arguments to formatting function High
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R1671
| @@ -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"); |
| @@ -1499,14 +1609,14 @@ | |||
Check failure
Code scanning / CodeQL
Wrong type of arguments to formatting function High
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R1679
| @@ -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); | ||
| } |
63c6e9b to
79a57c0
Compare
No description provided.