From 95338c59bc1fc75b2711934db05116a2262ba21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Ho=CC=88ner?= Date: Tue, 24 Oct 2017 17:21:09 +0200 Subject: [PATCH] Added previously forgotten const qualifiers - Also, fixed integer comparision warning in `ZydisPerfTest` --- examples/ZydisPerfTest.c | 2 +- include/Zydis/Formatter.h | 4 ++-- src/Formatter.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) 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)) {