Lines Matching refs:macro

35 Names include file, function, variable, type, and macro names.
62 | Variable, function parameter, macro parameter, struct body, union member| lowerCamelCase|
154 … parameters in the function declaration or definition as well as parameters in function-like macro.
248 …The enum is in the UpperCamelCase style whereas the enumerated values adopt the macro naming style.
274 Use uppercase letters separated by underscores (\_) for macro names and enumerated values.
285 2. A function-like macro that is used to replace a function in the earlier version can be named in …
299 #define Foo(a) Bar(a) // The function-like macro is named in the same way as a function.
347 **If possible, use a function instead of a function-like macro. Define a function-like macro only w…
349 When defining local variables for a function-like macro, use double underscores at the end to avoid…
864 - Do not put two or more consecutive blank lines inside a function, a type definition, a macro, or …
1146 …ly with the same name), which is used to store the function declarations, macro definitions, and t…
1573 …m a larger perspective. The inline function is similar to a function-like macro. For details, see …
1625 A function-like macro is a macro (as shown in the following example) similar to a function. It cont…
1639 Before defining a function-like macro, consider whether it can be replaced with a function. If yes,…
1641 The disadvantages of the function-like macro are as follows:
1644 - If macro parameters are not calculated during macro expansion, unexpected results may be generate…
1645 - A macro has no independent scope. When it is used together with control flow statements, unexpect…
1648 - After the macro is expanded during precompilation, it is invisible during subsequent compilation,…
1651 <a name="macro_lack_of_type_check__example"></a>Example code of a function-like macro lacking type …
1679 The function does not have the preceding macro disadvantages. However, compared with macros, the bi…
1682 The inline function is similar to the macro, as it is also expanded at the call point. The differen…
1692 For example, in a log scenario, using a function-like macro with variable parameters and default pa…
1699 ### <a name="r6-1"></a>Rule 6.1 Use complete parentheses for macro parameters when defining a macro.
1701macro parameter is replaced by text only when the macro is expanded. The value is calculated when …
1703 …ation may result in a different result than expected, especially when the macro parameter is in an…
1711 When the macro is used, the execution result is inconsistent with the expected result.
1725 To solve this problem, add parentheses to each macro parameter, as shown in the following:
1750 - Do not add parentheses to macro parameters when they are involved in the '#' or '##' operation.
1751 - Do not add parentheses to macro parameters when they are used for string concatenation.
1752 - If a macro parameter is used as a separate part in one side of an assignment expression (includin…
1753 - If a macro parameter is used as a separate part in comma expressions, functions or macro call lis…
1769macro is expanded at the call point, the expressions and variables defined in the macro are integr…
1780macro is called as shown in the following example code, the `for` loop only executes the first sta…
1820 - An exception can be made when the macro contains an incomplete statement. For example, use a macr…
1823 ### <a name="r6-3"></a>Rule 6.3 Do not pass expressions with side effects to a function-like macro.
1825 …text, if a function-like macro uses the same macro parameter multiple times and transfers expressi…
1827macro `SQUARE` is normal, but the `a++` expression with side effects is passed to the macro. As a …
1846 In addition, if the macro parameter contains a function call, the function may be called repeatedly…
1850 …e statements such as `return`, `goto`, `continue`, and `break` in a function-like macro definition.
1852 Although process changing statements, such as `return`, `goto`, `continue`, and `break`, in a macro
1854 First, the macro encapsulation of the `return` statement can easily lead to excessive encapsulation…
1855 …ing encapsulated in macros, the purpose is not intuitive. The `RETURN_IF` macro is ignored, causin…
1880 Second, if `return` is encapsulated in a macro, it may also cause a memory leak. Example:
1900macro is not good. The macro name only reflects the check action and does not specify the result. …
1902 …ocess changing statements, such as `return`, `goto`, `continue`, and `break`, in macro definitions.
1908 ### Rec 6.3 Include no more than 10 lines in a function-like macro (excluding blank lines and comme…
1910 A function-like macro is more difficult to debug and locate than a function, especially when the ma…
2058 For numbers that are used multiple times, macro or const variables must be defined and self-comment…