diff --git a/src/servers/registrar/AppInfoList.cpp b/src/servers/registrar/AppInfoList.cpp index dadf508c04..6bb17f3288 100644 --- a/src/servers/registrar/AppInfoList.cpp +++ b/src/servers/registrar/AppInfoList.cpp @@ -186,15 +186,16 @@ AppInfoList::It() // Sort /*! \brief Sorts the infos in ascending order according to the given compare function. - \param cmpFunc The compare function to be used. + \param lessFunc The compare function (less than) to be used. */ void -AppInfoList::Sort(int (*cmpFunc)(const RosterAppInfo *, const RosterAppInfo *)) +AppInfoList::Sort( + bool (*lessFunc)(const RosterAppInfo *, const RosterAppInfo *)) { int32 count = CountInfos(); if (count > 1) { RosterAppInfo **infos = (RosterAppInfo **)fInfos.Items(); - std::sort(infos, infos + count, cmpFunc); + std::sort(infos, infos + count, lessFunc); } } diff --git a/src/servers/registrar/AppInfoList.h b/src/servers/registrar/AppInfoList.h index bf9c4ffb03..61fa5015f8 100644 --- a/src/servers/registrar/AppInfoList.h +++ b/src/servers/registrar/AppInfoList.h @@ -57,7 +57,7 @@ public: Iterator It(); - void Sort(int (*cmpFunc)(const RosterAppInfo *, const RosterAppInfo *)); + void Sort(bool (*lessFunc)(const RosterAppInfo *, const RosterAppInfo *)); private: RosterAppInfo *RemoveInfo(int32 index); diff --git a/src/servers/registrar/ShutdownProcess.cpp b/src/servers/registrar/ShutdownProcess.cpp index 645eb6664f..950acc7125 100644 --- a/src/servers/registrar/ShutdownProcess.cpp +++ b/src/servers/registrar/ShutdownProcess.cpp @@ -95,14 +95,11 @@ enum { // inverse_compare_by_registration_time static -int +bool inverse_compare_by_registration_time(const RosterAppInfo *info1, const RosterAppInfo *info2) { - bigtime_t cmp = info1->registration_time - info2->registration_time; - if (cmp < 0) - return 1; - return (cmp > 0 ? -1 : 0); + return (info2->registration_time < info1->registration_time); } // throw_error