From 2487a9ce847fe9576c39bc1c9df0585b15bb1a90 Mon Sep 17 00:00:00 2001 From: wpan Date: Thu, 16 Sep 2021 14:51:07 +0800 Subject: [PATCH] fix windows compile error --- src/query/src/tdigest.c | 2 +- src/query/tests/apercentileTest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/query/src/tdigest.c b/src/query/src/tdigest.c index 93149bd0d6..4cc7f5b647 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 ab03f2e390..65bbbe85b0 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); } -- GitLab