MdePkg: Update BASE_CR macro in Base.h for a Coverity error

Coverity is a static analysis tool. It detects the macro as an error
(case to incompatible type, cert_exp39_c_violation). The update resolves
the error and supports compliance with the static analysis tool.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
This commit is contained in:
Phil Noh 2024-12-20 13:56:11 -06:00 committed by Liming Gao
parent f6e19abd97
commit 7e03c40659
1 changed files with 1 additions and 1 deletions

View File

@ -888,7 +888,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof (__VERIFY_INT32_ENUM
@return A pointer to the structure from one of it's elements. @return A pointer to the structure from one of it's elements.
**/ **/
#define BASE_CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field))) #define BASE_CR(Record, TYPE, Field) ((TYPE *) (VOID *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field)))
/** /**
Checks whether a value is a power of two. Checks whether a value is a power of two.