From 9ef9209a5c9de41824d2cce1b6dfcb1abc0f1a11 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 20 Jun 2022 18:00:56 +0800 Subject: [PATCH] tdb: fix windows compiling issues --- source/libs/tdb/src/db/tdbBtree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index bac3554345..45e71f6c0d 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -933,7 +933,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const } // local buffer for cell - void *pBuf = tdbRealloc(NULL, pBt->pageSize); + SCell *pBuf = tdbRealloc(NULL, pBt->pageSize); if (pBuf == NULL) { return -1; } @@ -976,7 +976,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const pgno = 0; } - memcpy(pBuf, pVal + vLen - nLeft, bytes); + memcpy(pBuf, ((SCell *)pVal) + vLen - nLeft, bytes); memcpy(pBuf + bytes, &pgno, sizeof(pgno)); ret = tdbPageInsertCell(ofp, 0, pBuf, bytes + sizeof(pgno), 0); @@ -1011,7 +1011,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const } // cpy key - memcpy(pBuf, pKey + kLen - nLeftKey, bytes); + memcpy(pBuf, ((SCell *)pKey) + kLen - nLeftKey, bytes); if (lastKeyPage) { if (lastKeyPageSpace >= vLen) { @@ -1071,7 +1071,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const pgno = 0; } - memcpy(pBuf, pVal + vLen - nLeft, bytes); + memcpy(pBuf, ((SCell *)pVal) + vLen - nLeft, bytes); memcpy(pBuf + bytes, &pgno, sizeof(pgno)); ret = tdbPageInsertCell(ofp, 0, pBuf, bytes + sizeof(pgno), 0);