Commit c520a4e2 authored by Bartosz Podrygajlo's avatar Bartosz Podrygajlo

Refactor some scope macros

Use do {} while (0) for UEdumpScopeData/gNBdumpScopeData macro
parent 2198e311
...@@ -159,10 +159,12 @@ void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int ...@@ -159,10 +159,12 @@ void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int
} }
#define gNBdumpScopeData(gnb, slot, frame, cause_string) \ #define gNBdumpScopeData(gnb, slot, frame, cause_string) \
do { \
scopeData_t *scope_data = (scopeData_t *)gnb->scopeData; \ scopeData_t *scope_data = (scopeData_t *)gnb->scopeData; \
if (scope_data && scope_data->dumpScopeData) { \ if (scope_data && scope_data->dumpScopeData) { \
scope_data->dumpScopeData(slot, frame, cause_string); \ scope_data->dumpScopeData((slot), (frame), (cause_string)); \
} } \
} while (0)
#define UEScopeHasTryLock(ue) \ #define UEScopeHasTryLock(ue) \
(ue->scopeData && ((scopeData_t *)ue->scopeData)->tryLockScopeData) (ue->scopeData && ((scopeData_t *)ue->scopeData)->tryLockScopeData)
...@@ -184,10 +186,12 @@ void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int ...@@ -184,10 +186,12 @@ void copyData(void *, enum scopeDataType type, void *dataIn, int elementSz, int
} }
#define UEdumpScopeData(ue, slot, frame, cause_string) \ #define UEdumpScopeData(ue, slot, frame, cause_string) \
do { \
scopeData_t *scope_data = (scopeData_t *)ue->scopeData; \ scopeData_t *scope_data = (scopeData_t *)ue->scopeData; \
if (scope_data && scope_data->dumpScopeData) { \ if (scope_data && scope_data->dumpScopeData) { \
scope_data->dumpScopeData(slot, frame, cause_string); \ scope_data->dumpScopeData((slot), (frame), (cause_string)); \
} \ } \
} while (0)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment