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

fix cross compile failed in arm32

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