Added previously forgotten const qualifiers

- Also, fixed integer comparision warning in `ZydisPerfTest`
This commit is contained in:
Joel Höner 2017-10-24 17:21:09 +02:00
parent 4de4def535
commit 95338c59bc
3 changed files with 5 additions and 5 deletions

View File

@ -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]);

View File

@ -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);
/* ============================================================================================== */

View File

@ -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))
{