Merge branch 'master' into jgrpp

# Conflicts:
#	src/core/alloc_type.hpp
#	src/group_gui.cpp
#	src/newgrf.cpp
#	src/saveload/economy_sl.cpp
#	src/saveload/map_sl.cpp
#	src/station_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2019-04-16 18:03:08 +01:00
57 changed files with 524 additions and 635 deletions

View File

@@ -157,10 +157,10 @@ void WindowDesc::LoadFromConfig()
/**
* Sort WindowDesc by ini_key.
*/
static int CDECL DescSorter(WindowDesc * const *a, WindowDesc * const *b)
static bool DescSorter(WindowDesc* const &a, WindowDesc* const &b)
{
if ((*a)->ini_key != nullptr && (*b)->ini_key != nullptr) return strcmp((*a)->ini_key, (*b)->ini_key);
return ((*b)->ini_key != nullptr ? 1 : 0) - ((*a)->ini_key != nullptr ? 1 : 0);
if (a->ini_key != nullptr && b->ini_key != nullptr) return strcmp(a->ini_key, b->ini_key) < 0;
return a->ini_key != nullptr;
}
/**
@@ -169,7 +169,7 @@ static int CDECL DescSorter(WindowDesc * const *a, WindowDesc * const *b)
void WindowDesc::SaveToConfig()
{
/* Sort the stuff to get a nice ini file on first write */
QSortT(_window_descs->data(), _window_descs->size(), DescSorter);
std::sort(_window_descs->begin(), _window_descs->end(), DescSorter);
IniFile *ini = new IniFile();
ini->LoadFromDisk(_windows_file, NO_DIRECTORY);