summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-09-13 20:58:28 -0400
committerJosh Ferrell <josh@vector35.com>2024-09-13 20:58:28 -0400
commitf068de0f2d2fec6ca6d039a9648316f35e6ad965 (patch)
treefffa286f3251cd4b18f7ae43615824871ad77776 /arch
parent590b594850ccd15b9e2cb2b0e8f3050d782647b3 (diff)
Fix many warnings
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/disassembler/format.c10
-rw-r--r--arch/mips/mips/mips.c5
-rw-r--r--arch/mips/mips/test.c3
-rw-r--r--arch/powerpc/arch_ppc.cpp6
4 files changed, 13 insertions, 11 deletions
diff --git a/arch/arm64/disassembler/format.c b/arch/arm64/disassembler/format.c
index 4867a7aa..b2b7a5a8 100644
--- a/arch/arm64/disassembler/format.c
+++ b/arch/arm64/disassembler/format.c
@@ -420,7 +420,7 @@ uint32_t get_sme_tile(const InstructionOperand *operand, char *outBuffer, uint32
if(operand->arrSpec == ARRSPEC_FULL)
snprintf(base_offset, sizeof(base_offset), "[%s]", get_register_name(operand->reg[0]));
else
- snprintf(base_offset, sizeof(base_offset), "[%s, #%llu]", get_register_name(operand->reg[0]), operand->immediate);
+ snprintf(base_offset, sizeof(base_offset), "[%s, #%" PRIu64 "]", get_register_name(operand->reg[0]), operand->immediate);
}
char *slice = "";
@@ -445,9 +445,9 @@ uint32_t get_indexed_element(const InstructionOperand *operand, char *outBuffer,
// make the "{, #<imm>}"
char optional_comma_and[32];
if(operand->immediate)
- if(snprintf(optional_comma_and, 32, ", #%llu", operand->immediate) >= 32)
+ if(snprintf(optional_comma_and, 32, ", #%" PRIu64 "", operand->immediate) >= 32)
return FAILED_TO_DISASSEMBLE_OPERAND;
-
+
// <Pn>.<T>[<Wm>{, #<imm>}]
if(snprintf(outBuffer, outBufferSize, "%s%s[%s%s]",
get_register_name(operand->reg[0]),
@@ -462,7 +462,7 @@ uint32_t get_indexed_element(const InstructionOperand *operand, char *outBuffer,
uint32_t get_accum_array(const InstructionOperand *operand, char *outBuffer, uint32_t outBufferSize)
{
- if(snprintf(outBuffer, outBufferSize, "ZA[%s, #%llu]",
+ if(snprintf(outBuffer, outBufferSize, "ZA[%s, #%" PRIu64 "]",
get_register_name(operand->reg[0]), operand->immediate
) >= outBufferSize)
return FAILED_TO_DISASSEMBLE_OPERAND;
@@ -580,7 +580,7 @@ int aarch64_disassemble(Instruction *instruction, char *buf, size_t buf_sz)
sizeof(tmpOperandString)) != DISASM_SUCCESS)
return FAILED_TO_DISASSEMBLE_OPERAND;
operand = tmpOperandString;
- break;
+ break;
case NAME:
operand = instruction->operands[i].name;
break;
diff --git a/arch/mips/mips/mips.c b/arch/mips/mips/mips.c
index 7ab64f24..32c58aa6 100644
--- a/arch/mips/mips/mips.c
+++ b/arch/mips/mips/mips.c
@@ -1,6 +1,7 @@
#define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>
+#include <inttypes.h>
#include "mips.h"
#ifdef __cplusplus
@@ -2389,7 +2390,7 @@ uint32_t mips_disassemble(
if (instruction->operands[i].immediate >= 0x80000000)
snprintf(operandPtr, 64, "-%#x", -(int32_t)instruction->operands[i].immediate);
else
- snprintf(operandPtr, 64, "%#llx", instruction->operands[i].immediate);
+ snprintf(operandPtr, 64, "%#" PRIx64 "", instruction->operands[i].immediate);
break;
case MEM_IMM:
if (instruction->operands[i].immediate != 0)
@@ -2402,7 +2403,7 @@ uint32_t mips_disassemble(
}
else
{
- snprintf(operandPtr, 64, "%#llx(%s)",
+ snprintf(operandPtr, 64, "%#" PRIx64 "(%s)",
instruction->operands[i].immediate,
RegisterStrings[instruction->operands[i].reg]);
}
diff --git a/arch/mips/mips/test.c b/arch/mips/mips/test.c
index fbe8335a..c2bf6333 100644
--- a/arch/mips/mips/test.c
+++ b/arch/mips/mips/test.c
@@ -7,6 +7,7 @@ b mips_disassemble
#include <stdio.h>
#include <stdint.h>
+#include <inttypes.h>
#include "mips.h"
@@ -75,6 +76,6 @@ int main(int ac, char **av)
}
if(0 == disassemble(insword, address, MIPS_32, instxt)) {
- printf("%08llX: %08X %s\n", address, insword, instxt);
+ printf("%08" PRIX64 ": %08X %s\n", address, insword, instxt);
}
}
diff --git a/arch/powerpc/arch_ppc.cpp b/arch/powerpc/arch_ppc.cpp
index 89cfa282..b9087aef 100644
--- a/arch/powerpc/arch_ppc.cpp
+++ b/arch/powerpc/arch_ppc.cpp
@@ -680,7 +680,7 @@ class PowerpcArchitecture: public Architecture
case PPC_INS_BCL:
case PPC_INS_BL:
case PPC_INS_BLA:
- snprintf(buf, sizeof(buf), "0x%llx", op->imm);
+ snprintf(buf, sizeof(buf), "0x%" PRIx64, op->imm);
result.emplace_back(CodeRelativeAddressToken, buf, (uint32_t) op->imm, 4);
break;
case PPC_INS_ADDIS:
@@ -693,9 +693,9 @@ class PowerpcArchitecture: public Architecture
break;
default:
if (op->imm < 0 && op->imm > -0x10000)
- snprintf(buf, sizeof(buf), "-0x%llx", -op->imm);
+ snprintf(buf, sizeof(buf), "-0x%" PRIx64, -op->imm);
else
- snprintf(buf, sizeof(buf), "0x%llx", op->imm);
+ snprintf(buf, sizeof(buf), "0x%" PRIx64, op->imm);
result.emplace_back(IntegerToken, buf, op->imm, 4);
}