mirror of https://github.com/OpenRCT2/OpenRCT2.git
Resolved warnings, and removed duplicated function.
This commit is contained in:
parent
666da74beb
commit
90e67772e0
|
@ -1050,7 +1050,7 @@ void save_game()
|
|||
}
|
||||
void save_game_as()
|
||||
{
|
||||
window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME, path_get_filename(gScenarioSavePath));
|
||||
window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME, (char*)path_get_filename(gScenarioSavePath));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ const char *path_get_filename(const utf8 *path)
|
|||
const char *path_get_extension(const utf8 *path)
|
||||
{
|
||||
// Get the filename from the path
|
||||
char *filename = path_get_filename(path);
|
||||
const char *filename = path_get_filename(path);
|
||||
|
||||
// Try to find the most-right dot in the filename
|
||||
char *extension = strrchr(filename, '.');
|
||||
|
|
|
@ -573,15 +573,6 @@ static void window_loadsave_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, i
|
|||
}
|
||||
}
|
||||
|
||||
static int compare_string_case_insensitive(char const *a, char const *b)
|
||||
{
|
||||
for (;; a++, b++) {
|
||||
int d = tolower(*a) - tolower(*b);
|
||||
if (d != 0 || !*a)
|
||||
return d;
|
||||
}
|
||||
}
|
||||
|
||||
static int list_item_sort(const void *a, const void *b)
|
||||
{
|
||||
const loadsave_list_item *itemA = (loadsave_list_item*)a;
|
||||
|
@ -592,15 +583,15 @@ static int list_item_sort(const void *a, const void *b)
|
|||
|
||||
switch (gConfigGeneral.load_save_sort){
|
||||
case SORT_NAME_ASCENDING:
|
||||
return compare_string_case_insensitive(itemA->name, itemB->name);
|
||||
return strcicmp(itemA->name, itemB->name);
|
||||
case SORT_NAME_DESCENDING:
|
||||
return -compare_string_case_insensitive(itemA->name, itemB->name);
|
||||
return -strcicmp(itemA->name, itemB->name);
|
||||
case SORT_DATE_DESCENDING:
|
||||
return (int) -difftime(itemA->date_modified, itemB->date_modified);
|
||||
case SORT_DATE_ASCENDING:
|
||||
return (int) difftime(itemA->date_modified, itemB->date_modified);
|
||||
default:
|
||||
return compare_string_case_insensitive(itemA->name, itemB->name);
|
||||
return strcicmp(itemA->name, itemB->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue