diff --git a/src/util/src/tcrc32c.c b/src/util/src/tcrc32c.c index 3ef10b1b0dd91c52b235bcd55e388cf0b4bc434e..502116f9c27be1900f1c02d4bc9f2281fd9235af 100644 --- a/src/util/src/tcrc32c.c +++ b/src/util/src/tcrc32c.c @@ -1353,12 +1353,12 @@ uint32_t crc32c_hw(uint32_t crc, crc_stream buf, size_t len) { #endif // #ifndef _TD_ARM_ void taosResolveCRC() { -#ifndef _TD_ARM_ +#if defined _TD_ARM_ || defined WINDOWS + crc32c = crc32c_sf; +#else int sse42; SSE42(sse42); crc32c = sse42 ? crc32c_hw : crc32c_sf; -#else - crc32c = crc32c_sf; #endif /* return sse42 ? crc32c_hw(crci, bytes, len) : crc32c_sf(crci, bytes, len); */ diff --git a/src/util/src/tkvstore.c b/src/util/src/tkvstore.c index 1000b96a31c91ca90e7c1267c060c8f728982d56..bd0d71f9636ffeb65e8927b9944a31ff66276dd0 100644 --- a/src/util/src/tkvstore.c +++ b/src/util/src/tkvstore.c @@ -522,7 +522,7 @@ static int tdRestoreKVStore(SKVStore *pStore) { maxBufSize = MAX(maxBufSize, rInfo.size); - if (lseek(pStore->fd, rInfo.size, SEEK_CUR) < 0) { + if (lseek(pStore->fd, (off_t)rInfo.size, SEEK_CUR) < 0) { uError("failed to lseek file %s since %s", pStore->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); goto _err; @@ -550,7 +550,7 @@ static int tdRestoreKVStore(SKVStore *pStore) { while (taosHashIterNext(pIter)) { SKVRecord *pRecord = taosHashIterGet(pIter); - if (lseek(pStore->fd, pRecord->offset + sizeof(SKVRecord), SEEK_SET) < 0) { + if (lseek(pStore->fd, (off_t)(pRecord->offset + sizeof(SKVRecord)), SEEK_SET) < 0) { uError("failed to lseek file %s since %s, offset %" PRId64, pStore->fname, strerror(errno), pRecord->offset); terrno = TAOS_SYSTEM_ERROR(errno); goto _err; diff --git a/src/util/src/tmempool.c b/src/util/src/tmempool.c index 4a899ebb48271abb4e9894610cee0508bccde68c..a3d10355003c85d993b3a37190081436c0fb19ab 100644 --- a/src/util/src/tmempool.c +++ b/src/util/src/tmempool.c @@ -13,11 +13,7 @@ * along with this program. If not, see . */ -#include -#include -#include -#include - +#include "os.h" #include "tulog.h" #include "tmempool.h" #include "tutil.h"