Skip to content

Commit 90de336

Browse files
committed
Fixed build for ARM processors
1 parent 02815a7 commit 90de336

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/crypt/sha256.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ void XSHA256_Update(xsha256_t *pSha, const uint8_t *pData, size_t nLength)
8686

8787
void XSHA256_Final(xsha256_t *pSha, uint8_t *pDigest)
8888
{
89-
size_t nPaddingSize = (pSha->nSize < 56) ? (56 - pSha->nSize) : (120 - pSha->nSize);
90-
size_t i, nTotalSize = pSha->nTotalSize * 8;
89+
size_t i, nPaddingSize = (pSha->nSize < 56) ? (56 - pSha->nSize) : (120 - pSha->nSize);
90+
uint64_t nTotalBits = (uint64_t)pSha->nTotalSize * 8;
9191

9292
XSHA256_Update(pSha, XSHA256P, nPaddingSize);
93-
pSha->uBlock.wBytes[14] = htobe32((uint32_t) (nTotalSize >> 32));
94-
pSha->uBlock.wBytes[15] = htobe32((uint32_t) nTotalSize);
93+
pSha->uBlock.wBytes[14] = htobe32((uint32_t) (nTotalBits >> 32));
94+
pSha->uBlock.wBytes[15] = htobe32((uint32_t) nTotalBits);
9595
XSHA256_ProcessBlock(pSha);
9696

9797
for (i = 0; i < 8; i++) pSha->uDigest.hBytes[i] = htobe32(pSha->uDigest.hBytes[i]);

src/data/json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static int XJSON_GetNextToken(xjson_t *pJson)
216216
pToken->pData = &pJson->pData[pJson->nOffset-1];
217217
pToken->nLength = 1;
218218

219-
switch (nChar)
219+
switch ((int)nChar)
220220
{
221221
case '\0': case EOF:
222222
pToken->nType = XJSON_TOKEN_EOF;

src/xver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#define XUTILS_VERSION_MAX 2
1414
#define XUTILS_VERSION_MIN 7
15-
#define XUTILS_BUILD_NUMBER 6
15+
#define XUTILS_BUILD_NUMBER 7
1616
#define XUTILS_BUILD_DATE "05Oct2025"
1717

1818
#ifdef __cplusplus

tools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
####################################
55

66
CFLAGS = -g -O2 -Wall
7-
LIBS = -lpthread
7+
LIBS = -lpthread -lm
88
LD_LIBS = ../build/libxutils.a
99

1010
ifeq ($(XUTILS_USE_SSL),y)

0 commit comments

Comments
 (0)