diff --git a/source/os/src/osSocket.c b/source/os/src/osSocket.c index a4264a7e88456b7cdcaa93dac85132bedd6a2d6b..679fd8a8b6431b5368642920ffc07c8590794d0d 100644 --- a/source/os/src/osSocket.c +++ b/source/os/src/osSocket.c @@ -1107,10 +1107,10 @@ void taosWinSocketInit() { uint64_t taosHton64(uint64_t val) { #if defined(WINDOWS) || defined(DARWIN) - ((val & 0x00000000000000ff) << 7 * 8) | ((val & 0x000000000000ff00) << 5 * 8) | - ((val & 0x0000000000ff0000) << 3 * 8) | ((val & 0x00000000ff000000) << 1 * 8) | - ((val & 0x000000ff00000000) >> 1 * 8) | ((val & 0x0000ff0000000000) >> 3 * 8) | - ((val & 0x00ff000000000000) >> 5 * 8) | ((val & 0xff00000000000000) >> 7 * 8) + return ((val & 0x00000000000000ff) << 7 * 8) | ((val & 0x000000000000ff00) << 5 * 8) | + ((val & 0x0000000000ff0000) << 3 * 8) | ((val & 0x00000000ff000000) << 1 * 8) | + ((val & 0x000000ff00000000) >> 1 * 8) | ((val & 0x0000ff0000000000) >> 3 * 8) | + ((val & 0x00ff000000000000) >> 5 * 8) | ((val & 0xff00000000000000) >> 7 * 8); #else if (__BYTE_ORDER == __LITTLE_ENDIAN) { return (((uint64_t)htonl((int)((val << 32) >> 32))) << 32) | (unsigned int)htonl((int)(val >> 32));