Skip to content

Machine API cleanup#6656

Merged
OBattler merged 2 commits into
86Box:masterfrom
lemondrops:patch-27
Jan 1, 2026
Merged

Machine API cleanup#6656
OBattler merged 2 commits into
86Box:masterfrom
lemondrops:patch-27

Conversation

@lemondrops

Copy link
Copy Markdown
Contributor

Summary

  • Replace machine_getname() with machine_getname_ex() and rename machine_getname_ex() into machine_getname()
  • Get rid of machine_get_machine_from_internal_name_ex(), instead change machine_get_machine_from_internal_name() to return -1 on an non-existent machine and adapt config loading code accordingly

Checklist

  • Closes #xxx
  • I have tested my changes locally and validated that the functionality works as intended
  • I have discussed this with core contributors already
  • This pull request requires changes to the ROM set
  • This pull request requires changes to the asset set

References

N/A

@OBattler OBattler merged commit a6dceab into 86Box:master Jan 1, 2026
44 checks passed
@lemondrops lemondrops deleted the patch-27 branch January 1, 2026 20:21
Comment thread src/86box.c
/* Load the ROMs for the selected machine. */
if (!machine_available(machine)) {
swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_MACHINE), machine_getname());
swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_MACHINE), machine_getname(machine));

Check failure

Code scanning / CodeQL

Non-constant format string Critical

The format string argument to swprintf has a source which cannot be verified to originate from a string literal.
The format string argument to swprintf has a source which cannot be verified to originate from a string literal.
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