Skip to content

Commit

Permalink
Clean up some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
guanshengliang committed Jul 13, 2019
1 parent 125636e commit 6d17dbc
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/client/src/tscParseInsert.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define _XOPEN_SOURCE

#pragma GCC diagnostic ignored "-Woverflow"
#pragma GCC diagnostic ignored "-Wunused-variable"

#include <stdio.h>
#include <stdlib.h>
Expand Down
3 changes: 2 additions & 1 deletion src/client/src/tscSQLParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

#define _XOPEN_SOURCE
#define _BSD_SOURCE
#define _DEFAULT_SOURCE

#include <stdio.h>
#include <stdlib.h>
Expand All @@ -35,6 +35,7 @@
#include "tschemautil.h"
#include "tsclient.h"
#include "tsql.h"
#pragma GCC diagnostic ignored "-Wunused-variable"

typedef struct SColumnIdList {
SSchema* pSchema;
Expand Down
2 changes: 1 addition & 1 deletion src/kit/shell/shellEngine.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

#define _XOPEN_SOURCE
#define _BSD_SOURCE
#define _DEFAULT_SOURCE

#include <assert.h>
#include <pthread.h>
Expand Down
5 changes: 3 additions & 2 deletions src/kit/taosBenchmark/taosBenchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* #define _GNU_SOURCE */
#define _GNU_SOURCE

#include <argp.h>
#include <assert.h>
Expand All @@ -30,6 +30,7 @@
#include <wordexp.h>

#include "taos.h"
#pragma GCC diagnostic ignored "-Wmissing-braces"

#define BUFFER_SIZE 65536
#define MAX_DB_NAME_SIZE 64
Expand Down Expand Up @@ -567,7 +568,7 @@ void *readTable(void *sarg) {
}

fprintf(fp, "|%10s | %10d | %12.2f | %10.2f |\n",
aggreFunc[j] == "*" ? " * " : aggreFunc[j], totalData,
aggreFunc[j][0] == '*' ? " * " : aggreFunc[j], totalData,
(double)(num_of_tables * num_of_DPT) / totalT, totalT * 1000);
printf("select %10s took %.6f second(s)\n", aggreFunc[j], totalT);
}
Expand Down
2 changes: 2 additions & 0 deletions src/rpc/src/trpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#include "tudp.h"
#include "tutil.h"

#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"

