Browse Source

Fix util.h Check clang-format

tags/v1.2.0
zhangxiaokun 3 years ago
parent
commit
cd16a4215d
3 changed files with 60 additions and 60 deletions
  1. +3
    -3
      ge/graph/load/model_manager/task_info/label_goto_ex_task_info.h
  2. +3
    -3
      ge/graph/load/model_manager/task_info/label_set_task_info.h
  3. +54
    -54
      inc/framework/common/util.h

+ 3
- 3
ge/graph/load/model_manager/task_info/label_goto_ex_task_info.h View File

@@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef GE_GRAPH_LOAD_NEW_MODEL_MANAGER_TASK_INFO_LABEL_GOTO_EX_TASK_INFO_H_
#define GE_GRAPH_LOAD_NEW_MODEL_MANAGER_TASK_INFO_LABEL_GOTO_EX_TASK_INFO_H_
#ifndef GE_GRAPH_LOAD_MODEL_MANAGER_TASK_INFO_LABEL_GOTO_EX_TASK_INFO_H_
#define GE_GRAPH_LOAD_MODEL_MANAGER_TASK_INFO_LABEL_GOTO_EX_TASK_INFO_H_

#include "graph/load/model_manager/task_info/task_info.h"

@@ -36,4 +36,4 @@ class LabelGotoExTaskInfo : public TaskInfo {
uint32_t args_size_{0}; // label info length.
};
} // namespace ge
#endif // GE_GRAPH_LOAD_NEW_MODEL_MANAGER_TASK_INFO_LABEL_GOTO_EX_TASK_INFO_H_
#endif // GE_GRAPH_LOAD_MODEL_MANAGER_TASK_INFO_LABEL_GOTO_EX_TASK_INFO_H_

+ 3
- 3
ge/graph/load/model_manager/task_info/label_set_task_info.h View File

@@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef GE_GRAPH_LOAD_NEW_MODEL_MANAGER_TASK_INFO_LABEL_SET_TASK_INFO_H_
#define GE_GRAPH_LOAD_NEW_MODEL_MANAGER_TASK_INFO_LABEL_SET_TASK_INFO_H_
#ifndef GE_GRAPH_LOAD_MODEL_MANAGER_TASK_INFO_LABEL_SET_TASK_INFO_H_
#define GE_GRAPH_LOAD_MODEL_MANAGER_TASK_INFO_LABEL_SET_TASK_INFO_H_

#include "graph/load/model_manager/task_info/task_info.h"

@@ -34,4 +34,4 @@ class LabelSetTaskInfo : public TaskInfo {
void *label_;
};
} // namespace ge
#endif // GE_GRAPH_LOAD_NEW_MODEL_MANAGER_TASK_INFO_LABEL_SET_TASK_INFO_H_
#endif // GE_GRAPH_LOAD_MODEL_MANAGER_TASK_INFO_LABEL_SET_TASK_INFO_H_

+ 54
- 54
inc/framework/common/util.h View File

@@ -30,12 +30,12 @@
#include "framework/common/ge_inner_error_codes.h"
#include "mmpa/mmpa_api.h"

#define GE_CHECK_POSITIVE_SIZE_RANGE(size) \
do { \
if (size <= 0) { \
DOMI_LOGE("param[%s] is not a positive number", #size); \
return PARAM_INVALID; \
} \
#define GE_CHECK_POSITIVE_SIZE_RANGE(size) \
do { \
if (size <= 0) { \
DOMI_LOGE("param[%s] is not a positive number", #size); \
return PARAM_INVALID; \
} \
} while (0)

#define CHECK_FALSE_EXEC(expr, exec_expr, ...) \
@@ -113,75 +113,75 @@
} while (0)

// Check if the parameter is null. If yes, return PARAM_INVALID and record the error
#define GE_CHECK_NOTNULL(val) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
return ge::PARAM_INVALID; \
} \
#define GE_CHECK_NOTNULL(val) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
return ge::PARAM_INVALID; \
} \
} while (0)

// Check if the parameter is null. If yes, just return and record the error
#define GE_CHECK_NOTNULL_JUST_RETURN(val) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
return; \
} \
#define GE_CHECK_NOTNULL_JUST_RETURN(val) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
return; \
} \
} while (0)

// Check whether the parameter is null. If so, execute the exec_expr expression and record the error log
#define GE_CHECK_NOTNULL_EXEC(val, exec_expr) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
exec_expr; \
} \
#define GE_CHECK_NOTNULL_EXEC(val, exec_expr) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
exec_expr; \
} \
} while (0)

// Check whether the parameter is null. If yes, return directly and record the error log
#define GE_RT_VOID_CHECK_NOTNULL(val) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
return; \
} \
#define GE_RT_VOID_CHECK_NOTNULL(val) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
return; \
} \
} while (0)

// Check if the parameter is null. If yes, return false and record the error log
#define GE_RT_FALSE_CHECK_NOTNULL(val) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
return false; \
} \
#define GE_RT_FALSE_CHECK_NOTNULL(val) \
do { \
if (val == nullptr) { \
DOMI_LOGE("param[%s] must not be null.", #val); \
return false; \
} \
} while (0)

// Check if the parameter is out of bounds
#define GE_CHECK_SIZE(size) \
do { \
if (size == 0) { \
DOMI_LOGE("param[%s] is out of range", #size); \
return ge::PARAM_INVALID; \
} \
#define GE_CHECK_SIZE(size) \
do { \
if (size == 0) { \
DOMI_LOGE("param[%s] is out of range", #size); \
return ge::PARAM_INVALID; \
} \
} while (0)

// Check if the value on the left is greater than or equal to the value on the right
#define GE_CHECK_GE(lhs, rhs) \
do { \
if (lhs < rhs) { \
DOMI_LOGE("param[%s] is less than[%s]", #lhs, #rhs); \
return ge::PARAM_INVALID; \
} \
#define GE_CHECK_GE(lhs, rhs) \
do { \
if (lhs < rhs) { \
DOMI_LOGE("param[%s] is less than[%s]", #lhs, #rhs); \
return ge::PARAM_INVALID; \
} \
} while (0)

// Check if the value on the left is less than or equal to the value on the right
#define GE_CHECK_LE(lhs, rhs) \
do { \
if (lhs > rhs) { \
DOMI_LOGE("param[%s] is greater than[%s]", #lhs, #rhs); \
return ge::PARAM_INVALID; \
} \
#define GE_CHECK_LE(lhs, rhs) \
do { \
if (lhs > rhs) { \
DOMI_LOGE("param[%s] is greater than[%s]", #lhs, #rhs); \
return ge::PARAM_INVALID; \
} \
} while (0)

#define GE_DELETE_NEW_SINGLE(var) \


Loading…
Cancel
Save