[Lldb-commits] [lldb] r295352 - Reindent the code to avoid an error with gcc:

Sylvestre Ledru via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 16 10:45:28 PST 2017


Author: sylvestre
Date: Thu Feb 16 12:45:27 2017
New Revision: 295352

URL: http://llvm.org/viewvc/llvm-project?rev=295352&view=rev
Log:
Reindent the code to avoid an error with gcc:
error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]


Modified:
    lldb/trunk/source/Host/common/FileSpec.cpp

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=295352&r1=295351&r2=295352&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Thu Feb 16 12:45:27 2017
@@ -1107,46 +1107,46 @@ FileSpec::ForEachItemInDirectory(llvm::S
         else
           child_path = llvm::join_items('/', dir_path, dp->d_name);
 
-          // Don't resolve the file type or path
-          FileSpec child_path_spec(child_path, false);
+        // Don't resolve the file type or path
+        FileSpec child_path_spec(child_path, false);
 
-          EnumerateDirectoryResult result =
-              callback(file_type, child_path_spec);
+        EnumerateDirectoryResult result =
+            callback(file_type, child_path_spec);
 
-          switch (result) {
-          case eEnumerateDirectoryResultNext:
-            // Enumerate next entry in the current directory. We just
-            // exit this switch and will continue enumerating the
-            // current directory as we currently are...
-            break;
-
-          case eEnumerateDirectoryResultEnter: // Recurse into the current entry
-                                               // if it is a directory or
-                                               // symlink, or next if not
-            if (FileSpec::ForEachItemInDirectory(child_path, callback) ==
-                eEnumerateDirectoryResultQuit) {
-              // The subdirectory returned Quit, which means to
-              // stop all directory enumerations at all levels.
-              if (buf)
-                free(buf);
-              return eEnumerateDirectoryResultQuit;
-            }
-            break;
-
-          case eEnumerateDirectoryResultExit: // Exit from the current directory
-                                              // at the current level.
-            // Exit from this directory level and tell parent to
-            // keep enumerating.
-            if (buf)
-              free(buf);
-            return eEnumerateDirectoryResultNext;
-
-          case eEnumerateDirectoryResultQuit: // Stop directory enumerations at
-                                              // any level
+        switch (result) {
+        case eEnumerateDirectoryResultNext:
+          // Enumerate next entry in the current directory. We just
+          // exit this switch and will continue enumerating the
+          // current directory as we currently are...
+          break;
+
+        case eEnumerateDirectoryResultEnter: // Recurse into the current entry
+                                             // if it is a directory or
+                                             // symlink, or next if not
+          if (FileSpec::ForEachItemInDirectory(child_path, callback) ==
+              eEnumerateDirectoryResultQuit) {
+            // The subdirectory returned Quit, which means to
+            // stop all directory enumerations at all levels.
             if (buf)
               free(buf);
             return eEnumerateDirectoryResultQuit;
           }
+          break;
+
+        case eEnumerateDirectoryResultExit: // Exit from the current directory
+                                            // at the current level.
+          // Exit from this directory level and tell parent to
+          // keep enumerating.
+          if (buf)
+            free(buf);
+          return eEnumerateDirectoryResultNext;
+
+        case eEnumerateDirectoryResultQuit: // Stop directory enumerations at
+                                            // any level
+          if (buf)
+            free(buf);
+          return eEnumerateDirectoryResultQuit;
+        }
       }
       if (buf) {
         free(buf);




More information about the lldb-commits mailing list