Skip to content

Commit

Permalink
Try to Fix MSVC Error
Browse files Browse the repository at this point in the history
It's complaining about the `memcpy`s, saying:

"warning C4090: 'function': different 'const' qualifiers"

Let's try explicitly casting to the argument types...
  • Loading branch information
felixhandte committed May 1, 2020
1 parent 52b9738 commit 56bcf6e
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,22 @@ static int basicUnitTests(U32 const seed, double compressibility)
const void *voidptr_copyDCtx;
const void *voidptr_nextInputType;
DEBUG_STATIC_ASSERT(sizeof(funcptr_getDictID) == sizeof(voidptr_getDictID));
memcpy(&voidptr_getDictID , &funcptr_getDictID , sizeof(void*));
memcpy(&voidptr_createDStream, &funcptr_createDStream, sizeof(void*));
memcpy(&voidptr_copyDCtx , &funcptr_copyDCtx , sizeof(void*));
memcpy(&voidptr_nextInputType, &funcptr_nextInputType, sizeof(void*));
memcpy(
(void*)&voidptr_getDictID,
(const void*)&funcptr_getDictID,
sizeof(void*));
memcpy(
(void*)&voidptr_createDStream,
(const void*)&funcptr_createDStream,
sizeof(void*));
memcpy(
(void*)&voidptr_copyDCtx,
(const void*)&funcptr_copyDCtx,
sizeof(void*));
memcpy(
(void*)&voidptr_nextInputType,
(const void*)&funcptr_nextInputType,
sizeof(void*));
DISPLAYLEVEL(3, "%p ", voidptr_getDictID);
DISPLAYLEVEL(3, "%p ", voidptr_createDStream);
DISPLAYLEVEL(3, "%p ", voidptr_copyDCtx);
Expand Down

0 comments on commit 56bcf6e

Please sign in to comment.