From f454a3d82dca058cc64e441fbaefa68a391e4757 Mon Sep 17 00:00:00 2001 From: temi54c1l8 <163388497+temi54c1l8@users.noreply.github.com> Date: Sat, 1 Mar 2025 16:54:38 +0100 Subject: [PATCH] change for static analysis for CO_RPDO_process function (#564) --- 301/CO_PDO.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/301/CO_PDO.c b/301/CO_PDO.c index 47c538d..527618b 100644 --- a/301/CO_PDO.c +++ b/301/CO_PDO.c @@ -807,10 +807,10 @@ CO_RPDO_process(CO_RPDO_t* RPDO, } #endif /* (CO_CONFIG_PDO) & CO_CONFIG_PDO_OD_IO_ACCESS */ - if (verifyLength > CO_PDO_MAX_SIZE || verifyLength != (OD_size_t)PDO->dataLength) { + if ((verifyLength > CO_PDO_MAX_SIZE) || (verifyLength != (OD_size_t)PDO->dataLength)) { /* bug in software, should not happen */ CO_errorReport(PDO->em, CO_EM_GENERIC_SOFTWARE_ERROR, CO_EMC_SOFTWARE_INTERNAL, - (0x100000 | verifyLength)); + (0x100000U | verifyLength)); } } /* while (CO_FLAG_READ(RPDO->CANrxNew[bufNo])) */ @@ -1212,9 +1212,9 @@ CO_TPDOsend(CO_TPDO_t* TPDO) { } #endif /* (CO_CONFIG_PDO) & CO_CONFIG_PDO_OD_IO_ACCESS */ - if (verifyLength > CO_PDO_MAX_SIZE || verifyLength != (OD_size_t)PDO->dataLength) { + if ((verifyLength > CO_PDO_MAX_SIZE) || (verifyLength != (OD_size_t)PDO->dataLength)) { /* bug in software, should not happen */ - CO_errorReport(PDO->em, CO_EM_GENERIC_SOFTWARE_ERROR, CO_EMC_SOFTWARE_INTERNAL, (0x200000 | verifyLength)); + CO_errorReport(PDO->em, CO_EM_GENERIC_SOFTWARE_ERROR, CO_EMC_SOFTWARE_INTERNAL, (0x200000U | verifyLength)); return CO_ERROR_DATA_CORRUPT; }