diff mbox series

[v2,18/20] disas/nanomips: Remove argument passing by ref

Message ID 20220905095522.66941-19-milica.lazarevic@syrmia.com (mailing list archive)
State New, archived
Headers show
Series Convert nanoMIPS disassembler from C++ to C | expand

Commit Message

Milica Lazarevic Sept. 5, 2022, 9:55 a.m. UTC
Replaced argument passing by reference with passing by address.

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

Comments

Richard Henderson Sept. 5, 2022, 11:56 a.m. UTC | #1
On 9/5/22 10:55, Milica Lazarevic wrote:
> Replaced argument passing by reference with passing by address.
> 
> Signed-off-by: Milica Lazarevic<milica.lazarevic@syrmia.com>
> Reviewed-by: Thomas Huth<thuth@redhat.com>
> ---
>   disas/nanomips.cpp | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index f57d255de3..ab54456c2e 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -635,7 +635,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, struct Dis_info *info)
 {
     for (int i = 0; i < table_size; i++) {
@@ -669,7 +669,7 @@  static int Disassemble(const uint16 *data, char *dis,
                             "disassembler failure - bad table entry");
                             return -6;
                         }
-                        type = table[i].type;
+                        *type = table[i].type;
                         g_autofree char *dis_str = dis_fn(op_code, info);
                         strcpy(dis, dis_str);
                         return table[i].instructions_size;
@@ -22248,7 +22248,7 @@  static int nanomips_dis(char *buf,
     uint16 bits[3] = {one, two, three};
 
     TABLE_ENTRY_TYPE type;
-    int size = Disassemble(bits, disasm, type, MAJOR, 2, info);
+    int size = Disassemble(bits, disasm, &type, MAJOR, 2, info);
 
     strcpy(buf, disasm);
     return size;