qemu-devel
[Top][All Lists]
Advanced

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

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


From: Milica Lazarevic
Subject: [PATCH 17/20] disas/nanomips: Remove argument passing by ref
Date: Mon, 15 Aug 2022 09:26:26 +0200

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;
-- 
2.25.1




reply via email to

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