On 15/8/22 09:26, Milica Lazarevic wrote:
NMD class methods with the disassembly_function type like
NMD::ABS_D, NMD::ABS_S, etc. are removed from the class. They're now
declared global static functions. Therefore, typedef of the function
pointer, disassembly_function is defined outside of the class.
Now that disassembly_function type functions are not part of the NMD
class we can't access them using the this pointer. Thus, the use of
the this pointer has been deleted.
Signed-off-by: Milica Lazarevic <milica.lazare...@syrmia.com>
---
disas/nanomips.cpp | 2546 ++++++++++++++++++++++----------------------
disas/nanomips.h | 640 +----------
2 files changed, 1274 insertions(+), 1912 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 9e720d0e8d..205c4f3143 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -815,7 +815,7 @@ int NMD::Disassemble(const uint16 * data, std::string & dis,
return -6;
}
type = table[i].type;
- dis = (this->*dis_fn)(op_code);
+ dis = (dis_fn)(op_code);
dis_fn(op_code);
return table[i].instructions_size;
} else {
dis = "reserved instruction";
diff --git a/disas/nanomips.h b/disas/nanomips.h
index 0e6670adf5..d27711b4e2 100644
--- a/disas/nanomips.h
+++ b/disas/nanomips.h
@@ -32,6 +32,7 @@ typedef uint16_t uint16;
typedef uint64_t img_address;
typedef bool(*conditional_function)(uint64 instruction);
+typedef std::string(*disassembly_function)(uint64 instruction);
typedef std::string (*nmd_disas_fn)(uint64 instruction);
enum TABLE_ENTRY_TYPE {
instruction,
@@ -72,8 +73,6 @@ public:
private:
- typedef std::string(NMD:: *disassembly_function)(uint64 instruction);
-
struct Pool {
TABLE_ENTRY_TYPE type;
struct Pool *next_table;
@@ -90,643 +89,6 @@ private:
int Disassemble(const uint16 *data, std::string & dis,
TABLE_ENTRY_TYPE & type, const Pool *table, int
table_size);
Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org>