1
0
Fork 0

static analisys: cannot assign 'unsigned32' to narrower essential type 'unsigned8' [MISRA 2012 Rule 10.3, required]

This commit is contained in:
temi54c1l8 2024-06-12 09:43:41 +02:00
parent fbe4d307d9
commit e720f497d1

View file

@ -757,15 +757,15 @@ static inline uint32_t CO_getUint32(const void *buf) {
* @return number of bytes written.
*/
static inline uint8_t CO_setUint8(void *buf, uint8_t value) {
(void)memmove(buf, (const void *)&value, sizeof(value)); return sizeof(value);
(void)memmove(buf, (const void *)&value, sizeof(value)); return (uint8_t)(sizeof(value));
}
/** Write uint16_t value into memory buffer, see @ref CO_setUint8 */
static inline uint8_t CO_setUint16(void *buf, uint16_t value) {
(void)memmove(buf, (const void *)&value, sizeof(value)); return sizeof(value);
(void)memmove(buf, (const void *)&value, sizeof(value)); return (uint8_t)(sizeof(value));
}
/** Write uint32_t value into memory buffer, see @ref CO_setUint8 */
static inline uint8_t CO_setUint32(void *buf, uint32_t value) {
(void)memmove(buf, (const void *)&value, sizeof(value)); return sizeof(value);
(void)memmove(buf, (const void *)&value, sizeof(value)); return (uint8_t)(sizeof(value));
}
/** @} */ /* CO_driver */