Skip to content

Commit

Permalink
content_get_subsystem_friendly_name - change function signature return
Browse files Browse the repository at this point in the history
to size_t
  • Loading branch information
LibretroAdmin committed Jan 16, 2025
1 parent 0b32901 commit e982905
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion content.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ char* content_get_subsystem_rom(unsigned index);
bool content_set_subsystem_by_name(const char* subsystem_name);

/* Get the current subsystem "friendly name" */
void content_get_subsystem_friendly_name(const char* subsystem_name, char* subsystem_friendly_name, size_t len);
size_t content_get_subsystem_friendly_name(const char* subsystem_name, char *s, size_t len);

/* Sets overrides which modify frontend handling of
* specific content file types */
Expand Down
12 changes: 4 additions & 8 deletions tasks/task_content.c
Original file line number Diff line number Diff line change
Expand Up @@ -2865,26 +2865,22 @@ bool content_set_subsystem_by_name(const char* subsystem_name)
return false;
}

void content_get_subsystem_friendly_name(const char* subsystem_name, char *s, size_t len)
size_t content_get_subsystem_friendly_name(const char* subsystem_name, char *s, size_t len)
{
unsigned i = 0;
unsigned i;
runloop_state_t *runloop_st = runloop_state_get_ptr();
rarch_system_info_t *sys_info = &runloop_st->system;
/* Core not loaded completely, use the data we peeked on load core */
const struct retro_subsystem_info *subsystem = runloop_st->subsystem_data;

/* Core fully loaded, use the subsystem data */
if (sys_info->subsystem.data)
subsystem = sys_info->subsystem.data;

for (i = 0; i < runloop_st->subsystem_current_count; i++, subsystem++)
{
if (string_is_equal(subsystem_name, subsystem->ident))
{
strlcpy(s, subsystem->desc, len);
break;
}
return strlcpy(s, subsystem->desc, len);
}
return 0;
}

/* Add a rom to the subsystem ROM buffer */
Expand Down

0 comments on commit e982905

Please sign in to comment.