From 8ce34a9096a1f7f2e0a78f5eb54198b97bd8a43a Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 12 Oct 2021 16:37:44 +0800 Subject: [PATCH] fix some compile warning --- include/common/tdataformat.h | 2 +- include/os/osDir.h | 2 +- source/common/src/tdataformat.c | 2 +- source/os/src/osDir.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/common/tdataformat.h b/include/common/tdataformat.h index c4321eb9df..2eef9db064 100644 --- a/include/common/tdataformat.h +++ b/include/common/tdataformat.h @@ -87,7 +87,7 @@ typedef struct { #define schemaColAt(s, i) ((s)->columns + i) #define tdFreeSchema(s) tfree((s)) -STSchema *tdDupSchema(STSchema *pSchema); +STSchema *tdDupSchema(const STSchema *pSchema); int tdEncodeSchema(void **buf, STSchema *pSchema); void * tdDecodeSchema(void *buf, STSchema **pRSchema); diff --git a/include/os/osDir.h b/include/os/osDir.h index 32733753a8..3ee3be2c10 100644 --- a/include/os/osDir.h +++ b/include/os/osDir.h @@ -20,7 +20,7 @@ extern "C" { #endif -void taosRemoveDir(char *dirname); +void taosRemoveDir(const char *dirname); bool taosDirExist(char *dirname); bool taosMkDir(char *dirname); void taosRemoveOldFiles(char *dirname, int32_t keepDays); diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index 6e76e3a8d0..94d93b651a 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -48,7 +48,7 @@ int tdAllocMemForCol(SDataCol *pCol, int maxPoints) { /** * Duplicate the schema and return a new object */ -STSchema *tdDupSchema(STSchema *pSchema) { +STSchema *tdDupSchema(const STSchema *pSchema) { int tlen = sizeof(STSchema) + sizeof(STColumn) * schemaNCols(pSchema); STSchema *tSchema = (STSchema *)malloc(tlen); diff --git a/source/os/src/osDir.c b/source/os/src/osDir.c index 839db811fd..17ab88edf6 100644 --- a/source/os/src/osDir.c +++ b/source/os/src/osDir.c @@ -34,7 +34,7 @@ #include #include -void taosRemoveDir(char *dirname) { +void taosRemoveDir(const char *dirname) { DIR *dir = opendir(dirname); if (dir == NULL) return; -- GitLab