<div dir="ltr">+chaorenl</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 30, 2015 at 8:03 AM, Ewan Crawford <span dir="ltr"><<a href="mailto:ewan@codeplay.com" target="_blank">ewan@codeplay.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ewancrawford<br>
Date: Tue Jun 30 10:03:31 2015<br>
New Revision: 241071<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D241071-26view-3Drev&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=IT2GWjre65ZlRZVDI7Y650ZZw9lT6emYfzjQF53zE3s&s=BPMX5WfNhyRCHy0ZN7ooS-FEfxT6TlVJVRrrVESiH_4&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=241071&view=rev</a><br>
Log:<br>
Fix windows build.<br>
<br>
Windows build was broken in either r240983 or r240978 in the changes to FileSpec.cpp<br>
<br>
Modified:<br>
lldb/trunk/source/Host/common/FileSpec.cpp<br>
<br>
Modified: lldb/trunk/source/Host/common/FileSpec.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Host_common_FileSpec.cpp-3Frev-3D241071-26r1-3D241070-26r2-3D241071-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=IT2GWjre65ZlRZVDI7Y650ZZw9lT6emYfzjQF53zE3s&s=1MIqMhnOyj74G0PmhprE-xxN2tcz5AsE1wYSzKlALA4&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=241071&r1=241070&r2=241071&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)<br>
+++ lldb/trunk/source/Host/common/FileSpec.cpp Tue Jun 30 10:03:31 2015<br>
@@ -1088,7 +1088,6 @@ FileSpec::ForEachItemInDirectory (const<br>
<br>
do<br>
{<br>
- bool call_callback = false;<br>
FileSpec::FileType file_type = eFileTypeUnknown;<br>
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)<br>
{<br>
@@ -1101,54 +1100,49 @@ FileSpec::ForEachItemInDirectory (const<br>
continue;<br>
<br>
file_type = eFileTypeDirectory;<br>
- call_callback = find_directories;<br>
}<br>
else if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DEVICE)<br>
{<br>
file_type = eFileTypeOther;<br>
- call_callback = find_other;<br>
}<br>
else<br>
{<br>
file_type = eFileTypeRegular;<br>
- call_callback = find_files;<br>
}<br>
- if (call_callback)<br>
- {<br>
- char child_path[MAX_PATH];<br>
- const int child_path_len = ::snprintf (child_path, sizeof(child_path), "%s\\%s", dir_path, ffd.cFileName);<br>
- if (child_path_len < (int)(sizeof(child_path) - 1))<br>
- {<br>
- // Don't resolve the file type or path<br>
- FileSpec child_path_spec (child_path, false);<br>
<br>
- EnumerateDirectoryResult result = callback (file_type, child_path_spec);<br>
+ char child_path[MAX_PATH];<br>
+ const int child_path_len = ::snprintf (child_path, sizeof(child_path), "%s\\%s", dir_path, ffd.cFileName);<br>
+ if (child_path_len < (int)(sizeof(child_path) - 1))<br>
+ {<br>
+ // Don't resolve the file type or path<br>
+ FileSpec child_path_spec (child_path, false);<br>
<br>
- switch (result)<br>
- {<br>
- case eEnumerateDirectoryResultNext:<br>
- // Enumerate next entry in the current directory. We just<br>
- // exit this switch and will continue enumerating the<br>
- // current directory as we currently are...<br>
- break;<br>
-<br>
- case eEnumerateDirectoryResultEnter: // Recurse into the current entry if it is a directory or symlink, or next if not<br>
- if (FileSpec::ForEachItemInDirectory(child_path, callback) == eEnumerateDirectoryResultQuit)<br>
- {<br>
- // The subdirectory returned Quit, which means to<br>
- // stop all directory enumerations at all levels.<br>
- return eEnumerateDirectoryResultQuit;<br>
- }<br>
- break;<br>
-<br>
- case eEnumerateDirectoryResultExit: // Exit from the current directory at the current level.<br>
- // Exit from this directory level and tell parent to<br>
- // keep enumerating.<br>
- return eEnumerateDirectoryResultNext;<br>
+ EnumerateDirectoryResult result = callback (file_type, child_path_spec);<br>
<br>
- case eEnumerateDirectoryResultQuit: // Stop directory enumerations at any level<br>
+ switch (result)<br>
+ {<br>
+ case eEnumerateDirectoryResultNext:<br>
+ // Enumerate next entry in the current directory. We just<br>
+ // exit this switch and will continue enumerating the<br>
+ // current directory as we currently are...<br>
+ break;<br>
+<br>
+ case eEnumerateDirectoryResultEnter: // Recurse into the current entry if it is a directory or symlink, or next if not<br>
+ if (FileSpec::ForEachItemInDirectory(child_path, callback) == eEnumerateDirectoryResultQuit)<br>
+ {<br>
+ // The subdirectory returned Quit, which means to<br>
+ // stop all directory enumerations at all levels.<br>
return eEnumerateDirectoryResultQuit;<br>
- }<br>
+ }<br>
+ break;<br>
+<br>
+ case eEnumerateDirectoryResultExit: // Exit from the current directory at the current level.<br>
+ // Exit from this directory level and tell parent to<br>
+ // keep enumerating.<br>
+ return eEnumerateDirectoryResultNext;<br>
+<br>
+ case eEnumerateDirectoryResultQuit: // Stop directory enumerations at any level<br>
+ return eEnumerateDirectoryResultQuit;<br>
}<br>
}<br>
} while (FindNextFile(hFind, &ffd) != 0);<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
</blockquote></div><br></div>