This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 5/6] S/390: Drop function pointer dereferences in disassembler
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: binutils at sourceware dot org
- Cc: Martin Schwidefsky <schwidefsky at de dot ibm dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Fri, 25 Jul 2014 19:01:52 +0200
- Subject: [PATCH 5/6] S/390: Drop function pointer dereferences in disassembler
- Authentication-results: sourceware.org; auth=none
- References: <1406307713-7926-1-git-send-email-arnez at linux dot vnet dot ibm dot com>
Convert occurrences of "(*foo->bar) ()" to "foo->bar ()".
opcodes/
* s390-dis.c (s390_print_insn_with_opcode): Drop function pointer
dereferences without effect.
(print_insn_s390): Likewise.
---
opcodes/s390-dis.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c
index 029f9f1..891970f 100644
--- a/opcodes/s390-dis.c
+++ b/opcodes/s390-dis.c
@@ -159,9 +159,9 @@ s390_print_insn_with_opcode (bfd_vma memaddr,
char separator;
if (opcode->operands[0] != 0)
- (*info->fprintf_func) (info->stream, "%s\t", opcode->name);
+ info->fprintf_func (info->stream, "%s\t", opcode->name);
else
- (*info->fprintf_func) (info->stream, "%s", opcode->name);
+ info->fprintf_func (info->stream, "%s", opcode->name);
/* Extract the operands. */
separator = 0;
@@ -180,22 +180,22 @@ s390_print_insn_with_opcode (bfd_vma memaddr,
}
if (separator)
- (*info->fprintf_func) (info->stream, "%c", separator);
+ info->fprintf_func (info->stream, "%c", separator);
if (operand->flags & S390_OPERAND_GPR)
- (*info->fprintf_func) (info->stream, "%%r%u", val.u);
+ info->fprintf_func (info->stream, "%%r%u", val.u);
else if (operand->flags & S390_OPERAND_FPR)
- (*info->fprintf_func) (info->stream, "%%f%u", val.u);
+ info->fprintf_func (info->stream, "%%f%u", val.u);
else if (operand->flags & S390_OPERAND_AR)
- (*info->fprintf_func) (info->stream, "%%a%u", val.u);
+ info->fprintf_func (info->stream, "%%a%u", val.u);
else if (operand->flags & S390_OPERAND_CR)
- (*info->fprintf_func) (info->stream, "%%c%u", val.u);
+ info->fprintf_func (info->stream, "%%c%u", val.u);
else if (operand->flags & S390_OPERAND_PCREL)
- (*info->print_address_func) (memaddr + val.i + val.i, info);
+ info->print_address_func (memaddr + val.i + val.i, info);
else if (operand->flags & S390_OPERAND_SIGNED)
- (*info->fprintf_func) (info->stream, "%i", val.i);
+ info->fprintf_func (info->stream, "%i", val.i);
else
- (*info->fprintf_func) (info->stream, "%u", val.u);
+ info->fprintf_func (info->stream, "%u", val.u);
if (operand->flags & S390_OPERAND_DISP)
{
@@ -203,7 +203,7 @@ s390_print_insn_with_opcode (bfd_vma memaddr,
}
else if (operand->flags & S390_OPERAND_BASE)
{
- (*info->fprintf_func) (info->stream, ")");
+ info->fprintf_func (info->stream, ")");
separator = ',';
}
else
@@ -241,15 +241,15 @@ print_insn_s390 (bfd_vma memaddr, struct disassemble_info *info)
/* Every S390 instruction is max 6 bytes long. */
memset (buffer, 0, 6);
- status = (*info->read_memory_func) (memaddr, buffer, 6, info);
+ status = info->read_memory_func (memaddr, buffer, 6, info);
if (status != 0)
{
for (bufsize = 0; bufsize < 6; bufsize++)
- if ((*info->read_memory_func) (memaddr, buffer, bufsize + 1, info) != 0)
+ if (info->read_memory_func (memaddr, buffer, bufsize + 1, info) != 0)
break;
if (bufsize <= 0)
{
- (*info->memory_error_func) (status, memaddr, info);
+ info->memory_error_func (status, memaddr, info);
return -1;
}
opsize = s390_insn_length (buffer);
@@ -293,20 +293,20 @@ print_insn_s390 (bfd_vma memaddr, struct disassemble_info *info)
value = (value << 8) + (unsigned int) buffer[1];
value = (value << 8) + (unsigned int) buffer[2];
value = (value << 8) + (unsigned int) buffer[3];
- (*info->fprintf_func) (info->stream, ".long\t0x%08x", value);
+ info->fprintf_func (info->stream, ".long\t0x%08x", value);
return 4;
}
else if (bufsize >= 2)
{
value = (unsigned int) buffer[0];
value = (value << 8) + (unsigned int) buffer[1];
- (*info->fprintf_func) (info->stream, ".short\t0x%04x", value);
+ info->fprintf_func (info->stream, ".short\t0x%04x", value);
return 2;
}
else
{
value = (unsigned int) buffer[0];
- (*info->fprintf_func) (info->stream, ".byte\t0x%02x", value);
+ info->fprintf_func (info->stream, ".byte\t0x%02x", value);
return 1;
}
}
--
1.8.4.2