Remove MEM_STATIC_ASSERT and use DEBUG_STATIC_ASSERT instead
This commit is contained in:
@@ -203,7 +203,7 @@ MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC,
|
|||||||
MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC,
|
MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC,
|
||||||
size_t value, unsigned nbBits)
|
size_t value, unsigned nbBits)
|
||||||
{
|
{
|
||||||
MEM_STATIC_ASSERT(BIT_MASK_SIZE == 32);
|
DEBUG_STATIC_ASSERT(BIT_MASK_SIZE == 32);
|
||||||
assert(nbBits < BIT_MASK_SIZE);
|
assert(nbBits < BIT_MASK_SIZE);
|
||||||
assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8);
|
assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8);
|
||||||
bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
|
bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
|
||||||
|
|||||||
+2
-2
@@ -18,6 +18,7 @@ extern "C" {
|
|||||||
/*-****************************************
|
/*-****************************************
|
||||||
* Dependencies
|
* Dependencies
|
||||||
******************************************/
|
******************************************/
|
||||||
|
#include "debug.h" /* DEBUG_STATIC_ASSERT */
|
||||||
#include "zstd_deps.h" /* size_t, ptrdiff_t, ZSTD_memcpy */
|
#include "zstd_deps.h" /* size_t, ptrdiff_t, ZSTD_memcpy */
|
||||||
|
|
||||||
|
|
||||||
@@ -43,8 +44,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* code only tested on 32 and 64 bits systems */
|
/* code only tested on 32 and 64 bits systems */
|
||||||
#define MEM_STATIC_ASSERT(c) { enum { MEM_static_assert = 1/(int)(!!(c)) }; }
|
MEM_STATIC void MEM_check(void) { DEBUG_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }
|
||||||
MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }
|
|
||||||
|
|
||||||
/* detects whether we are being compiled under msan */
|
/* detects whether we are being compiled under msan */
|
||||||
#if defined (__has_feature)
|
#if defined (__has_feature)
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ static void ZWRAP_initDCtx(ZWRAP_DCtx* zwd)
|
|||||||
static ZWRAP_DCtx* ZWRAP_createDCtx(z_streamp strm)
|
static ZWRAP_DCtx* ZWRAP_createDCtx(z_streamp strm)
|
||||||
{
|
{
|
||||||
ZWRAP_DCtx* zwd;
|
ZWRAP_DCtx* zwd;
|
||||||
MEM_STATIC_ASSERT(sizeof(zwd->headerBuf) >= ZSTD_HEADERSIZE); /* check static buffer size condition */
|
DEBUG_STATIC_ASSERT(sizeof(zwd->headerBuf) >= ZSTD_HEADERSIZE); /* check static buffer size condition */
|
||||||
|
|
||||||
if (strm->zalloc && strm->zfree) {
|
if (strm->zalloc && strm->zfree) {
|
||||||
zwd = (ZWRAP_DCtx*)strm->zalloc(strm->opaque, 1, sizeof(ZWRAP_DCtx));
|
zwd = (ZWRAP_DCtx*)strm->zalloc(strm->opaque, 1, sizeof(ZWRAP_DCtx));
|
||||||
|
|||||||
Reference in New Issue
Block a user