提交 56774603 编写于 作者: Z zhaoyanggh

type cast warning

上级 0bf6fade
...@@ -1470,7 +1470,7 @@ void querySqlFile(TAOS *taos, char *sqlFile) { ...@@ -1470,7 +1470,7 @@ void querySqlFile(TAOS *taos, char *sqlFile) {
char * line = NULL; char * line = NULL;
size_t line_len = 0; size_t line_len = 0;
double t = taosGetTimestampMs(); double t = (double)taosGetTimestampMs();
while ((read_len = tgetline(&line, &line_len, fp)) != -1) { while ((read_len = tgetline(&line, &line_len, fp)) != -1) {
if (read_len >= TSDB_MAX_BYTES_PER_ROW) continue; if (read_len >= TSDB_MAX_BYTES_PER_ROW) continue;
...@@ -1501,7 +1501,7 @@ void querySqlFile(TAOS *taos, char *sqlFile) { ...@@ -1501,7 +1501,7 @@ void querySqlFile(TAOS *taos, char *sqlFile) {
} }
t = taosGetTimestampMs() - t; t = taosGetTimestampMs() - t;
printf("run %s took %.6f second(s)\n\n", sqlFile, t); printf("run %s took %.6f second(s)\n\n", sqlFile, t / 1000000);
tmfree(cmd); tmfree(cmd);
tmfree(line); tmfree(line);
...@@ -1583,7 +1583,7 @@ void *queryStableAggrFunc(void *sarg) { ...@@ -1583,7 +1583,7 @@ void *queryStableAggrFunc(void *sarg) {
command); command);
fprintf(fp, "%s\n", command); fprintf(fp, "%s\n", command);
double t = taosGetTimestampUs(); double t = (double)taosGetTimestampUs();
TAOS_RES *pSql = taos_query(taos, command); TAOS_RES *pSql = taos_query(taos, command);
int32_t code = taos_errno(pSql); int32_t code = taos_errno(pSql);
...@@ -1677,7 +1677,7 @@ void *queryNtableAggrFunc(void *sarg) { ...@@ -1677,7 +1677,7 @@ void *queryNtableAggrFunc(void *sarg) {
sprintf(command, "SELECT %s FROM %s%" PRId64 " WHERE ts>= %" PRIu64, sprintf(command, "SELECT %s FROM %s%" PRId64 " WHERE ts>= %" PRIu64,
aggreFunc[j], tb_prefix, i, startTime); aggreFunc[j], tb_prefix, i, startTime);
double t = taosGetTimestampUs(); double t = static_cast<double> taosGetTimestampUs();
debugPrint("%s() LN%d, sql command: %s\n", __func__, __LINE__, debugPrint("%s() LN%d, sql command: %s\n", __func__, __LINE__,
command); command);
TAOS_RES *pSql = taos_query(taos, command); TAOS_RES *pSql = taos_query(taos, command);
......
...@@ -3415,7 +3415,7 @@ static int parseSamplefileToStmtBatch(SSuperTable *stbInfo) { ...@@ -3415,7 +3415,7 @@ static int parseSamplefileToStmtBatch(SSuperTable *stbInfo) {
switch (data_type) { switch (data_type) {
case TSDB_DATA_TYPE_INT: case TSDB_DATA_TYPE_INT:
case TSDB_DATA_TYPE_UINT: case TSDB_DATA_TYPE_UINT:
tmpP = calloc(1, sizeof(int) * MAX_SAMPLES); tmpP = calloc(1, sizeof(int32_t) * MAX_SAMPLES);
assert(tmpP); assert(tmpP);
*(uintptr_t *)(sampleBindBatchArray + sizeof(uintptr_t *) * c) = *(uintptr_t *)(sampleBindBatchArray + sizeof(uintptr_t *) * c) =
(uintptr_t)tmpP; (uintptr_t)tmpP;
...@@ -3423,7 +3423,7 @@ static int parseSamplefileToStmtBatch(SSuperTable *stbInfo) { ...@@ -3423,7 +3423,7 @@ static int parseSamplefileToStmtBatch(SSuperTable *stbInfo) {
case TSDB_DATA_TYPE_TINYINT: case TSDB_DATA_TYPE_TINYINT:
case TSDB_DATA_TYPE_UTINYINT: case TSDB_DATA_TYPE_UTINYINT:
tmpP = calloc(1, sizeof(int8_t) * MAX_SAMPLES); tmpP = calloc(1, sizeof(char) * MAX_SAMPLES);
assert(tmpP); assert(tmpP);
*(uintptr_t *)(sampleBindBatchArray + sizeof(uintptr_t *) * c) = *(uintptr_t *)(sampleBindBatchArray + sizeof(uintptr_t *) * c) =
(uintptr_t)tmpP; (uintptr_t)tmpP;
...@@ -3446,7 +3446,7 @@ static int parseSamplefileToStmtBatch(SSuperTable *stbInfo) { ...@@ -3446,7 +3446,7 @@ static int parseSamplefileToStmtBatch(SSuperTable *stbInfo) {
break; break;
case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_BOOL:
tmpP = calloc(1, sizeof(int8_t) * MAX_SAMPLES); tmpP = calloc(1, sizeof(char) * MAX_SAMPLES);
assert(tmpP); assert(tmpP);
*(uintptr_t *)(sampleBindBatchArray + sizeof(uintptr_t *) * c) = *(uintptr_t *)(sampleBindBatchArray + sizeof(uintptr_t *) * c) =
(uintptr_t)tmpP; (uintptr_t)tmpP;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册