diff --git a/examples/ZydisPerfTest.c b/examples/ZydisPerfTest.c index 5344fd6..5783e89 100644 --- a/examples/ZydisPerfTest.c +++ b/examples/ZydisPerfTest.c @@ -393,7 +393,7 @@ int main(int argc, char** argv) } rewind(file); - if (fread(buffer, 1, length, file) != length) + if (fread(buffer, 1, length, file) != (size_t)length) { fprintf(stderr, "Could not read %" PRIu64 " bytes from file \"%s\"", (uint64_t)length, &buf[0]); diff --git a/include/Zydis/Formatter.h b/include/Zydis/Formatter.h index 9593b4a..92fea83 100644 --- a/include/Zydis/Formatter.h +++ b/include/Zydis/Formatter.h @@ -536,7 +536,7 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter, * @return A zydis status code. */ ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter, - ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen); + const ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen); /** * @brief Formats the given instruction and writes it into the output buffer. @@ -551,7 +551,7 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* f * @return A zydis status code. */ ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter, - ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen, void* userData); + const ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen, void* userData); /* ============================================================================================== */ diff --git a/src/Formatter.c b/src/Formatter.c index 3368b05..ed4607d 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -1074,13 +1074,13 @@ ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter, ZydisFormatterHookT } ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter, - ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen) + const ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen) { return ZydisFormatterFormatInstructionEx(formatter, instruction, buffer, bufferLen, NULL); } ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter, - ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen, void* userData) + const ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen, void* userData) { if (!formatter || !instruction || !buffer || (bufferLen == 0)) {