From 7d53c7c7bea489152e1c13afdc624d524b3cc5ff Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Thu, 15 Dec 2022 12:58:44 +0000 Subject: [PATCH] Refs #1642. Added typecasts that are needed for 8- and 16-bit microcontrollers. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@1008 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- Target/Source/xcp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Target/Source/xcp.c b/Target/Source/xcp.c index fd2d5bd6..e17c9b75 100644 --- a/Target/Source/xcp.c +++ b/Target/Source/xcp.c @@ -470,15 +470,15 @@ static blt_int32u XcpGetOrderedLong(blt_int8u const * data) blt_int32u result = 0; #if (BOOT_CPU_BYTE_ORDER_MOTOROLA == 0) - result |= (blt_int32u) data[0]; - result |= (blt_int32u)(data[1] << 8); - result |= (blt_int32u)(data[2] << 16); - result |= (blt_int32u)(data[3] << 24); + result |= (blt_int32u)data[0]; + result |= (blt_int32u)((blt_int32u)data[1] << 8); + result |= (blt_int32u)((blt_int32u)data[2] << 16); + result |= (blt_int32u)((blt_int32u)data[3] << 24); #else - result |= (blt_int32u) data[3]; - result |= (blt_int32u)(data[2] << 8); - result |= (blt_int32u)(data[1] << 16); - result |= (blt_int32u)(data[0] << 24); + result |= (blt_int32u)data[3]; + result |= (blt_int32u)((blt_int32u)data[2] << 8); + result |= (blt_int32u)((blt_int32u)data[1] << 16); + result |= (blt_int32u)((blt_int32u)data[0] << 24); #endif /* Give the result back to the caller. */ return result;