• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef PANDA_PLUGINS_ETS_RUNTIME_ANI_CHECKERS_H
17 #define PANDA_PLUGINS_ETS_RUNTIME_ANI_CHECKERS_H
18 // NOLINTBEGIN(cppcoreguidelines-macro-usage)
19 
20 // CC-OFFNXT(G.PRE.02) should be with define
21 #define ANI_DEBUG_TRACE(env)
22 
23 // CC-OFFNXT(G.PRE.02) should be with define
24 #define ANI_CHECK_RETURN_IF_EQ(a, b, ret) \
25     do {                                  \
26         if (UNLIKELY((a) == (b))) {       \
27             return ret;                   \
28         }                                 \
29     } while (false)
30 
31 // CC-OFFNXT(G.PRE.02) should be with define
32 #define ANI_CHECK_RETURN_IF_NE(a, b, ret) \
33     do {                                  \
34         if (UNLIKELY((a) != (b))) {       \
35             return ret;                   \
36         }                                 \
37     } while (false)
38 
39 // CC-OFFNXT(G.PRE.02) should be with define
40 #define ANI_CHECK_RETURN_IF_GT(a, b, ret) \
41     do {                                  \
42         if (UNLIKELY((a) > (b))) {        \
43             return ret;                   \
44         }                                 \
45     } while (false)
46 
47 // CC-OFFNXT(G.PRE.02) should be with define
48 #define ANI_CHECK_RETURN_IF_GE(a, b, ret) \
49     do {                                  \
50         if (UNLIKELY((a) >= (b))) {       \
51             return ret;                   \
52         }                                 \
53     } while (false)
54 
55 // CC-OFFNXT(G.PRE.02) should be with define
56 #define ANI_CHECK_RETURN_IF_LT(a, b, ret) \
57     do {                                  \
58         if (UNLIKELY((a) < (b))) {        \
59             return ret;                   \
60         }                                 \
61     } while (false)
62 
63 // CC-OFFNXT(G.PRE.02) should be with define
64 #define ANI_CHECK_RETURN_IF_LE(a, b, ret) \
65     do {                                  \
66         if (UNLIKELY((a) <= (b))) {       \
67             return ret;                   \
68         }                                 \
69     } while (false)
70 
71 // NOLINTEND(cppcoreguidelines-macro-usage)
72 #endif  // PANDA_PLUGINS_ETS_RUNTIME_ANI_CHECKERS_H
73