diff --git a/src/BagOValues.h b/src/BagOValues.h index 054f262a..2b933cb6 100644 --- a/src/BagOValues.h +++ b/src/BagOValues.h @@ -61,7 +61,7 @@ class BagOValues { wstring lowered; lowered.resize(query.size()); - transform(std::cbegin(query), std::cend(query), std::begin(lowered), ::tolower); + transform(std::begin(query), std::end(query), std::begin(lowered), ::tolower); vector results; TValue val = TValue(); diff --git a/src/treectl.c b/src/treectl.c index 8a0ea92c..86f708db 100644 --- a/src/treectl.c +++ b/src/treectl.c @@ -2117,16 +2117,16 @@ TreeControlWndProc( #define fDontSelChange HIWORD(wParam) #define szDir (LPTSTR)lParam // NULL -> default == window text. + RECT rc; + DWORD i; + PDNODE pNode; + // // Don't do anything while the tree is being built. // if (GetWindowLongPtr(hwnd, GWL_READLEVEL)) break; - RECT rc; - DWORD i; - PDNODE pNode; - // do the same as TC_SETDIRECTORY above for the simple case if (FindItemFromPath(hwndLB, (LPTSTR)lParam, 0, &i, &pNode)) { diff --git a/src/wfcomman.c b/src/wfcomman.c index 9777b723..38d1879c 100644 --- a/src/wfcomman.c +++ b/src/wfcomman.c @@ -532,10 +532,12 @@ CreateDirWindow( // Are we replacing the contents of the currently active child? // if (bReplaceOpen) { + INT i = 0; + DRIVE drive; CharUpperBuff(szPath, 1); // make sure - DRIVE drive = DRIVEID(szPath); - for (INT i = 0; i FilterBySubtree(vector const& parents, vector const& children) { vector results; - +#if 0 // for each child, if parent in parents, return std::copy_if(std::cbegin(children), std::cend(children), @@ -109,7 +109,15 @@ vector FilterBySubtree(vector const& parents, vector co PDNODE parent = child->pParent; return (find(std::cbegin(parents), std::cend(parents), parent) != std::end(parents)); }); - +#else + vector::const_iterator it; + for(it=children.begin(); it!=children.end(); it++) { + PDNODE parent = (*it)->pParent; + if (find(std::begin(parents), std::end(parents), parent) != std::end(parents)) { + results.push_back(parent); + } + } +#endif return results; } @@ -121,12 +129,14 @@ vector TreeIntersection(vector>& trees) return result; // If any tree is empty, return empty - if (std::any_of(std::cbegin(trees), std::cend(trees), [](auto& tree) { return tree.size() == 0; })) + if (std::any_of(std::begin(trees), std::end(trees), [](vector& tree) { return tree.size() == 0; })) return result; size_t maxOutput = 0; - for (auto& tree : trees) + vector >::iterator it; + for (it=trees.begin(); it!=trees.end(); it++) // (auto& tree : trees) { + vector& tree = *it; sort(tree.begin(), tree.end(), CompareNodes); if (tree.size() > maxOutput) maxOutput = tree.size(); @@ -282,8 +292,10 @@ vector SplitIntoWords(LPCTSTR szText) void FreeDirectoryBagOValues(BagOValues *pbov, vector *pNodes) { // free all PDNODE in BagOValues - for (PDNODE p : *pNodes) + vector::iterator it; + for (it=(*pNodes).begin(); it!=(*pNodes).end(); it++) // (PDNODE p : *pNodes) { + PDNODE p = *it; LocalFree(p); } @@ -361,9 +373,10 @@ BOOL BuildDirectoryBagOValues(BagOValues *pbov, vector *pNodes, // if spaces, each word individually (and not whole thing) vector words = SplitIntoWords(lfndta.fd.cFileName); - - for (auto word : words) + vector::iterator it; + for (it=words.begin(); it!=words.end(); it++) // (auto word : words) { + wstring &word = *it; // TODO: how to mark which word is primary to avoid double free? pbov->Add(word, pNodeChild); } @@ -399,14 +412,16 @@ BOOL BuildDirectoryBagOValues(BagOValues *pbov, vector *pNodes, vector GetDirectoryOptionsFromText(LPCTSTR szText, BOOL *pbLimited) { if (g_pBagOCDrive == nullptr) - return vector{}; + return vector(); vector words = SplitIntoWords(szText); vector> options_per_word; - for (auto word : words) + vector::iterator it; + for (it=words.begin(); it!=words.end(); it++) // (auto word : words) { + wstring &word = *it; vector options; size_t pos = word.find_first_of(L'\\'); if (pos == word.size() - 1) @@ -697,4 +712,4 @@ StartBuildingDirectoryTrie() CloseHandle(hThreadCopy); return 0; -} \ No newline at end of file +} diff --git a/src/wfloc.c b/src/wfloc.c index af8fb93d..cc586e4e 100644 --- a/src/wfloc.c +++ b/src/wfloc.c @@ -24,8 +24,9 @@ LPCTSTR szLCIDs[] = { VOID InitLangList(HWND hCBox) { + UINT i = 0; // Propogate the list - for (UINT i = 0; i <= (COUNTOF(szLCIDs) - 1); i++) + for (i = 0; i <= (COUNTOF(szLCIDs) - 1); i++) { TCHAR szLangName[MAX_PATH] = { 0 }; LCID lcidTemp = LocaleNameToLCID(szLCIDs[i], 0); diff --git a/src/wfsearch.c b/src/wfsearch.c index 470e2cd7..2c28857d 100644 --- a/src/wfsearch.c +++ b/src/wfsearch.c @@ -780,9 +780,10 @@ SearchWndProc( return 0L; if (wParam == CD_SEARCHUPDATE) { + int msg; LoadString(hAppInstance, IDS_SEARCHTITLE, szTitle, COUNTOF(szTitle)); LoadString(hAppInstance, IDS_SEARCHREFRESH, szMessage, COUNTOF(szMessage)); - int msg = MessageBox(hwnd, szMessage, szTitle, MB_ABORTRETRYIGNORE | MB_ICONQUESTION); + msg = MessageBox(hwnd, szMessage, szTitle, MB_ABORTRETRYIGNORE | MB_ICONQUESTION); if (msg == IDABORT) { diff --git a/src/wfutil.c b/src/wfutil.c index 5c68feae..fc68d441 100644 --- a/src/wfutil.c +++ b/src/wfutil.c @@ -28,6 +28,7 @@ HistoryDir rghistoryDir[MAXHISTORY]; VOID SaveHistoryDir(HWND hwnd, LPWSTR szDir) { + DWORD historyT; if (rghistoryDir[historyCur].hwnd == hwnd && lstrcmpi(rghistoryDir[historyCur].szDir, szDir) == 0) return; @@ -37,7 +38,7 @@ SaveHistoryDir(HWND hwnd, LPWSTR szDir) lstrcpy(rghistoryDir[historyCur].szDir, szDir); // always leave one NULL entry after current - DWORD historyT = (historyCur + 1) % MAXHISTORY; + historyT = (historyCur + 1) % MAXHISTORY; rghistoryDir[historyT].hwnd = NULL; rghistoryDir[historyT].szDir[0] = '\0'; }