typedef struct _msg_node {
struct _msg_node *next;
void * ahandle;
Expand Down
2 changes: 2 additions & 0 deletions src/system/inc/vnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ void vnodeRemoveVnode(int vnode);

int vnodeCreateVnode(int vnode, SVnodeCfg *pCfg, SVPeerDesc *pDesc);

void vnodeOpenStreams(void *param, void *tmrId);

void vnodeCreateStream(SMeterObj *pObj);

void vnodeRemoveStream(SMeterObj *pObj);
Expand Down
1 change: 1 addition & 0 deletions src/system/src/mgmtDnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "mgmt.h"
#include "tschemautil.h"
#include "tstatus.h"
#pragma GCC diagnostic ignored "-Wunused-variable"

SDnodeObj dnodeObj;

Expand Down
1 change: 1 addition & 0 deletions src/system/src/mgmtDnodeInt.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "mgmt.h"
#include "tsched.h"
#include "tutil.h"
#pragma GCC diagnostic ignored "-Wpointer-sign"

int mgmtSendVPeersMsg(SVgObj *pVgroup, SDbObj *pDb);
char *mgmtBuildVpeersIe(char *pMsg, SVgObj *pVgroup, SDbObj *pDb);
Expand Down
1 change: 0 additions & 1 deletion src/system/src/mgmtMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ int mgmtCreateMeter(SDbObj *pDb, SCreateTableMsg *pCreate) {
STabObj * pMetric = NULL;
SVgObj * pVgroup = NULL;
int size = 0;
SAcctObj *pAcct = NULL;

int numOfTables = sdbGetNumOfRows(meterSdb);
if (numOfTables >= tsMaxTables) {
Expand Down
2 changes: 2 additions & 0 deletions src/system/src/mgmtShell.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "mgmt.h"
#include "mgmtProfile.h"
#include "tlog.h"
#pragma GCC diagnostic ignored "-Wint-conversion"
#pragma GCC diagnostic ignored "-Wpointer-sign"

void * pShellConn = NULL;
SConnObj *connList;
Expand Down
1 change: 1 addition & 0 deletions src/system/src/mgmtVgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "mgmt.h"
#include "tschemautil.h"
#pragma GCC diagnostic ignored "-Wunused-variable"

void * vgSdb = NULL;
int tsVgUpdateSize;
Expand Down
3 changes: 2 additions & 1 deletion src/system/src/vnodeImport.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "vnodeMgmt.h"
#include "vnodeShell.h"
#include "vnodeUtil.h"
#pragma GCC diagnostic ignored "-Wpointer-sign"
#pragma GCC diagnostic ignored "-Wint-conversion"

typedef struct {
SCompHeader *headList;
Expand Down Expand Up @@ -61,7 +63,6 @@ typedef struct {
int rows;
} SImportInfo;

#define EXTRA_BYTES 8
int vnodeImportData(SMeterObj *pObj, SImportInfo *pImport);

int vnodeGetImportStartPart(SMeterObj *pObj, char *payload, int rows, TSKEY key1) {
Expand Down
2 changes: 2 additions & 0 deletions src/system/src/vnodeMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "vnodeShell.h"
#include "vnodeUtil.h"

#pragma GCC diagnostic ignored "-Wpointer-sign"

#define VALID_TIMESTAMP(key, curKey, prec) (((key) >= 0) && ((key) <= ((curKey) + 36500 * tsMsPerDay[prec])))

int tsMeterSizeOnFile;
Expand Down
1 change: 1 addition & 0 deletions src/system/src/vnodeRead.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "vnode.h"
#include "vnodeRead.h"
#include "vnodeUtil.h"
#pragma GCC diagnostic ignored "-Wint-conversion"

int (*pQueryFunc[])(SMeterObj *, SQuery *) = {vnodeQueryFromCache, vnodeQueryFromFile};

Expand Down
2 changes: 1 addition & 1 deletion src/system/src/vnodeShell.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "vnode.h"
#include "vnodeRead.h"
#include "vnodeUtil.h"
#pragma GCC diagnostic ignored "-Wint-conversion"

void * pShellServer = NULL;
SShellObj **shellList = NULL;
Expand Down Expand Up @@ -216,7 +217,6 @@ int vnodeSendShellSubmitRspMsg(SShellObj *pObj, int code, int numOfPoints) {

int vnodeProcessQueryRequest(char *pMsg, int msgLen, SShellObj *pObj) {
int ret, code = 0;
SMeterObj * pMeterObj = NULL;
SQueryMeterMsg * pQueryMsg;
SMeterSidExtInfo **pSids = NULL;
int32_t incNumber = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/system/src/vnodeStore.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "vnodeStore.h"
#include "vnodeUtil.h"

#pragma GCC diagnostic ignored "-Wformat-overflow="

int vnodeCreateMeterObjFile(int vnode);

int tsMaxVnode = -1;
Expand Down
2 changes: 2 additions & 0 deletions src/system/src/vnodeUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "vnodeDataFilterFunc.h"
#include "vnodeUtil.h"

#pragma GCC diagnostic ignored "-Wint-conversion"

int vnodeCheckFileIntegrity(FILE* fp) {
/*
int savedSessions, savedMeterSize;
Expand Down
1 change: 1 addition & 0 deletions src/util/src/tcrc32c.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "tcrc32c.h"
//todo : use the original source code
#pragma GCC diagnostic ignored "-Wunused-function"

#define POLY 0x82f63b78
#define LONG_SHIFT 8192
Expand Down
2 changes: 1 addition & 1 deletion src/util/src/ttime.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

#define _XOPEN_SOURCE
#define _BSD_SOURCE
#define _DEFAULT_SOURCE

#include <errno.h>
#include <stdio.h>
Expand Down

0 comments on commit 6d17dbc

Please sign in to comment.