From ebae33cec02c36e91f335132f4c7bbbab61e157d Mon Sep 17 00:00:00 2001 From: Ake Hedman Date: Tue, 25 Jun 2024 22:22:19 +0200 Subject: [PATCH] Fixed construct_unsigned32 and construct_signed32 macros --- src/vscp/common/vscp-bootdevice-vscp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vscp/common/vscp-bootdevice-vscp.h b/src/vscp/common/vscp-bootdevice-vscp.h index 51fa6d862..5665039bc 100644 --- a/src/vscp/common/vscp-bootdevice-vscp.h +++ b/src/vscp/common/vscp-bootdevice-vscp.h @@ -41,11 +41,11 @@ // This macro construct a signed long from four unsigned chars in a safe way #define construct_signed32(b0, b1, b2, b3) \ - ((int32_t) ((((uint32_t) b0) << 24) + (((uint32_t) b0) << 16) + (((uint32_t) b0) << 8) + (uint32_t) b0)) + ((int32_t) ((((uint32_t) b0) << 24) + (((uint32_t) b1) << 16) + (((uint32_t) b2) << 8) + (uint32_t) b3)) // This macro construct a unsigned long from four unsigned chars in a safe way #define construct_unsigned32(b0, b1, b2, b3) \ - ((uint32_t) ((((uint32_t) b0) << 24) + (((uint32_t) b0) << 16) + (((uint32_t) b0) << 8) + (uint32_t) b0)) + ((uint32_t) ((((uint32_t) b0) << 24) + (((uint32_t) b1) << 16) + (((uint32_t) b1) << 8) + (uint32_t) b3)) class CBootDevice_VSCP : public CBootDevice { public: