mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2025-01-01 08:59:40 +00:00
Remove some deprecated getters
This commit is contained in:
parent
cf86945db5
commit
fc5908b3da
@ -9,20 +9,16 @@ from .Enum import Enum
|
||||
|
||||
|
||||
class Instruction:
|
||||
opcode: int
|
||||
rs: int
|
||||
rt: int
|
||||
rd: int
|
||||
sa: int
|
||||
function: int
|
||||
|
||||
uniqueId: Enum
|
||||
|
||||
vram: int = 0
|
||||
inHandwrittenFunction: bool = False
|
||||
|
||||
instr: int
|
||||
immediate: int
|
||||
|
||||
def __init__(self, word: int) -> None: ...
|
||||
|
||||
@ -55,9 +51,7 @@ class Instruction:
|
||||
def isJump(self) -> bool: ...
|
||||
def isTrap(self) -> bool: ...
|
||||
def isFloat(self) -> bool: ...
|
||||
def isFloatInstruction(self) -> bool: ...
|
||||
def isDouble(self) -> bool: ...
|
||||
def isDoubleInstruction(self) -> bool: ...
|
||||
def isUnsigned(self) -> bool: ...
|
||||
def modifiesRt(self) -> bool: ...
|
||||
def modifiesRd(self) -> bool: ...
|
||||
|
@ -45,12 +45,10 @@ static PyMemberDef rabbitizer_type_Instruction_members[] = {
|
||||
return PyLong_FromUnsignedLong(self->instr.name); \
|
||||
}
|
||||
|
||||
DEF_MEMBER_GET_UINT(opcode)
|
||||
DEF_MEMBER_GET_UINT(rs)
|
||||
DEF_MEMBER_GET_UINT(rt)
|
||||
DEF_MEMBER_GET_UINT(rd)
|
||||
DEF_MEMBER_GET_UINT(sa)
|
||||
DEF_MEMBER_GET_UINT(function)
|
||||
|
||||
static PyObject *rabbitizer_type_Instruction_member_get_uniqueId(PyRabbitizerInstruction *self, PyObject *Py_UNUSED(ignored)) {
|
||||
PyObject *enumInstance = rabbitizer_enum_InstrId_enumvalues[self->instr.uniqueId].instance;
|
||||
@ -64,30 +62,18 @@ static PyObject *rabbitizer_type_Instruction_member_get_uniqueId(PyRabbitizerIns
|
||||
return enumInstance;
|
||||
}
|
||||
|
||||
static PyObject *rabbitizer_type_Instruction_member_get_instr(PyRabbitizerInstruction *self, PyObject *Py_UNUSED(ignored)) {
|
||||
return PyLong_FromUnsignedLong(RabbitizerInstruction_getRaw(&self->instr));
|
||||
}
|
||||
static PyObject *rabbitizer_type_Instruction_member_get_immediate(PyRabbitizerInstruction *self, PyObject *Py_UNUSED(ignored)) {
|
||||
return PyLong_FromUnsignedLong(RabbitizerInstruction_getImmediate(&self->instr));
|
||||
}
|
||||
|
||||
#define MEMBER_GET(name, docs, closure) { #name, (getter) rabbitizer_type_Instruction_member_get_##name, (setter) NULL, PyDoc_STR(docs), closure }
|
||||
#define MEMBER_SET(name, docs, closure) { #name, (getter) NULL, (setter) rabbitizer_type_Instruction_member_set_##name, PyDoc_STR(docs), closure }
|
||||
#define MEMBER_GET_SET(name, docs, closure) { #name, (getter) rabbitizer_type_Instruction_member_get_##name, (setter) rabbitizer_type_Instruction_member_set_##name, PyDoc_STR(docs), closure }
|
||||
|
||||
|
||||
static PyGetSetDef Instr_getsetters[] = {
|
||||
MEMBER_GET(opcode, "", NULL), // todo: deprecate
|
||||
MEMBER_GET(rs, "", NULL), // todo: deprecate
|
||||
MEMBER_GET(rt, "", NULL), // todo: deprecate
|
||||
MEMBER_GET(rd, "", NULL), // todo: deprecate
|
||||
MEMBER_GET(sa, "", NULL), // todo: deprecate
|
||||
MEMBER_GET(function, "", NULL), // todo: deprecate
|
||||
MEMBER_GET(uniqueId, "", NULL),
|
||||
|
||||
{ "instr", (getter) rabbitizer_type_Instruction_member_get_instr, (setter) NULL, "", NULL }, // todo: deprecate
|
||||
{ "immediate", (getter) rabbitizer_type_Instruction_member_get_immediate, (setter) NULL, "", NULL }, // todo: deprecate
|
||||
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
@ -272,9 +258,7 @@ static PyMethodDef Instr_methods[] = {
|
||||
METHOD_NO_ARGS(isJump, ""),
|
||||
METHOD_NO_ARGS(isTrap, ""),
|
||||
METHOD_NO_ARGS(isFloat, ""),
|
||||
{ "isFloatInstruction", (PyCFunction) rabbitizer_type_Instruction_isFloat, METH_NOARGS, ""}, // TODO: deprecate
|
||||
METHOD_NO_ARGS(isDouble, ""),
|
||||
{ "isDoubleInstruction", (PyCFunction) rabbitizer_type_Instruction_isDouble, METH_NOARGS, ""}, // TODO: deprecate
|
||||
METHOD_NO_ARGS(isUnsigned, ""),
|
||||
METHOD_NO_ARGS(modifiesRt, ""),
|
||||
METHOD_NO_ARGS(modifiesRd, ""),
|
||||
|
Loading…
Reference in New Issue
Block a user