mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-06-14 04:16:15 -07:00
Redefine CR macro to address Klocwork scanning issue
Klocwork has issue to handle the CR macro in SBL code and it reported false positives such as unused variables, uninitialized variables, etc. This patch added special handling to resolve the issues reported by Klocwork scanning. Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
@@ -571,14 +571,18 @@ DebugPrintLevelEnabled (
|
||||
@param TestSignature The 32-bit signature value to match.
|
||||
|
||||
**/
|
||||
#if !defined(MDEPKG_NDEBUG)
|
||||
#define CR(Record, TYPE, Field, TestSignature) \
|
||||
(DebugAssertEnabled () && (BASE_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \
|
||||
(TYPE *) (_ASSERT (CR has Bad Signature), Record) : \
|
||||
BASE_CR (Record, TYPE, Field)
|
||||
#ifdef __KLOCWORK__
|
||||
#define CR(Record, TYPE, Field, TestSignature) BASE_CR(Record, TYPE, Field)
|
||||
#else
|
||||
#define CR(Record, TYPE, Field, TestSignature) \
|
||||
BASE_CR (Record, TYPE, Field)
|
||||
#if !defined(MDEPKG_NDEBUG)
|
||||
#define CR(Record, TYPE, Field, TestSignature) \
|
||||
(DebugAssertEnabled () && (BASE_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \
|
||||
(TYPE *) (_ASSERT (CR has Bad Signature), Record) : \
|
||||
BASE_CR(Record, TYPE, Field)
|
||||
#else
|
||||
#define CR(Record, TYPE, Field, TestSignature) \
|
||||
BASE_CR(Record, TYPE, Field)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user