minor changes
This commit is contained in:
parent
5891779fe1
commit
db3999eacb
|
@ -39,8 +39,7 @@ int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
|
||||||
if (pCol->spaceSize < spaceNeeded) {
|
if (pCol->spaceSize < spaceNeeded) {
|
||||||
void *ptr = realloc(pCol->pData, spaceNeeded);
|
void *ptr = realloc(pCol->pData, spaceNeeded);
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
uDebug("malloc failure, size:%" PRId64 " failed, reason:%s", (int64_t)spaceNeeded,
|
uDebug("malloc failure, size:%" PRId64 " failed, reason:%s", (int64_t)spaceNeeded, strerror(errno));
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
pCol->pData = ptr;
|
pCol->pData = ptr;
|
||||||
|
@ -66,7 +65,6 @@ int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
|
||||||
* Duplicate the schema and return a new object
|
* Duplicate the schema and return a new object
|
||||||
*/
|
*/
|
||||||
STSchema *tdDupSchema(const STSchema *pSchema) {
|
STSchema *tdDupSchema(const STSchema *pSchema) {
|
||||||
|
|
||||||
int tlen = sizeof(STSchema) + sizeof(STColumn) * schemaNCols(pSchema);
|
int tlen = sizeof(STSchema) + sizeof(STColumn) * schemaNCols(pSchema);
|
||||||
STSchema *tSchema = (STSchema *)malloc(tlen);
|
STSchema *tSchema = (STSchema *)malloc(tlen);
|
||||||
if (tSchema == NULL) return NULL;
|
if (tSchema == NULL) return NULL;
|
||||||
|
@ -659,9 +657,7 @@ static int compareColIdx(const void* a, const void* b) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tdSortKVRowByColIdx(SKVRow row) {
|
void tdSortKVRowByColIdx(SKVRow row) { qsort(kvRowColIdx(row), kvRowNCols(row), sizeof(SColIdx), compareColIdx); }
|
||||||
qsort(kvRowColIdx(row), kvRowNCols(row), sizeof(SColIdx), compareColIdx);
|
|
||||||
}
|
|
||||||
|
|
||||||
int tdSetKVRowDataOfCol(SKVRow *orow, int16_t colId, int8_t type, void *value) {
|
int tdSetKVRowDataOfCol(SKVRow *orow, int16_t colId, int8_t type, void *value) {
|
||||||
SColIdx *pColIdx = NULL;
|
SColIdx *pColIdx = NULL;
|
||||||
|
|
Loading…
Reference in New Issue