diff options
author | George Hazan <ghazan@miranda.im> | 2017-11-08 20:35:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-11-08 20:35:51 +0300 |
commit | 594a749318c43218a702269a4f860dbd2763a44d (patch) | |
tree | 2b1a6d92e1e3db222828ca913e37e85bc7be23d1 | |
parent | 590fca56c460dc8a2be22c5e8370f79ab8c25cd2 (diff) |
Clist_Modern: fix for 64-bits sorting
-rw-r--r-- | plugins/Clist_modern/src/modern_skinengine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index e56ec5762a..109bd8abf7 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -1835,9 +1835,10 @@ static int ske_enumdb_SkinObjectsProc(const char *szSetting, LPARAM) return 0; } -static int ske_SortTextGlyphObjectFunc(void * first, void * second) +static int ske_SortTextGlyphObjectFunc(void *first, void *second) { - return mir_strcmp(((GLYPHTEXT*)(((int*)first)[0]))->szGlyphTextID, ((GLYPHTEXT*)(((int*)second)[0]))->szGlyphTextID); + GLYPHTEXT *p1 = *(GLYPHTEXT**)first, *p2 = *(GLYPHTEXT**)second; + return mir_strcmp(p1->szGlyphTextID, p2->szGlyphTextID); } static void ske_LinkSkinObjects(SKINOBJECTSLIST * pObjectList) @@ -1866,7 +1867,7 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST * pObjectList) globj->plTextList->sortFunc = ske_SortTextGlyphObjectFunc; } List_Insert(globj->plTextList, (void*)glText, globj->plTextList->realCount); - qsort(globj->plTextList->items, globj->plTextList->realCount, sizeof(void*), (int(*)(const void*, const void*))globj->plTextList->sortFunc); + qsort(globj->plTextList->items, globj->plTextList->realCount, sizeof(GLYPHTEXT*), (int(*)(const void*, const void*))globj->plTextList->sortFunc); pObjectList->pTextList->items[i] = nullptr; } else { |