From 8a9824bbd32f8626ab8f85b204e7df269f976201 Mon Sep 17 00:00:00 2001 From: angie Date: Mon, 19 Dec 2022 15:12:12 -0300 Subject: [PATCH] format tidy --- .clang-tidy | 2 +- Makefile | 2 +- rabbitizer/OperandType.pyi | 2 ++ src/instructions/RabbitizerInstrDescriptor.c | 3 +-- src/instructions/RabbitizerInstrId.c | 2 +- .../RabbitizerInstruction/RabbitizerInstruction_Disassemble.c | 1 - .../RabbitizerInstruction/RabbitizerInstruction_Examination.c | 2 +- .../RabbitizerInstruction/RabbitizerInstruction_Operand.c | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 8534b8a..f4e1805 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,4 +1,4 @@ -Checks: 'readability-*,-readability-magic-numbers,clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,bugprone*,-bugprone-branch-clone,modernize*,performance*,portability*,diagnostic-*,analyzer-*,misc*,-misc-no-recursion' +Checks: 'readability-*,-readability-magic-numbers,clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-optin.performance.Padding,bugprone*,-bugprone-branch-clone,modernize*,performance*,portability*,diagnostic-*,analyzer-*,misc*,-misc-no-recursion' WarningsAsErrors: '' HeaderFilterRegex: '(src|include)\/.*\.h$' FormatStyle: 'file' diff --git a/Makefile b/Makefile index 0c014e0..1d63df9 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ format: clang-format-11 -i -style=file $(CXX_FILES) tidy: - clang-tidy-11 -p . --fix --fix-errors $(C_FILES) $(H_FILES) -- $(CSTD) $(OPTFLAGS) $(IINC) $(WARNINGS) $(WARNINGS_C) $(CFLAGS) + clang-tidy-11 -p . --fix --fix-errors $(C_FILES) -- $(CSTD) $(OPTFLAGS) $(IINC) $(WARNINGS) $(WARNINGS_C) $(CFLAGS) tests: $(TESTS_ELFS) diff --git a/rabbitizer/OperandType.pyi b/rabbitizer/OperandType.pyi index 555140f..18011ee 100644 --- a/rabbitizer/OperandType.pyi +++ b/rabbitizer/OperandType.pyi @@ -30,6 +30,7 @@ class OperandType: cpu_immediate: Enum cpu_branch_target_label: Enum cpu_immediate_base: Enum + cpu_maybe_rd_rs: Enum rsp_rs: Enum rsp_rt: Enum @@ -46,6 +47,7 @@ class OperandType: rsp_vs_index: Enum rsp_offset_rs: Enum rsp_immediate_base: Enum + rsp_maybe_rd_rs: Enum r5900_I: Enum r5900_Q: Enum diff --git a/src/instructions/RabbitizerInstrDescriptor.c b/src/instructions/RabbitizerInstrDescriptor.c index a686549..2a69bb8 100644 --- a/src/instructions/RabbitizerInstrDescriptor.c +++ b/src/instructions/RabbitizerInstrDescriptor.c @@ -76,7 +76,7 @@ bool RabbitizerInstrDescriptor_hasOperandAlias(const RabbitizerInstrDescriptor * case RAB_OPERAND_cpu_sa: case RAB_OPERAND_cpu_zero: - // case RAB_OPERAND_cpu_function: + // case RAB_OPERAND_cpu_function: break; case RAB_OPERAND_cpu_cop0d: @@ -478,7 +478,6 @@ bool RabbitizerInstrDescriptor_hasOperandAlias(const RabbitizerInstrDescriptor * return RabbitizerInstrDescriptor_hasSpecificOperand(self, operand); } - bool RabbitizerInstrDescriptor_isUnknownType(const RabbitizerInstrDescriptor *self) { return self->instrType == RABBITIZER_INSTR_TYPE_UNKNOWN; } diff --git a/src/instructions/RabbitizerInstrId.c b/src/instructions/RabbitizerInstrId.c index 0c7218b..09e810b 100644 --- a/src/instructions/RabbitizerInstrId.c +++ b/src/instructions/RabbitizerInstrId.c @@ -15,7 +15,7 @@ bool RabbitizerInstrId_isValid(RabbitizerInstrId uniqueId) { case RABBITIZER_INSTR_ID_cpu_MAX: case RABBITIZER_INSTR_ID_rsp_MAX: case RABBITIZER_INSTR_ID_r5900_MAX: - // case RABBITIZER_INSTR_ID_ALL_MAX: Same as last MAX + // case RABBITIZER_INSTR_ID_ALL_MAX: Same as last MAX return false; default: diff --git a/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Disassemble.c b/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Disassemble.c index 893f469..8424436 100644 --- a/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Disassemble.c +++ b/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Disassemble.c @@ -9,7 +9,6 @@ #include "common/RabbitizerConfig.h" - size_t RabbitizerInstruction_getSizeForBufferInstrDisasm(const RabbitizerInstruction *self, size_t immOverrideLength, int extraLJust) { size_t totalSize = 0; size_t opcodeNameLength; diff --git a/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c b/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c index 0748886..7459434 100644 --- a/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c +++ b/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c @@ -117,7 +117,7 @@ const char *RabbitizerInstruction_mapInstrToType(const RabbitizerInstruction *se } bool RabbitizerInstruction_sameOpcode(const RabbitizerInstruction *self, const RabbitizerInstruction *other) { - if (!RabbitizerInstrId_isValid(self->uniqueId) || !RabbitizerInstrId_isValid(self->uniqueId)) { + if (!RabbitizerInstrId_isValid(self->uniqueId) || !RabbitizerInstrId_isValid(other->uniqueId)) { return false; } return self->uniqueId == other->uniqueId; diff --git a/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Operand.c b/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Operand.c index 89b7d5b..93d7685 100644 --- a/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Operand.c +++ b/src/instructions/RabbitizerInstruction/RabbitizerInstruction_Operand.c @@ -7,7 +7,6 @@ #include "instrOpercandCallbacks_array.table.h" - size_t RabbitizerOperandType_getBufferSize(RabbitizerOperandType operand, const RabbitizerInstruction *instr, size_t immOverrideLength) { char auxBuffer[0x100] = { 0 }; char immOverride[0x100] = { 0 }; @@ -36,7 +35,8 @@ size_t RabbitizerInstruction_getSizeForBufferOperandsDisasm(const RabbitizerInst return totalSize; } -size_t RabbitizerOperandType_disassemble(RabbitizerOperandType operand, const RabbitizerInstruction *instr, char *dst, const char *immOverride, size_t immOverrideLength) { +size_t RabbitizerOperandType_disassemble(RabbitizerOperandType operand, const RabbitizerInstruction *instr, char *dst, const char *immOverride, + size_t immOverrideLength) { OperandCallback callback; assert(operand > RAB_OPERAND_ALL_INVALID);