more code
This commit is contained in:
parent
a2350445cc
commit
5ffaaebad6
|
@ -34,7 +34,8 @@ typedef struct {
|
||||||
};
|
};
|
||||||
// Integer ----
|
// Integer ----
|
||||||
struct {
|
struct {
|
||||||
/* data */
|
int8_t i_copy;
|
||||||
|
int32_t i_n;
|
||||||
};
|
};
|
||||||
// Float ----
|
// Float ----
|
||||||
struct {
|
struct {
|
||||||
|
@ -52,6 +53,10 @@ typedef struct {
|
||||||
struct {
|
struct {
|
||||||
int32_t bool_n;
|
int32_t bool_n;
|
||||||
};
|
};
|
||||||
|
// Binary ----
|
||||||
|
struct {
|
||||||
|
int32_t b_n;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
} SCompressor;
|
} SCompressor;
|
||||||
|
|
||||||
|
@ -337,9 +342,13 @@ static int32_t tCompBinary(SCompressor *pCmprsor, const uint8_t *pData, int32_t
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
if (nData) {
|
if (nData) {
|
||||||
|
code = tRealloc(&pCmprsor->aBuf[0], pCmprsor->nBuf[0] + nData);
|
||||||
|
if (code) return code;
|
||||||
|
|
||||||
memcpy(pCmprsor->aBuf[0] + pCmprsor->nBuf[0], pData, nData);
|
memcpy(pCmprsor->aBuf[0] + pCmprsor->nBuf[0], pData, nData);
|
||||||
pCmprsor->nBuf[0] += nData;
|
pCmprsor->nBuf[0] += nData;
|
||||||
}
|
}
|
||||||
|
pCmprsor->b_n++;
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -419,6 +428,9 @@ int32_t tCompressorReset(SCompressor *pCmprsor, int8_t type, int8_t cmprAlg) {
|
||||||
pCmprsor->bool_n = 0;
|
pCmprsor->bool_n = 0;
|
||||||
pCmprsor->aBuf[0][0] = 0;
|
pCmprsor->aBuf[0][0] = 0;
|
||||||
break;
|
break;
|
||||||
|
case TSDB_DATA_TYPE_BINARY:
|
||||||
|
pCmprsor->b_n = 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue