diff --git a/src/query/src/tdigest.c b/src/query/src/tdigest.c index 93149bd0d6d4a3d0b417ab8308a64857cfbd02af..4cc7f5b6478bc25868267ea6c392b0fe74fe9202 100644 --- a/src/query/src/tdigest.c +++ b/src/query/src/tdigest.c @@ -51,7 +51,7 @@ void tdigestCopy(TDigest* dst, TDigest* src) { } TDigest *tdigestNewFrom(void* pBuf, int32_t compression) { - memset(pBuf, 0, TDIGEST_SIZE(compression)); + memset(pBuf, 0, (size_t)TDIGEST_SIZE(compression)); TDigest* t = (TDigest*)pBuf; t->centroids = (SCentroid*)calloc((int32_t)GET_CENTROID(compression), sizeof(SCentroid)); diff --git a/src/query/tests/apercentileTest.cpp b/src/query/tests/apercentileTest.cpp index ab03f2e390315367f97c5f11ae50b6d290bb080c..65bbbe85b0c9d65cbea33baa90d608bed63a3ae6 100644 --- a/src/query/tests/apercentileTest.cpp +++ b/src/query/tests/apercentileTest.cpp @@ -36,7 +36,7 @@ enum { void tdigest_init(TDigest **pTDigest) { - void *tmp = calloc(1, (int16_t)(TDIGEST_SIZE(COMPRESSION))); + void *tmp = calloc(1, (size_t)(TDIGEST_SIZE(COMPRESSION))); *pTDigest = tdigestNewFrom(tmp, COMPRESSION); }