summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2016-06-14 17:50:12 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2016-08-23 09:41:01 +0100
commit5bf9a9a7dd9be88fe556796474689296ffc3d324 (patch)
treede8bfe1f922be7f6b5733f546390924ee62d8333
parent2d0a5f0d0a2d51d31fb4394d0732ec623c069958 (diff)
downloadbinutils-gdb-5bf9a9a7dd9be88fe556796474689296ffc3d324.tar.gz
[AArch64][SVE 02/32] Avoid hard-coded limit in indented_print
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
-rw-r--r--opcodes/aarch64-gen.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/opcodes/aarch64-gen.c b/opcodes/aarch64-gen.c
index ed0834a7ac6..b87dea45649 100644
--- a/opcodes/aarch64-gen.c
+++ b/opcodes/aarch64-gen.c
@@ -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);
}