No longer use CDECL for GUIList::FilterFunction
This commit is contained in:
@@ -724,7 +724,7 @@ const StringID _engine_sort_listing[][14] = {{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
/** Filters vehicles by cargo and engine (in case of rail vehicle). */
|
/** Filters vehicles by cargo and engine (in case of rail vehicle). */
|
||||||
static bool CDECL CargoAndEngineFilter(const EngineID *eid, const CargoID cid)
|
static bool CargoAndEngineFilter(const EngineID *eid, const CargoID cid)
|
||||||
{
|
{
|
||||||
if (cid == CF_ANY) {
|
if (cid == CF_ANY) {
|
||||||
return true;
|
return true;
|
||||||
|
@@ -1281,7 +1281,7 @@ enum CargoFilterSpecialType {
|
|||||||
* @param cargoes The accepted and produced cargo pair to look for.
|
* @param cargoes The accepted and produced cargo pair to look for.
|
||||||
* @return bool Whether the given cargoes accepted and produced by the industry.
|
* @return bool Whether the given cargoes accepted and produced by the industry.
|
||||||
*/
|
*/
|
||||||
static bool CDECL CargoFilter(const Industry * const *industry, const std::pair<CargoID, CargoID> &cargoes)
|
static bool CargoFilter(const Industry * const *industry, const std::pair<CargoID, CargoID> &cargoes)
|
||||||
{
|
{
|
||||||
auto accepted_cargo = cargoes.first;
|
auto accepted_cargo = cargoes.first;
|
||||||
auto produced_cargo = cargoes.second;
|
auto produced_cargo = cargoes.second;
|
||||||
|
@@ -438,7 +438,7 @@ class NetworkContentListWindow : public Window, ContentCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Filter content by tags/name */
|
/** Filter content by tags/name */
|
||||||
static bool CDECL TagNameFilter(const ContentInfo * const *a, ContentListFilterData &filter)
|
static bool TagNameFilter(const ContentInfo * const *a, ContentListFilterData &filter)
|
||||||
{
|
{
|
||||||
filter.string_filter.ResetState();
|
filter.string_filter.ResetState();
|
||||||
for (auto &tag : (*a)->tags) filter.string_filter.AddLine(tag.c_str());
|
for (auto &tag : (*a)->tags) filter.string_filter.AddLine(tag.c_str());
|
||||||
@@ -448,7 +448,7 @@ class NetworkContentListWindow : public Window, ContentCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Filter content by type, but still show content selected for download. */
|
/** Filter content by type, but still show content selected for download. */
|
||||||
static bool CDECL TypeOrSelectedFilter(const ContentInfo * const *a, ContentListFilterData &filter)
|
static bool TypeOrSelectedFilter(const ContentInfo * const *a, ContentListFilterData &filter)
|
||||||
{
|
{
|
||||||
if (filter.types.none()) return true;
|
if (filter.types.none()) return true;
|
||||||
if (filter.types[(*a)->type]) return true;
|
if (filter.types[(*a)->type]) return true;
|
||||||
|
@@ -389,7 +389,7 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CDECL NGameSearchFilter(NetworkGameList * const *item, StringFilter &sf)
|
static bool NGameSearchFilter(NetworkGameList * const *item, StringFilter &sf)
|
||||||
{
|
{
|
||||||
assert(item != nullptr);
|
assert(item != nullptr);
|
||||||
assert((*item) != nullptr);
|
assert((*item) != nullptr);
|
||||||
|
@@ -1440,7 +1440,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Filter grfs by tags/name */
|
/** Filter grfs by tags/name */
|
||||||
static bool CDECL TagNameFilter(const GRFConfig * const *a, StringFilter &filter)
|
static bool TagNameFilter(const GRFConfig * const *a, StringFilter &filter)
|
||||||
{
|
{
|
||||||
filter.ResetState();
|
filter.ResetState();
|
||||||
filter.AddLine((*a)->GetName());
|
filter.AddLine((*a)->GetName());
|
||||||
|
@@ -135,7 +135,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Filter object classes by class name. */
|
/** Filter object classes by class name. */
|
||||||
static bool CDECL TagNameFilter(ObjectClassID const *oc, StringFilter &filter)
|
static bool TagNameFilter(ObjectClassID const *oc, StringFilter &filter)
|
||||||
{
|
{
|
||||||
ObjectClass *objclass = ObjectClass::Get(*oc);
|
ObjectClass *objclass = ObjectClass::Get(*oc);
|
||||||
char buffer[DRAW_STRING_BUFFER];
|
char buffer[DRAW_STRING_BUFFER];
|
||||||
|
@@ -1185,7 +1185,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Filter station classes by class name. */
|
/** Filter station classes by class name. */
|
||||||
static bool CDECL TagNameFilter(StationClassID const * sc, StringFilter &filter)
|
static bool TagNameFilter(StationClassID const * sc, StringFilter &filter)
|
||||||
{
|
{
|
||||||
char buffer[DRAW_STRING_BUFFER];
|
char buffer[DRAW_STRING_BUFFER];
|
||||||
GetString(buffer, StationClass::Get(*sc)->name, lastof(buffer));
|
GetString(buffer, StationClass::Get(*sc)->name, lastof(buffer));
|
||||||
|
@@ -1341,7 +1341,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Filter classes by class name. */
|
/** Filter classes by class name. */
|
||||||
static bool CDECL TagNameFilter(RoadStopClassID const *sc, StringFilter &filter)
|
static bool TagNameFilter(RoadStopClassID const *sc, StringFilter &filter)
|
||||||
{
|
{
|
||||||
char buffer[DRAW_STRING_BUFFER];
|
char buffer[DRAW_STRING_BUFFER];
|
||||||
GetString(buffer, RoadStopClass::Get(*sc)->name, lastof(buffer));
|
GetString(buffer, RoadStopClass::Get(*sc)->name, lastof(buffer));
|
||||||
|
@@ -90,7 +90,7 @@ struct SignList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Filter sign list by sign name */
|
/** Filter sign list by sign name */
|
||||||
static bool CDECL SignNameFilter(const Sign * const *a, StringFilter &filter)
|
static bool SignNameFilter(const Sign * const *a, StringFilter &filter)
|
||||||
{
|
{
|
||||||
/* Same performance benefit as above for sorting. */
|
/* Same performance benefit as above for sorting. */
|
||||||
const char *a_name = (*a)->name.empty() ? SignList::default_name : (*a)->name.c_str();
|
const char *a_name = (*a)->name.empty() ? SignList::default_name : (*a)->name.c_str();
|
||||||
@@ -101,14 +101,14 @@ struct SignList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Filter sign list excluding OWNER_DEITY */
|
/** Filter sign list excluding OWNER_DEITY */
|
||||||
static bool CDECL OwnerDeityFilter(const Sign * const *a, StringFilter &filter)
|
static bool OwnerDeityFilter(const Sign * const *a, StringFilter &filter)
|
||||||
{
|
{
|
||||||
/* You should never be able to edit signs of owner DEITY */
|
/* You should never be able to edit signs of owner DEITY */
|
||||||
return (*a)->owner != OWNER_DEITY;
|
return (*a)->owner != OWNER_DEITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Filter sign list by owner */
|
/** Filter sign list by owner */
|
||||||
static bool CDECL OwnerVisibilityFilter(const Sign * const *a, StringFilter &filter)
|
static bool OwnerVisibilityFilter(const Sign * const *a, StringFilter &filter)
|
||||||
{
|
{
|
||||||
assert(!HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS));
|
assert(!HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS));
|
||||||
/* Hide sign if non-own signs are hidden in the viewport */
|
/* Hide sign if non-own signs are hidden in the viewport */
|
||||||
|
@@ -46,7 +46,7 @@ template <typename T, typename F = const char*>
|
|||||||
class GUIList : public std::vector<T> {
|
class GUIList : public std::vector<T> {
|
||||||
public:
|
public:
|
||||||
typedef bool SortFunction(const T&, const T&); ///< Signature of sort function.
|
typedef bool SortFunction(const T&, const T&); ///< Signature of sort function.
|
||||||
typedef bool CDECL FilterFunction(const T*, F); ///< Signature of filter function.
|
typedef bool FilterFunction(const T*, F); ///< Signature of filter function.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SortFunction * const *sort_func_list; ///< the sort criteria functions
|
SortFunction * const *sort_func_list; ///< the sort criteria functions
|
||||||
|
@@ -275,7 +275,7 @@ void BaseVehicleListWindow::BuildVehicleList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Cargo filter functions */
|
/** Cargo filter functions */
|
||||||
static bool CDECL CargoFilter(const Vehicle * const *vid, const CargoID cid)
|
static bool CargoFilter(const Vehicle * const *vid, const CargoID cid)
|
||||||
{
|
{
|
||||||
if (cid == BaseVehicleListWindow::CF_ANY) {
|
if (cid == BaseVehicleListWindow::CF_ANY) {
|
||||||
return true;
|
return true;
|
||||||
@@ -308,7 +308,7 @@ static bool CDECL CargoFilter(const Vehicle * const *vid, const CargoID cid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CDECL GroupCargoFilter(const GUIVehicleGroup* group, const CargoID cid)
|
static bool GroupCargoFilter(const GUIVehicleGroup* group, const CargoID cid)
|
||||||
{
|
{
|
||||||
if (cid == BaseVehicleListWindow::CF_ANY) return true;
|
if (cid == BaseVehicleListWindow::CF_ANY) return true;
|
||||||
for (VehicleList::const_iterator v = group->vehicles_begin; v != group->vehicles_end; ++v) {
|
for (VehicleList::const_iterator v = group->vehicles_begin; v != group->vehicles_end; ++v) {
|
||||||
|
Reference in New Issue
Block a user