Hi Mark,

not sure why it was written this way, I find it easier for the later patch not
to nest too deep.


Thanks,
Jan
libdwfl/
2013-11-01  Jan Kratochvil  <[email protected]>

        Code cleanup.
        * core-file.c (dwfl_core_file_report): Reindent block of code by
        continue keyword.

--- a/libdwfl/core-file.c
+++ b/libdwfl/core-file.c
@@ -500,34 +500,35 @@ dwfl_core_file_report (Dwfl *dwfl, Elf *elf, const char 
*executable)
     lastmodp = &(*lastmodp)->next;
   for (struct r_debug_info_module *module = r_debug_info.module;
        module != NULL; module = module->next)
-    if (module->elf != NULL)
-      {
-       Dwfl_Module *mod;
-       mod = __libdwfl_report_elf (dwfl, basename (module->name), module->name,
-                                   module->fd, module->elf, module->l_addr,
-                                   true, true);
-       if (mod == NULL)
-         continue;
-       module->elf = NULL;
-       module->fd = -1;
-       /* Move this module to the end of the list, so that we end
-          up with a list in the same order as the link_map chain.  */
-       if (mod->next != NULL)
-         {
-           if (*lastmodp != mod)
-             {
-               lastmodp = &dwfl->modulelist;
-               while (*lastmodp != mod)
-                 lastmodp = &(*lastmodp)->next;
-             }
-           *lastmodp = mod->next;
-           mod->next = NULL;
-           while (*lastmodp != NULL)
-             lastmodp = &(*lastmodp)->next;
-           *lastmodp = mod;
-         }
-       lastmodp = &mod->next;
-      }
+    {
+      if (module->elf == NULL)
+       continue;
+      Dwfl_Module *mod;
+      mod = __libdwfl_report_elf (dwfl, basename (module->name), module->name,
+                                 module->fd, module->elf, module->l_addr,
+                                 true, true);
+      if (mod == NULL)
+       continue;
+      module->elf = NULL;
+      module->fd = -1;
+      /* Move this module to the end of the list, so that we end
+        up with a list in the same order as the link_map chain.  */
+      if (mod->next != NULL)
+       {
+         if (*lastmodp != mod)
+           {
+             lastmodp = &dwfl->modulelist;
+             while (*lastmodp != mod)
+               lastmodp = &(*lastmodp)->next;
+           }
+         *lastmodp = mod->next;
+         mod->next = NULL;
+         while (*lastmodp != NULL)
+           lastmodp = &(*lastmodp)->next;
+         *lastmodp = mod;
+       }
+      lastmodp = &mod->next;
+    }
 
   clear_r_debug_info (&r_debug_info);
 

Reply via email to