From e4243679385bcf13dff0fc6a61b90d1a1774aa97 Mon Sep 17 00:00:00 2001 From: smatz Date: Tue, 27 May 2008 00:13:51 +0000 Subject: (svn r13280) -Fix (r13276): MSVC compilation was broken --- src/bridge_gui.cpp | 6 +++--- src/group_gui.cpp | 4 ++-- src/sortlist_type.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index a2d49ae2b..a5f7a1336 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -74,19 +74,19 @@ private: GUIBridgeList *bridges; /** Sort the bridges by their index */ - static int BridgeIndexSorter(const BuildBridgeData *a, const BuildBridgeData *b) + static int CDECL BridgeIndexSorter(const BuildBridgeData *a, const BuildBridgeData *b) { return a->index - b->index; } /** Sort the bridges by their price */ - static int BridgePriceSorter(const BuildBridgeData *a, const BuildBridgeData *b) + static int CDECL BridgePriceSorter(const BuildBridgeData *a, const BuildBridgeData *b) { return a->cost - b->cost; } /** Sort the bridges by their maximum speed */ - static int BridgeSpeedSorter(const BuildBridgeData *a, const BuildBridgeData *b) + static int CDECL BridgeSpeedSorter(const BuildBridgeData *a, const BuildBridgeData *b) { return a->spec->speed - b->spec->speed; } diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 27ac42cd9..1896b2a1d 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -147,7 +147,7 @@ private: } /** Sort the groups by their name */ - static int GroupNameSorter(const Group* const *a, const Group* const *b) + static int CDECL GroupNameSorter(const Group* const *a, const Group* const *b) { static const Group *last_group[2] = { NULL, NULL }; static char last_name[2][64] = { "", "" }; @@ -295,7 +295,7 @@ public: SortVehicleList(this); this->BuildGroupList(owner); - this->groups.Sort(GroupNameSorter); + this->groups.Sort(&GroupNameSorter); SetVScrollCount(this, this->groups.Length()); SetVScroll2Count(this, this->vehicles.Length()); diff --git a/src/sortlist_type.h b/src/sortlist_type.h index 0d681eb39..7ae99dd6b 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -26,7 +26,7 @@ struct Listing { template class GUIList : public SmallVector { public: - typedef int SortFunction(const T*, const T*); + typedef int CDECL SortFunction(const T*, const T*); public: // Temporary: public for conversion only SortFunction* const *func_list; ///< The sort criteria functions @@ -189,7 +189,7 @@ public: * * @param compare The function to compare two list items * */ - FORCEINLINE void Sort(SortFunction compare) + FORCEINLINE void Sort(SortFunction *compare) { /* Do not sort if the resort bit is not set */ if (!HASBITS(this->flags, VL_RESORT)) return; @@ -204,7 +204,7 @@ public: const bool desc = HASBITS(this->flags, VL_DESC); if (HASBITS(this->flags, VL_FIRST_SORT)) { - qsort(this->data, this->items, sizeof(T), (int (*)(const void *a, const void *b))compare); + qsort(this->data, this->items, sizeof(T), (int (CDECL *)(const void *, const void *))compare); if (desc) this->Reverse(); return; -- cgit v1.2.3-54-g00ecf