mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Change index variable to idx
This commit is contained in:
parent
4378ccefcb
commit
7518eb27e6
46
file_list.c
46
file_list.c
@ -123,34 +123,34 @@ void file_list_copy(file_list_t *list, file_list_t *list_old)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_list_set_label_at_offset(file_list_t *list, size_t index,
|
void file_list_set_label_at_offset(file_list_t *list, size_t idx,
|
||||||
const char *label)
|
const char *label)
|
||||||
{
|
{
|
||||||
free(list->list[index].label);
|
free(list->list[idx].label);
|
||||||
list->list[index].label = strdup(label);
|
list->list[idx].label = strdup(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_list_get_label_at_offset(const file_list_t *list, size_t index,
|
void file_list_get_label_at_offset(const file_list_t *list, size_t idx,
|
||||||
const char **label)
|
const char **label)
|
||||||
{
|
{
|
||||||
if (label)
|
if (label)
|
||||||
*label = list->list[index].label ?
|
*label = list->list[idx].label ?
|
||||||
list->list[index].label : list->list[index].path;
|
list->list[idx].label : list->list[idx].path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_list_set_alt_at_offset(file_list_t *list, size_t index,
|
void file_list_set_alt_at_offset(file_list_t *list, size_t idx,
|
||||||
const char *alt)
|
const char *alt)
|
||||||
{
|
{
|
||||||
free(list->list[index].alt);
|
free(list->list[idx].alt);
|
||||||
list->list[index].alt = strdup(alt);
|
list->list[idx].alt = strdup(alt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_list_get_alt_at_offset(const file_list_t *list, size_t index,
|
void file_list_get_alt_at_offset(const file_list_t *list, size_t idx,
|
||||||
const char **alt)
|
const char **alt)
|
||||||
{
|
{
|
||||||
if (alt)
|
if (alt)
|
||||||
*alt = list->list[index].alt ?
|
*alt = list->list[idx].alt ?
|
||||||
list->list[index].alt : list->list[index].path;
|
list->list[idx].alt : list->list[idx].path;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_list_alt_cmp(const void *a_, const void *b_)
|
static int file_list_alt_cmp(const void *a_, const void *b_)
|
||||||
@ -167,15 +167,15 @@ void file_list_sort_on_alt(file_list_t *list)
|
|||||||
qsort(list->list, list->size, sizeof(list->list[0]), file_list_alt_cmp);
|
qsort(list->list, list->size, sizeof(list->list[0]), file_list_alt_cmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *file_list_get_userdata_at_offset(const file_list_t *list, size_t index)
|
void *file_list_get_userdata_at_offset(const file_list_t *list, size_t idx)
|
||||||
{
|
{
|
||||||
return list->list[index].userdata;
|
return list->list[idx].userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *file_list_get_actiondata_at_offset(const file_list_t *list, size_t index)
|
void *file_list_get_actiondata_at_offset(const file_list_t *list, size_t idx)
|
||||||
{
|
{
|
||||||
if (list)
|
if (list)
|
||||||
return list->list[index].actiondata;
|
return list->list[idx].actiondata;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,15 +186,15 @@ void *file_list_get_last_actiondata(const file_list_t *list)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_list_get_at_offset(const file_list_t *list, size_t index,
|
void file_list_get_at_offset(const file_list_t *list, size_t idx,
|
||||||
const char **path, const char **label, unsigned *file_type)
|
const char **path, const char **label, unsigned *file_type)
|
||||||
{
|
{
|
||||||
if (path)
|
if (path)
|
||||||
*path = list->list[index].path;
|
*path = list->list[idx].path;
|
||||||
if (label)
|
if (label)
|
||||||
*label = list->list[index].label;
|
*label = list->list[idx].label;
|
||||||
if (file_type)
|
if (file_type)
|
||||||
*file_type = list->list[index].type;
|
*file_type = list->list[idx].type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void file_list_get_last(const file_list_t *list,
|
void file_list_get_last(const file_list_t *list,
|
||||||
@ -205,7 +205,7 @@ void file_list_get_last(const file_list_t *list,
|
|||||||
file_list_get_at_offset(list, list->size - 1, path, label, file_type);
|
file_list_get_at_offset(list, list->size - 1, path, label, file_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool file_list_search(const file_list_t *list, const char *needle, size_t *index)
|
bool file_list_search(const file_list_t *list, const char *needle, size_t *idx)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
const char *alt;
|
const char *alt;
|
||||||
@ -226,7 +226,7 @@ bool file_list_search(const file_list_t *list, const char *needle, size_t *index
|
|||||||
if (str == alt)
|
if (str == alt)
|
||||||
{
|
{
|
||||||
/* Found match with first chars, best possible match. */
|
/* Found match with first chars, best possible match. */
|
||||||
*index = i;
|
*idx = i;
|
||||||
ret = true;
|
ret = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ bool file_list_search(const file_list_t *list, const char *needle, size_t *index
|
|||||||
{
|
{
|
||||||
/* Found mid-string match, but try to find a match with
|
/* Found mid-string match, but try to find a match with
|
||||||
* first characters before we settle. */
|
* first characters before we settle. */
|
||||||
*index = i;
|
*idx = i;
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user