🎈 perf: 消除某些平台出现的编译警告问题

This commit is contained in:
const_zpc 2024-06-10 22:13:56 +08:00
parent 4b78f6977f
commit 6e05f60dc6
2 changed files with 4 additions and 2 deletions

View File

@ -82,7 +82,7 @@
#if COT_PARAM_USE_CUSTOM_CHECK
#if (COT_PARAM_NAME_MAX_LENGTH > 1)
#define COT_PARAM_ITEM_BIND_NUM_DEF_RANGE_IMPL(_id, _name, _variable, _type, _length, _attr, _defVal, _minVal, _maxVal, _check) { \
.name = {.textId = (size_t)(_name), .pTextString = (char*)(_name)}, \
.name = {.pVoid = (void *)(_name)}, \
.id = _id, .type = _type, .length = _length, .attr = _attr, \
.unCurValuePtr.pVoid = _variable, .unDefValuePtr.pVoid = _defVal, \
.unMinValuePtr.pVoid = _minVal, .unMaxValuePtr.pVoid = _maxVal, .pfnParamCheck = _check}
@ -96,7 +96,7 @@
#else
#if (COT_PARAM_NAME_MAX_LENGTH > 1)
#define COT_PARAM_ITEM_BIND_NUM_DEF_RANGE_IMPL(_id, _name, _variable, _type, _length, _attr, _defVal, _minVal, _maxVal, _check) { \
.name = {.textId = (size_t)(_name), .pTextString = (char*)(_name)}, \
.name = {.pVoid = (void *)(_name)}, \
.id = _id, .type = _type, .length = _length, .attr = _attr, \
.unCurValuePtr.pVoid = _variable, .unDefValuePtr.pVoid = _defVal, \
.unMinValuePtr.pVoid = _minVal, .unMaxValuePtr.pVoid = _maxVal}

View File

@ -119,6 +119,8 @@ typedef int (*cotParamCheck_f)(const void *pCurParam);
typedef union
{
void *pVoid; /*!< 通用指针(目的消除编译警告) */
size_t textId; /*!< 文本ID */
char *pTextString; /*!< 文本字符串 */