Skip to content

Commit

Permalink
Move ui_companion_driver code out of retroarch.c (libretro#13268)
Browse files Browse the repository at this point in the history
* Move ui_companion_driver code out of retroarch.c

* Buildfix

* Fix error - was reading the array out of (preinitialized) bounds

* Remove unused variable
  • Loading branch information
inactive123 authored Nov 21, 2021
1 parent 5f49899 commit 113e934
Show file tree
Hide file tree
Showing 6 changed files with 359 additions and 314 deletions.
1 change: 1 addition & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ endif
OBJ += frontend/frontend_driver.o \
retroarch.o \
driver.o \
ui/ui_companion_driver.o \
camera/camera_driver.o \
record/record_driver.o \
command.o \
Expand Down
1 change: 1 addition & 0 deletions griffin/griffin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ RETROARCH
#include "../driver.c"
#include "../midi_driver.c"
#include "../location_driver.c"
#include "../ui/ui_companion_driver.c"
#include "../libretro-common/queues/task_queue.c"

#include "../msg_hash.c"
Expand Down
4 changes: 2 additions & 2 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -9729,7 +9729,7 @@ static bool setting_append_list(
case SETTINGS_LIST_DRIVERS:
{
unsigned i, j = 0;
struct string_options_entry string_options_entries[12];
struct string_options_entry string_options_entries[12] = {0};

START_GROUP(list, list_info, &group_info, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS), parent_group);
MENU_SETTINGS_LIST_CURRENT_ADD_ENUM_IDX_PTR(list, list_info, MENU_ENUM_LABEL_DRIVER_SETTINGS);
Expand Down Expand Up @@ -9849,7 +9849,7 @@ static bool setting_append_list(
string_options_entries[j].default_value = config_get_default_midi();
string_options_entries[j].values = config_get_midi_driver_options();

for (i = 0; i < ARRAY_SIZE(string_options_entries); i++)
for (i = 0; i < j; i++)
{
CONFIG_STRING_OPTIONS(
list, list_info,
Expand Down
Loading

0 comments on commit 113e934

Please sign in to comment.