[haiku-commits] Re: haiku: hrev47696 - src/kits/locale

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 14 Aug 2014 17:43:01 +0200

Hi Oliver,

diff --git a/src/kits/locale/LocaleRosterData.cpp 
b/src/kits/locale/LocaleRosterData.cpp
index 5511432..c6f5300 100644
--- a/src/kits/locale/LocaleRosterData.cpp
+++ b/src/kits/locale/LocaleRosterData.cpp
@@ -165,8 +165,12 @@ LocaleRosterData::Refresh()
  int
  LocaleRosterData::CompareInfos(const void* left, const void* right)
  {
-       return ((CatalogAddOnInfo*)right)->fPriority
-               - ((CatalogAddOnInfo*)left)->fPriority;
+       const CatalogAddOnInfo* leftInfo
+               = * static_cast<const CatalogAddOnInfo* const *>(left);
+       const CatalogAddOnInfo* rightInfo
+               = * static_cast<const CatalogAddOnInfo* const *>(right);
+
+       return leftInfo->fPriority - rightInfo->fPriority;
  }

I think you changed the comparision, though. Before it was right - left, now it is the other way around.

Best regards,
-Stephan



Other related posts: