]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[AArch64][SVE 02/32] Avoid hard-coded limit in indented_print
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 14 Jun 2016 16:50:12 +0000 (17:50 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 23 Aug 2016 08:41:01 +0000 (09:41 +0100)
The maximum indentation needed by aarch64-gen.c grows as more
instructions are added to aarch64-tbl.h.  Rather than having to
increase the indentation limit to a higher value, it seemed better
to replace it with "%*s".

opcodes/
* aarch64-gen.c (indented_print): Avoid hard-coded indentation limit.

Change-Id: Id740909ecb53ee2d6ff4e08e525bcb5d96e9af99

opcodes/aarch64-gen.c

index ed0834a7ac64a92dda238b74b05f22d0302f8a6b..b87dea456494486d7f8ba68cca1f4f721b23d499 100644 (file)
@@ -378,13 +378,9 @@ initialize_decoder_tree (void)
 static void __attribute__ ((format (printf, 2, 3)))
 indented_print (unsigned int indent, const char *format, ...)
 {
-  /* 80 number of spaces pluc a NULL terminator.  */
-  static const char spaces[81] =
-    "                                                                                ";
   va_list ap;
   va_start (ap, format);
-  assert (indent <= 80);
-  printf ("%s", &spaces[80 - indent]);
+  printf ("%*s", indent, "");
   vprintf (format, ap);
   va_end (ap);
 }