This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Commit: Fix formatting in coff-i386.c


Hi Guys,

  I was trying to bootstrap the mainline gcc sources yesterday using the
  latest binutils sources and I cam across this error:

bfd/coff-i386.c: In function 'coff_i386_reloc':
bfd/coff-i386.c:142:5: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
     if (diff != 0)
     ^~
bfd/coff-i386.c:133:3: note: ...this 'if' clause, but it is not
   if (reloc_entry->howto->type == R_IMAGEBASE
   ^~

  It turns out to be a simple case of mis-indentation of an if
  statement, so I am checking in the patch below to fix the problem.

Cheers
  Nick

bfd/ChangeLog
2015-12-18  Nick Clifton  <nickc@redhat.com>

	* coff-i386.c (coff_i386_reloc): Fix formatting.

diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c
index a9725c4..1b1a815 100644
--- a/bfd/coff-i386.c
+++ b/bfd/coff-i386.c
@@ -139,41 +139,41 @@ coff_i386_reloc (bfd *abfd,
 #define DOIT(x) \
   x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
 
-    if (diff != 0)
-      {
-	reloc_howto_type *howto = reloc_entry->howto;
-	unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+  if (diff != 0)
+    {
+      reloc_howto_type *howto = reloc_entry->howto;
+      unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+      switch (howto->size)
+	{
+	case 0:
+	  {
+	    char x = bfd_get_8 (abfd, addr);
+	    DOIT (x);
+	    bfd_put_8 (abfd, x, addr);
+	  }
+	  break;
 
-	switch (howto->size)
+	case 1:
 	  {
-	  case 0:
-	    {
-	      char x = bfd_get_8 (abfd, addr);
-	      DOIT (x);
-	      bfd_put_8 (abfd, x, addr);
-	    }
-	    break;
-
-	  case 1:
-	    {
-	      short x = bfd_get_16 (abfd, addr);
-	      DOIT (x);
-	      bfd_put_16 (abfd, (bfd_vma) x, addr);
-	    }
-	    break;
-
-	  case 2:
-	    {
-	      long x = bfd_get_32 (abfd, addr);
-	      DOIT (x);
-	      bfd_put_32 (abfd, (bfd_vma) x, addr);
-	    }
-	    break;
-
-	  default:
-	    abort ();
+	    short x = bfd_get_16 (abfd, addr);
+	    DOIT (x);
+	    bfd_put_16 (abfd, (bfd_vma) x, addr);
 	  }
-      }
+	  break;
+
+	case 2:
+	  {
+	    long x = bfd_get_32 (abfd, addr);
+	    DOIT (x);
+	    bfd_put_32 (abfd, (bfd_vma) x, addr);
+	  }
+	  break;
+
+	default:
+	  abort ();
+	}
+    }
 
   /* Now let bfd_perform_relocation finish everything up.  */
   return bfd_reloc_continue;


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