-
Notifications
You must be signed in to change notification settings - Fork 19
Draft: Minor fixes #27
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: performance_improvements
Are you sure you want to change the base?
Conversation
| filtered->PushBack(filtered, obj); | ||
| } | ||
| } | ||
|
|
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 update the format specifier in the mcx_log call to use %zu for size_t arguments. This ensures that the format specifier matches the type of the argument across all platforms.
- Change the format specifier from
%uto%zufor theposandcontainer->sizearguments in themcx_logcall on line 479. - This change should be made in the file
src/objects/ObjectContainer.c.
-
Copy modified line R479
| @@ -478,3 +478,3 @@ | ||
| if (pos >= container->size) { | ||
| mcx_log(LOG_ERROR, "ObjectContainer: SetElementName: Position %u out of bounds, max is %u", pos, container->size); | ||
| mcx_log(LOG_ERROR, "ObjectContainer: SetElementName: Position %zu out of bounds, max is %zu", pos, container->size); | ||
| return RETURN_ERROR; |
| filtered->PushBack(filtered, obj); | ||
| } | ||
| } | ||
|
|
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 update the format specifier in the mcx_log function call on line 479 to match the type of the container->size argument. Specifically, we should change %u to %lu to correctly handle the size_t type, which is typically defined as unsigned long.
- Update the format specifier in the
mcx_logfunction call on line 479 from%uto%lu. - Ensure that the change is made only in the relevant line to avoid altering existing functionality.
-
Copy modified line R479
| @@ -478,3 +478,3 @@ | ||
| if (pos >= container->size) { | ||
| mcx_log(LOG_ERROR, "ObjectContainer: SetElementName: Position %u out of bounds, max is %u", pos, container->size); | ||
| mcx_log(LOG_ERROR, "ObjectContainer: SetElementName: Position %lu out of bounds, max is %lu", pos, container->size); | ||
| return RETURN_ERROR; |
No description provided.