Rename static vars to avoid redefinition error.
parent
7afd5d85d3
commit
c6548eac8e
|
@ -301,7 +301,7 @@ int POOL_tryAdd(POOL_ctx* ctx, POOL_function function, void* opaque)
|
||||||
struct POOL_ctx_s {
|
struct POOL_ctx_s {
|
||||||
int dummy;
|
int dummy;
|
||||||
};
|
};
|
||||||
static POOL_ctx g_ctx;
|
static POOL_ctx g_poolCtx;
|
||||||
|
|
||||||
POOL_ctx* POOL_create(size_t numThreads, size_t queueSize) {
|
POOL_ctx* POOL_create(size_t numThreads, size_t queueSize) {
|
||||||
return POOL_create_advanced(numThreads, queueSize, ZSTD_defaultCMem);
|
return POOL_create_advanced(numThreads, queueSize, ZSTD_defaultCMem);
|
||||||
|
@ -311,11 +311,11 @@ POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize, ZSTD_customM
|
||||||
(void)numThreads;
|
(void)numThreads;
|
||||||
(void)queueSize;
|
(void)queueSize;
|
||||||
(void)customMem;
|
(void)customMem;
|
||||||
return &g_ctx;
|
return &g_poolCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void POOL_free(POOL_ctx* ctx) {
|
void POOL_free(POOL_ctx* ctx) {
|
||||||
assert(!ctx || ctx == &g_ctx);
|
assert(!ctx || ctx == &g_poolCtx);
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ int POOL_tryAdd(POOL_ctx* ctx, POOL_function function, void* opaque) {
|
||||||
|
|
||||||
size_t POOL_sizeof(POOL_ctx* ctx) {
|
size_t POOL_sizeof(POOL_ctx* ctx) {
|
||||||
if (ctx==NULL) return 0; /* supports sizeof NULL */
|
if (ctx==NULL) return 0; /* supports sizeof NULL */
|
||||||
assert(ctx == &g_ctx);
|
assert(ctx == &g_poolCtx);
|
||||||
return sizeof(*ctx);
|
return sizeof(*ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,7 @@ typedef struct {
|
||||||
} COVER_ctx_t;
|
} COVER_ctx_t;
|
||||||
|
|
||||||
/* We need a global context for qsort... */
|
/* We need a global context for qsort... */
|
||||||
static COVER_ctx_t *g_ctx = NULL;
|
static COVER_ctx_t *g_coverCtx = NULL;
|
||||||
|
|
||||||
/*-*************************************
|
/*-*************************************
|
||||||
* Helper functions
|
* Helper functions
|
||||||
|
@ -267,11 +267,11 @@ static int COVER_cmp8(COVER_ctx_t *ctx, const void *lp, const void *rp) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as COVER_cmp() except ties are broken by pointer value
|
* Same as COVER_cmp() except ties are broken by pointer value
|
||||||
* NOTE: g_ctx must be set to call this function. A global is required because
|
* NOTE: g_coverCtx must be set to call this function. A global is required because
|
||||||
* qsort doesn't take an opaque pointer.
|
* qsort doesn't take an opaque pointer.
|
||||||
*/
|
*/
|
||||||
static int WIN_CDECL COVER_strict_cmp(const void *lp, const void *rp) {
|
static int WIN_CDECL COVER_strict_cmp(const void *lp, const void *rp) {
|
||||||
int result = COVER_cmp(g_ctx, lp, rp);
|
int result = COVER_cmp(g_coverCtx, lp, rp);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
result = lp < rp ? -1 : 1;
|
result = lp < rp ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ static int WIN_CDECL COVER_strict_cmp(const void *lp, const void *rp) {
|
||||||
* Faster version for d <= 8.
|
* Faster version for d <= 8.
|
||||||
*/
|
*/
|
||||||
static int WIN_CDECL COVER_strict_cmp8(const void *lp, const void *rp) {
|
static int WIN_CDECL COVER_strict_cmp8(const void *lp, const void *rp) {
|
||||||
int result = COVER_cmp8(g_ctx, lp, rp);
|
int result = COVER_cmp8(g_coverCtx, lp, rp);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
result = lp < rp ? -1 : 1;
|
result = lp < rp ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
@ -612,7 +612,7 @@ static size_t COVER_ctx_init(COVER_ctx_t *ctx, const void *samplesBuffer,
|
||||||
/* qsort doesn't take an opaque pointer, so pass as a global.
|
/* qsort doesn't take an opaque pointer, so pass as a global.
|
||||||
* On OpenBSD qsort() is not guaranteed to be stable, their mergesort() is.
|
* On OpenBSD qsort() is not guaranteed to be stable, their mergesort() is.
|
||||||
*/
|
*/
|
||||||
g_ctx = ctx;
|
g_coverCtx = ctx;
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
mergesort(ctx->suffix, ctx->suffixSize, sizeof(U32),
|
mergesort(ctx->suffix, ctx->suffixSize, sizeof(U32),
|
||||||
(ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp));
|
(ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp));
|
||||||
|
|
Loading…
Reference in New Issue