Skip to content

Commit

Permalink
Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanBertrand committed Dec 17, 2023
1 parent 6a57d4f commit da66ce1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Fw/Types/Assert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ namespace Fw {
s_assertHook = this->previousHook;
}

// Default handler of SwAssert functions
NATIVE_INT_TYPE defaultSwAssert(

Check notice

Code scanning / CodeQL

Use of basic integral type Note

defaultSwAssert uses the basic integral type int rather than a typedef with size and signedness.

Check notice

Code scanning / CodeQL

Function too long Note

defaultSwAssert has too many parameters (9, while 6 are allowed).
FILE_NAME_ARG file,

Check notice

Code scanning / CodeQL

Use of basic integral type Note

file uses the basic integral type char rather than a typedef with size and signedness.
NATIVE_UINT_TYPE lineNo,

Check notice

Code scanning / CodeQL

Use of basic integral type Note

lineNo uses the basic integral type unsigned int rather than a typedef with size and signedness.
Expand Down
4 changes: 4 additions & 0 deletions Fw/Types/Assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
#define FW_ASSERT(...)
#else // ASSERT is defined

// Return only the first argument passed to the macro.
#define FW_ASSERT_FIRST_ARG(ARG_0, ...) ARG_0

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro FW_ASSERT_FIRST_ARG(ARG_0,__VA_ARGS__...) is variadic, and hence not allowed.
// Return all the arguments of the macro, but the first one
#define FW_ASSERT_NO_FIRST_ARG(ARG_0, ...) __VA_ARGS__

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro FW_ASSERT_NO_FIRST_ARG(ARG_0,__VA_ARGS__...) is variadic, and hence not allowed.

// Passing the __LINE__ argument at the end of the function ensures that
// the FW_ASSERT_NO_FIRST_ARG macro will never have an empty variadic variable
#if FW_ASSERT_LEVEL == FW_FILEID_ASSERT
#define FILE_NAME_ARG U32
#define FW_ASSERT(...) \
Expand Down

0 comments on commit da66ce1

Please sign in to comment.