**********************************************************/
typedef struct
{
- const char* srcPtr;
+ char* srcPtr;
size_t srcSize;
char* cPtr;
size_t cRoom;
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define MAX(a,b) ((a)>(b) ? (a) : (b))
-static int BMK_benchMem(const void* srcBuffer, size_t srcSize,
+static int BMK_benchMem(void* srcBuffer, size_t srcSize,
const char* displayName, int cLevel,
const size_t* fileSizes, U32 nbFiles,
const void* dictBuffer, size_t dictBufferSize, BMK_compressor compressor)
UTIL_initTimer(&ticksPerSecond);
/* Init blockTable data */
- { const char* srcPtr = (const char*)srcBuffer;
+ { char* srcPtr = (char*)srcBuffer;
char* cPtr = (char*)compressedBuffer;
char* resPtr = (char*)resultBuffer;
U32 fileNb;
if (ret != Z_OK) EXM_THROW(1, "deflateSetDictionary failure");
if (ZWRAP_isUsingZSTDcompression()) useSetDict = 0; /* zstd doesn't require deflateSetDictionary after ZWRAP_deflateReset_keepDict */
}
- def.next_in = (const void*) blockTable[blockNb].srcPtr;
+ def.next_in = (void*) blockTable[blockNb].srcPtr;
def.avail_in = blockTable[blockNb].srcSize;
def.total_in = 0;
def.next_out = (void*) blockTable[blockNb].cPtr;
ret = deflateSetDictionary(&def, dictBuffer, dictBufferSize);
if (ret != Z_OK) EXM_THROW(1, "deflateSetDictionary failure");
}
- def.next_in = (const void*) blockTable[blockNb].srcPtr;
+ def.next_in = (void*) blockTable[blockNb].srcPtr;
def.avail_in = blockTable[blockNb].srcSize;
def.total_in = 0;
def.next_out = (void*) blockTable[blockNb].cPtr;
else
ret = inflateReset(&inf);
if (ret != Z_OK) EXM_THROW(1, "inflateReset failure");
- inf.next_in = (const void*) blockTable[blockNb].cPtr;
+ inf.next_in = (void*) blockTable[blockNb].cPtr;
inf.avail_in = blockTable[blockNb].cSize;
inf.total_in = 0;
inf.next_out = (void*) blockTable[blockNb].resPtr;
inf.opaque = Z_NULL;
ret = inflateInit(&inf);
if (ret != Z_OK) EXM_THROW(1, "inflateInit failure");
- inf.next_in = (const void*) blockTable[blockNb].cPtr;
+ inf.next_in = (void*) blockTable[blockNb].cPtr;
inf.avail_in = blockTable[blockNb].cSize;
inf.total_in = 0;
inf.next_out = (void*) blockTable[blockNb].resPtr;
ZSTD_outBuffer outBuffer;
ZWRAP_state_t comprState;
unsigned long long pledgedSrcSize;
-} ZWRAP_CCtx;
+} ZWRAP_CCtx __attribute__ ((aligned (4)));
size_t ZWRAP_freeCCtx(ZWRAP_CCtx* zwc)
int windowBits;
ZSTD_customMem customMem;
z_stream allocFunc; /* copy of zalloc, zfree, opaque */
-} ZWRAP_DCtx;
+} ZWRAP_DCtx __attribute__ ((aligned (4)));
int ZWRAP_isUsingZSTDdecompression(z_streamp strm)