This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 1/2] Code cleanup: Reindentation


On Tue, 05 Nov 2013 17:50:38 +0100, Mark Wielaard wrote:
> I agree, less deeply nested code is easier to read.

Checked in.


Jan

commit 21783b5e2a284081a9b9c8e451f844565b5f0a66
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Nov 7 16:34:58 2013 +0100

    dwfl_core_file_report: Code cleanup: Reindentation.
    
    Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>

diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 9581909..5b445e1 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Code cleanup.
+	* core-file.c (dwfl_core_file_report): Reindent block of code by
+	continue keyword.
+
 2013-10-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* argp-std.c (parse_opt): Use executable parameter of
diff --git a/libdwfl/core-file.c b/libdwfl/core-file.c
index 37613b8..24a3b24 100644
--- 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);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]