From 682f6e5c35a063e13bb0ab92b941e14d18f5cb7c Mon Sep 17 00:00:00 2001 From: tickduan <417921451@qq.com> Date: Thu, 8 Jul 2021 15:21:55 +0800 Subject: [PATCH] #ifdef _TD_ARM32 replae sizeof(long)==8 --- deps/SZ/sz/src/ByteToolkit.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/deps/SZ/sz/src/ByteToolkit.c b/deps/SZ/sz/src/ByteToolkit.c index 7d982e07bc..519f4a4424 100644 --- a/deps/SZ/sz/src/ByteToolkit.c +++ b/deps/SZ/sz/src/ByteToolkit.c @@ -97,18 +97,15 @@ inline long bytesToLong_bigEndian(unsigned char* b) { inline void longToBytes_bigEndian(unsigned char *b, unsigned long num) { - // x64 - if(sizeof(unsigned long) == 8) - { - b[0] = (unsigned char)(num>>56); - b[1] = (unsigned char)(num>>48); - b[2] = (unsigned char)(num>>40); - b[3] = (unsigned char)(num>>32); - } - else // arm 32 or x86 32 - { - memset(b, 0, 4); - } + // arm32 +#ifdef _TD_ARM_32 + memset(b, 0, 4); +#else // x64 arm64 + b[0] = (unsigned char)(num>>56); + b[1] = (unsigned char)(num>>48); + b[2] = (unsigned char)(num>>40); + b[3] = (unsigned char)(num>>32); +#endif b[4] = (unsigned char)(num>>24); b[5] = (unsigned char)(num>>16); -- GitLab