Merge pull request #2 from guanshengliang/master

Modify grammatical errors in some example codes
This commit is contained in:
hzcheng 2019-07-11 17:17:12 +08:00 committed by GitHub
commit 57da318697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 9 deletions

View File

@ -24,7 +24,7 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <taos/taos.h> #include <taos.h>
int points = 5; int points = 5;
int numOfTables = 3; int numOfTables = 3;

View File

@ -20,7 +20,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <taos/taos.h> // TAOS header file #include <taos.h> // TAOS header file
void taosMsleep(int mseconds); void taosMsleep(int mseconds);

View File

@ -3,7 +3,7 @@
ROOT=./ ROOT=./
TARGET=exe TARGET=exe
LFLAGS = '-Wl,-rpath,/usr/local/lib/taos/' -ltaos -lpthread -lm -lrt LFLAGS = '-Wl,-rpath,/usr/local/taos/driver' -ltaos -lpthread -lm -lrt
CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX -msse4.2 -Wno-unused-function -D_M_X64 -std=gnu99 CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX -msse4.2 -Wno-unused-function -D_M_X64 -std=gnu99
all: $(TARGET) all: $(TARGET)

View File

@ -16,7 +16,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <taos/taos.h> // include TDengine header file #include <pthread.h>
#include <unistd.h>
#include <taos.h> // include TDengine header file
typedef struct { typedef struct {
char server_ip[64]; char server_ip[64];
@ -25,7 +27,7 @@ typedef struct {
} param; } param;
int g_thread_exit_flag = 0; int g_thread_exit_flag = 0;
int insert_rows(void *sarg); void* insert_rows(void *sarg);
void streamCallBack(void *param, TAOS_RES *res, TAOS_ROW row) void streamCallBack(void *param, TAOS_RES *res, TAOS_ROW row)
{ {
@ -46,7 +48,6 @@ int main(int argc, char *argv[])
char db_name[64]; char db_name[64];
char tbl_name[64]; char tbl_name[64];
char sql[1024] = { 0 }; char sql[1024] = { 0 };
char command[1024] = { 0 };
if (argc != 4) { if (argc != 4) {
printf("usage: %s server-ip dbname tblname\n", argv[0]); printf("usage: %s server-ip dbname tblname\n", argv[0]);
@ -72,7 +73,7 @@ int main(int argc, char *argv[])
strcpy(t_param->tbl_name, tbl_name); strcpy(t_param->tbl_name, tbl_name);
pthread_t pid; pthread_t pid;
pthread_create(&pid, NULL, insert_rows, t_param); pthread_create(&pid, NULL, (void * (*)(void *))insert_rows, t_param);
sleep(3); // waiting for database is created. sleep(3); // waiting for database is created.
// open connection to database // open connection to database
@ -118,7 +119,7 @@ int main(int argc, char *argv[])
} }
int insert_rows(void *sarg) void* insert_rows(void *sarg)
{ {
TAOS *taos; TAOS *taos;
char command[1024] = { 0 }; char command[1024] = { 0 };

View File

@ -19,7 +19,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <taos/taos.h> // include TDengine header file #include <taos.h> // include TDengine header file
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {