diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/UI/FileManager/PanelSort.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/CPP/7zip/UI/FileManager/PanelSort.cpp b/CPP/7zip/UI/FileManager/PanelSort.cpp index d26acb7..f95f8ee 100644 --- a/CPP/7zip/UI/FileManager/PanelSort.cpp +++ b/CPP/7zip/UI/FileManager/PanelSort.cpp | |||
@@ -52,8 +52,8 @@ int CompareFileNames_ForFolderList(const wchar_t *s1, const wchar_t *s2) | |||
52 | 52 | ||
53 | static int CompareFileNames_Le16(const Byte *s1, unsigned size1, const Byte *s2, unsigned size2) | 53 | static int CompareFileNames_Le16(const Byte *s1, unsigned size1, const Byte *s2, unsigned size2) |
54 | { | 54 | { |
55 | size1 &= ~1; | 55 | size1 &= ~1u; |
56 | size2 &= ~1; | 56 | size2 &= ~1u; |
57 | for (unsigned i = 0;; i += 2) | 57 | for (unsigned i = 0;; i += 2) |
58 | { | 58 | { |
59 | if (i >= size1) | 59 | if (i >= size1) |
@@ -76,8 +76,8 @@ static int CompareFileNames_Le16(const Byte *s1, unsigned size1, const Byte *s2, | |||
76 | 76 | ||
77 | static inline const wchar_t *GetExtensionPtr(const UString &name) | 77 | static inline const wchar_t *GetExtensionPtr(const UString &name) |
78 | { | 78 | { |
79 | int dotPos = name.ReverseFind_Dot(); | 79 | const int dotPos = name.ReverseFind_Dot(); |
80 | return name.Ptr((dotPos < 0) ? name.Len() : dotPos); | 80 | return name.Ptr(dotPos < 0 ? name.Len() : (unsigned)dotPos); |
81 | } | 81 | } |
82 | 82 | ||
83 | void CPanel::SetSortRawStatus() | 83 | void CPanel::SetSortRawStatus() |
@@ -142,9 +142,9 @@ static int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) | |||
142 | // if (panel->_sortIndex == 0) | 142 | // if (panel->_sortIndex == 0) |
143 | case kpidName: | 143 | case kpidName: |
144 | { | 144 | { |
145 | const UString name1 = panel->GetItemName((int)lParam1); | 145 | const UString name1 = panel->GetItemName((unsigned)lParam1); |
146 | const UString name2 = panel->GetItemName((int)lParam2); | 146 | const UString name2 = panel->GetItemName((unsigned)lParam2); |
147 | int res = CompareFileNames_ForFolderList(name1, name2); | 147 | const int res = CompareFileNames_ForFolderList(name1, name2); |
148 | /* | 148 | /* |
149 | if (res != 0 || !panel->_flatMode) | 149 | if (res != 0 || !panel->_flatMode) |
150 | return res; | 150 | return res; |
@@ -156,8 +156,8 @@ static int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) | |||
156 | } | 156 | } |
157 | case kpidExtension: | 157 | case kpidExtension: |
158 | { | 158 | { |
159 | const UString name1 = panel->GetItemName((int)lParam1); | 159 | const UString name1 = panel->GetItemName((unsigned)lParam1); |
160 | const UString name2 = panel->GetItemName((int)lParam2); | 160 | const UString name2 = panel->GetItemName((unsigned)lParam2); |
161 | return CompareFileNames_ForFolderList( | 161 | return CompareFileNames_ForFolderList( |
162 | GetExtensionPtr(name1), | 162 | GetExtensionPtr(name1), |
163 | GetExtensionPtr(name2)); | 163 | GetExtensionPtr(name2)); |
@@ -186,18 +186,18 @@ int CALLBACK CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData); | |||
186 | int CALLBACK CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) | 186 | int CALLBACK CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) |
187 | { | 187 | { |
188 | if (lpData == 0) return 0; | 188 | if (lpData == 0) return 0; |
189 | if (lParam1 == kParentIndex) return -1; | 189 | if (lParam1 == (int)kParentIndex) return -1; |
190 | if (lParam2 == kParentIndex) return 1; | 190 | if (lParam2 == (int)kParentIndex) return 1; |
191 | 191 | ||
192 | CPanel *panel = (CPanel*)lpData; | 192 | CPanel *panel = (CPanel*)lpData; |
193 | 193 | ||
194 | bool isDir1 = panel->IsItem_Folder((int)lParam1); | 194 | const bool isDir1 = panel->IsItem_Folder((unsigned)lParam1); |
195 | bool isDir2 = panel->IsItem_Folder((int)lParam2); | 195 | const bool isDir2 = panel->IsItem_Folder((unsigned)lParam2); |
196 | 196 | ||
197 | if (isDir1 && !isDir2) return -1; | 197 | if (isDir1 && !isDir2) return -1; |
198 | if (isDir2 && !isDir1) return 1; | 198 | if (isDir2 && !isDir1) return 1; |
199 | 199 | ||
200 | int result = CompareItems2(lParam1, lParam2, lpData); | 200 | const int result = CompareItems2(lParam1, lParam2, lpData); |
201 | return panel->_ascending ? result: (-result); | 201 | return panel->_ascending ? result: (-result); |
202 | } | 202 | } |
203 | 203 | ||