提交 9f164ab0 编写于 作者: H Hongze Cheng

resolve warnings in kit

上级 fcfb35d1
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "shell.h" #include "shell.h"
#include "shellCommand.h" #include "shellCommand.h"
extern int wcwidth(wchar_t c);
extern int wcswidth(const wchar_t *s, size_t n);
typedef struct { typedef struct {
char widthInString; char widthInString;
char widthOnScreen; char widthOnScreen;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define _XOPEN_SOURCE #define _XOPEN_SOURCE
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include <inttypes.h>
#include "os.h" #include "os.h"
#include "shell.h" #include "shell.h"
#include "shellCommand.h" #include "shellCommand.h"
...@@ -446,7 +447,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -446,7 +447,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
printf("%*d|", l[i], *((int *)row[i])); printf("%*d|", l[i], *((int *)row[i]));
break; break;
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
printf("%*lld|", l[i], *((int64_t *)row[i])); printf("%*" PRId64 "|", l[i], *((int64_t *)row[i]));
break; break;
case TSDB_DATA_TYPE_FLOAT: { case TSDB_DATA_TYPE_FLOAT: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
...@@ -481,7 +482,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -481,7 +482,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
break; break;
case TSDB_DATA_TYPE_TIMESTAMP: case TSDB_DATA_TYPE_TIMESTAMP:
if (args.is_raw_time) { if (args.is_raw_time) {
printf(" %lld|", *(int64_t *)row[i]); printf(" %" PRId64 "|", *(int64_t *)row[i]);
} else { } else {
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) { if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
tt = (time_t)((*(int64_t *)row[i]) / 1000000); tt = (time_t)((*(int64_t *)row[i]) / 1000000);
...@@ -531,7 +532,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -531,7 +532,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
printf("%d\n", *((int *)row[i])); printf("%d\n", *((int *)row[i]));
break; break;
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
printf("%lld\n", *((int64_t *)row[i])); printf("%" PRId64 "\n", *((int64_t *)row[i]));
break; break;
case TSDB_DATA_TYPE_FLOAT: { case TSDB_DATA_TYPE_FLOAT: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
...@@ -564,7 +565,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -564,7 +565,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
break; break;
case TSDB_DATA_TYPE_TIMESTAMP: case TSDB_DATA_TYPE_TIMESTAMP:
if (args.is_raw_time) { if (args.is_raw_time) {
printf("%lld\n", *(int64_t *)row[i]); printf("%" PRId64 "\n", *(int64_t *)row[i]);
} else { } else {
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) { if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
tt = (time_t)((*(int64_t *)row[i]) / 1000000); tt = (time_t)((*(int64_t *)row[i]) / 1000000);
...@@ -619,7 +620,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -619,7 +620,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
fprintf(fp, "%d", *((int *)row[i])); fprintf(fp, "%d", *((int *)row[i]));
break; break;
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
fprintf(fp, "%lld", *((int64_t *)row[i])); fprintf(fp, "%" PRId64, *((int64_t *)row[i]));
break; break;
case TSDB_DATA_TYPE_FLOAT: { case TSDB_DATA_TYPE_FLOAT: {
#ifdef _TD_ARM_32_ #ifdef _TD_ARM_32_
...@@ -651,7 +652,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) { ...@@ -651,7 +652,7 @@ int shellDumpResult(TAOS *con, char *fname, int *error_no, bool printMode) {
break; break;
case TSDB_DATA_TYPE_TIMESTAMP: case TSDB_DATA_TYPE_TIMESTAMP:
if (args.is_raw_time) { if (args.is_raw_time) {
fprintf(fp, "%lld", *(int64_t *)row[i]); fprintf(fp, "%" PRId64, *(int64_t *)row[i]);
} else { } else {
if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) { if (taos_result_precision(result) == TSDB_TIME_PRECISION_MICRO) {
tt = (time_t)((*(int64_t *)row[i]) / 1000000); tt = (time_t)((*(int64_t *)row[i]) / 1000000);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
int indicator = 1; int indicator = 1;
struct termios oldtio; struct termios oldtio;
extern int wcwidth(wchar_t c);
void insertChar(Command *cmd, char *c, int size); void insertChar(Command *cmd, char *c, int size);
const char *argp_program_version = version; const char *argp_program_version = version;
const char *argp_program_bug_address = "<support@taosdata.com>"; const char *argp_program_bug_address = "<support@taosdata.com>";
......
...@@ -265,30 +265,35 @@ double getCurrentTime(); ...@@ -265,30 +265,35 @@ double getCurrentTime();
void callBack(void *param, TAOS_RES *res, int code); void callBack(void *param, TAOS_RES *res, int code);
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
struct arguments arguments = {NULL, struct arguments arguments = {NULL, // host
0, 0, // port
"root", "root", // user
"taosdata", "taosdata", // password
"test", "test", // database
"t", "t", // tb_prefix
false, false, // use_metric
false, false, // insert_only
"./output.txt", "./output.txt", // output_file
0, 0, // mode
"int", {
"int", // datatype
"", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"", ""
8, },
1, 8, // len_of_binary
1, 1, // num_of_CPR
1, 1, // num_of_connections
1, 1, // num_of_RPR
50000}; 1, // num_of_tables
50000, // num_of_DPT
0, // abort
NULL // arg_list
};
/* Parse our arguments; every option seen by parse_opt will be /* Parse our arguments; every option seen by parse_opt will be
reflected in arguments. */ reflected in arguments. */
......
...@@ -23,6 +23,7 @@ extern "C" { ...@@ -23,6 +23,7 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <error.h>
#include <argp.h> #include <argp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <assert.h> #include <assert.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册