提交 89779e71 编写于 作者: J jinzhao

fix cross compile failed in arm32

上级 7bd9338e
......@@ -525,7 +525,7 @@ static void do_sum(SQLFunctionCtx *pCtx) {
*retVal += pCtx->preAggVals.statis.sum;
} else if (pCtx->inputType == TSDB_DATA_TYPE_DOUBLE || pCtx->inputType == TSDB_DATA_TYPE_FLOAT) {
double *retVal = (double*) pCtx->aOutputBuf;
*retVal += GET_DOUBLE_VAL(&(pCtx->preAggVals.statis.sum));
*retVal += GET_DOUBLE_VAL((const char*)&(pCtx->preAggVals.statis.sum));
}
} else { // computing based on the true data block
void *pData = GET_INPUT_CHAR(pCtx);
......@@ -768,7 +768,7 @@ static void avg_function(SQLFunctionCtx *pCtx) {
if (pCtx->inputType >= TSDB_DATA_TYPE_TINYINT && pCtx->inputType <= TSDB_DATA_TYPE_BIGINT) {
*pVal += pCtx->preAggVals.statis.sum;
} else if (pCtx->inputType == TSDB_DATA_TYPE_DOUBLE || pCtx->inputType == TSDB_DATA_TYPE_FLOAT) {
*pVal += GET_DOUBLE_VAL(&(pCtx->preAggVals.statis.sum));
*pVal += GET_DOUBLE_VAL((const char *)&(pCtx->preAggVals.statis.sum));
}
} else {
void *pData = GET_INPUT_CHAR(pCtx);
......@@ -3516,12 +3516,12 @@ static void spread_function(SQLFunctionCtx *pCtx) {
pInfo->max = (double)pCtx->preAggVals.statis.max;
}
} else if (pCtx->inputType == TSDB_DATA_TYPE_DOUBLE || pCtx->inputType == TSDB_DATA_TYPE_FLOAT) {
if (pInfo->min > GET_DOUBLE_VAL(&(pCtx->preAggVals.statis.min))) {
pInfo->min = GET_DOUBLE_VAL(&(pCtx->preAggVals.statis.min));
if (pInfo->min > GET_DOUBLE_VAL((const char *)&(pCtx->preAggVals.statis.min))) {
pInfo->min = GET_DOUBLE_VAL((const char *)&(pCtx->preAggVals.statis.min));
}
if (pInfo->max < GET_DOUBLE_VAL(&(pCtx->preAggVals.statis.max))) {
pInfo->max = GET_DOUBLE_VAL(&(pCtx->preAggVals.statis.max));
if (pInfo->max < GET_DOUBLE_VAL((const char *)&(pCtx->preAggVals.statis.max))) {
pInfo->max = GET_DOUBLE_VAL((const char *)&(pCtx->preAggVals.statis.max));
}
}
......
......@@ -219,7 +219,7 @@ static void getStatics_f(const TSKEY *primaryKey, const void *pData, int32_t num
}
float fv = 0;
fv = GET_FLOAT_VAL(&(data[i]));
fv = GET_FLOAT_VAL((const char*)&(data[i]));
dsum += fv;
if (fmin > fv) {
fmin = fv;
......@@ -233,12 +233,12 @@ static void getStatics_f(const TSKEY *primaryKey, const void *pData, int32_t num
}
double csum = 0;
csum = GET_DOUBLE_VAL(sum);
csum = GET_DOUBLE_VAL((const char *)sum);
csum += dsum;
#ifdef _TD_ARM_32
SET_DOUBLE_VAL_ALIGN(sum, &csum);
SET_DOUBLE_VAL_ALIGN(max, &fmax);
SET_DOUBLE_VAL_ALIGN(min, &fmin);
SET_DOUBLE_VAL_ALIGN((const char *)sum, &csum);
SET_DOUBLE_VAL_ALIGN((const char *)max, &fmax);
SET_DOUBLE_VAL_ALIGN((const char *)min, &fmin);
#else
*(double*)sum = csum;
*(double*)max = fmax;
......@@ -264,7 +264,7 @@ static void getStatics_d(const TSKEY *primaryKey, const void *pData, int32_t num
}
double dv = 0;
dv = GET_DOUBLE_VAL(&(data[i]));
dv = GET_DOUBLE_VAL((const char*)&(data[i]));
dsum += dv;
if (dmin > dv) {
dmin = dv;
......@@ -278,7 +278,7 @@ static void getStatics_d(const TSKEY *primaryKey, const void *pData, int32_t num
}
double csum = 0;
csum = GET_DOUBLE_VAL(sum);
csum = GET_DOUBLE_VAL((const char *)sum);
csum += dsum;
......@@ -504,7 +504,7 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) {
};
case TSDB_DATA_TYPE_DOUBLE: {
#ifdef _TD_ARM_32
double dv = GET_DOUBLE_VAL(src);
double dv = GET_DOUBLE_VAL((const char *)src);
SET_DOUBLE_VAL_ALIGN(val, &dv);
#else
*((double *)val) = GET_DOUBLE_VAL(src);
......@@ -579,4 +579,4 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size, void* buf
break;
}
}
}
\ No newline at end of file
}
......@@ -20,6 +20,8 @@
extern "C" {
#endif
#include <sys/types.h>
// TAOS_OS_FUNC_DIR
void taosRemoveDir(char *rootDir);
int taosMkDir(const char *pathname, mode_t mode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册