Revert "fix coverity issue CID:399957"

This reverts commit de4a0047c5.
This commit is contained in:
Ganlin Zhao 2023-02-24 09:57:57 +08:00
parent de4a0047c5
commit d34c70d172
5 changed files with 8 additions and 16 deletions

View File

@ -38,7 +38,7 @@ typedef struct SRawExprNode {
} SRawExprNode;
typedef struct SDataType {
uint16_t type;
uint8_t type;
uint8_t precision;
uint8_t scale;
int32_t bytes;

View File

@ -76,7 +76,6 @@ int32_t tjsonGetSmallIntValue(const SJson* pJson, const char* pName, int16_t* pV
int32_t tjsonGetTinyIntValue(const SJson* pJson, const char* pName, int8_t* pVal);
int32_t tjsonGetUBigIntValue(const SJson* pJson, const char* pName, uint64_t* pVal);
int32_t tjsonGetUIntValue(const SJson* pJson, const char* pName, uint32_t* pVal);
int32_t tjsonGetUSmallIntValue(const SJson* pJson, const char* pName, uint16_t* pVal);
int32_t tjsonGetUTinyIntValue(const SJson* pJson, const char* pName, uint8_t* pVal);
int32_t tjsonGetBoolValue(const SJson* pJson, const char* pName, bool* pVal);
int32_t tjsonGetDoubleValue(const SJson* pJson, const char* pName, double* pVal);

View File

@ -2972,7 +2972,7 @@ static int32_t dataTypeToJson(const void* pObj, SJson* pJson) {
static int32_t jsonToDataType(const SJson* pJson, void* pObj) {
SDataType* pNode = (SDataType*)pObj;
int32_t code = tjsonGetUSmallIntValue(pJson, jkDataTypeType, &pNode->type);
int32_t code = tjsonGetUTinyIntValue(pJson, jkDataTypeType, &pNode->type);
if (TSDB_CODE_SUCCESS == code) {
code = tjsonGetUTinyIntValue(pJson, jkDataTypePrecision, &pNode->precision);
}

View File

@ -619,7 +619,7 @@ static int32_t dataTypeToMsg(const void* pObj, STlvEncoder* pEncoder) {
static int32_t msgToDataTypeInline(STlvDecoder* pDecoder, void* pObj) {
SDataType* pNode = (SDataType*)pObj;
int32_t code = tlvDecodeValueU16(pDecoder, &pNode->type);
int32_t code = tlvDecodeValueI8(pDecoder, &pNode->type);
if (TSDB_CODE_SUCCESS == code) {
code = tlvDecodeValueU8(pDecoder, &pNode->precision);
}
@ -641,7 +641,7 @@ static int32_t msgToDataType(STlvDecoder* pDecoder, void* pObj) {
tlvForEach(pDecoder, pTlv, code) {
switch (pTlv->type) {
case DATA_TYPE_CODE_TYPE:
code = tlvDecodeU16(pTlv, &pNode->type);
code = tlvDecodeI8(pTlv, &pNode->type);
break;
case DATA_TYPE_CODE_PRECISION:
code = tlvDecodeU8(pTlv, &pNode->precision);

View File

@ -250,13 +250,6 @@ int32_t tjsonGetUIntValue(const SJson* pJson, const char* pName, uint32_t* pVal)
return code;
}
int32_t tjsonGetUSmallIntValue(const SJson* pJson, const char* pName, uint16_t* pVal) {
uint64_t val = 0;
int32_t code = tjsonGetUBigIntValue(pJson, pName, &val);
*pVal = val;
return code;
}
int32_t tjsonGetUTinyIntValue(const SJson* pJson, const char* pName, uint8_t* pVal) {
uint64_t val = 0;
int32_t code = tjsonGetUBigIntValue(pJson, pName, &val);