qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 17/20] disas/nanomips: Remove argument passing by ref


From: Thomas Huth
Subject: Re: [PATCH 17/20] disas/nanomips: Remove argument passing by ref
Date: Sat, 27 Aug 2022 10:36:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

On 15/08/2022 09.26, Milica Lazarevic wrote:
Replaced argument passing by reference with passing by address.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
---
  disas/nanomips.cpp | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 9406805367..7dfefdc5ed 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -638,7 +638,7 @@ static uint64 extract_op_code_value(const uint16 *data, int 
size)
   *      disassembly string  - on error will constain error string
   */
  static int Disassemble(const uint16 *data, char *dis,
-                       TABLE_ENTRY_TYPE & type, const Pool *table,
+                       TABLE_ENTRY_TYPE *type, const Pool *table,
                         int table_size)
  {
      for (int i = 0; i < table_size; i++) {
@@ -673,7 +673,7 @@ static int Disassemble(const uint16 *data, char *dis,
                          "disassembler failure - bad table entry");
                          return -6;
                      }
-                    type = table[i].type;
+                    *type = table[i].type;
                      const char *dis_str = dis_fn(op_code);
                      strcpy(dis, dis_str);
                      free((char *)dis_str);
@@ -22792,7 +22792,7 @@ int nanomips_dis(char *buf,
      TABLE_ENTRY_TYPE type;
      m_pc = address;
      m_requested_instruction_categories = ALL_ATTRIBUTES;
-    int size = Disassemble(bits, disasm, type, MAJOR, 2);
+    int size = Disassemble(bits, disasm, &type, MAJOR, 2);
strcpy(buf, disasm);
      return size;

Reviewed-by: Thomas Huth <thuth@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]