Add returntype to find_next_driver/find_prev_driver

This commit is contained in:
twinaphex 2015-03-09 04:22:41 +01:00
parent eb63e78cf6
commit 23eb3fa2ad
2 changed files with 16 additions and 4 deletions

View File

@ -142,14 +142,18 @@ int find_driver_index(const char * label, const char *drv)
*
* Find previous driver in driver array.
**/
void find_prev_driver(const char *label, char *str, size_t sizeof_str)
bool find_prev_driver(const char *label, char *str, size_t sizeof_str)
{
int i = find_driver_index(label, str);
if (i > 0)
find_driver_nonempty(label, i - 1, str, sizeof_str);
else
{
RARCH_WARN(
"Couldn't find any previous driver (current one: \"%s\").\n", str);
return false;
}
return true;
}
/**
@ -160,13 +164,17 @@ void find_prev_driver(const char *label, char *str, size_t sizeof_str)
*
* Find next driver in driver array.
**/
void find_next_driver(const char *label, char *str, size_t sizeof_str)
bool find_next_driver(const char *label, char *str, size_t sizeof_str)
{
int i = find_driver_index(label, str);
if (i >= 0)
find_driver_nonempty(label, i + 1, str, sizeof_str);
else
{
RARCH_WARN("Couldn't find any next driver (current one: \"%s\").\n", str);
return false;
}
return true;
}
/**

View File

@ -329,8 +329,10 @@ void uninit_drivers(int flags);
* @sizeof_str : size of @str.
*
* Find previous driver in driver array.
*
* Returns: true (1) if successful, otherwise false (0).
**/
void find_prev_driver(const char *label, char *str, size_t sizeof_str);
bool find_prev_driver(const char *label, char *str, size_t sizeof_str);
/**
* find_next_driver:
@ -339,8 +341,10 @@ void find_prev_driver(const char *label, char *str, size_t sizeof_str);
* @sizeof_str : size of @str.
*
* Find next driver in driver array.
*
* Returns: true (1) if successful, otherwise false (0).
**/
void find_next_driver(const char *label, char *str, size_t sizeof_str);
bool find_next_driver(const char *label, char *str, size_t sizeof_str);
/**
* driver_set_nonblock_state: