Merge pull request #880 from taosdata/feature/slguan
Remove compiler warning options
This commit is contained in:
commit
e83174b3bb
|
@ -105,7 +105,7 @@ extern SSdbPeer *sdbPeer[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void *sdbOpenTable(int maxRows, int32_t maxRowSize, char *name, char keyType, char *directory,
|
void *sdbOpenTable(int maxRows, int32_t maxRowSize, char *name, uint8_t keyType, char *directory,
|
||||||
void *(*appTool)(char, void *, char *, int, int *));
|
void *(*appTool)(char, void *, char *, int, int *));
|
||||||
|
|
||||||
void *sdbGetRow(void *handle, void *key);
|
void *sdbGetRow(void *handle, void *key);
|
||||||
|
|
|
@ -664,7 +664,7 @@ typedef struct {
|
||||||
uint32_t destId;
|
uint32_t destId;
|
||||||
char meterId[TSDB_UNI_LEN];
|
char meterId[TSDB_UNI_LEN];
|
||||||
char empty[3];
|
char empty[3];
|
||||||
char msgType;
|
uint8_t msgType;
|
||||||
int32_t msgLen;
|
int32_t msgLen;
|
||||||
uint8_t content[0];
|
uint8_t content[0];
|
||||||
} SIntMsg;
|
} SIntMsg;
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
#include "lz4.h"
|
#include "lz4.h"
|
||||||
|
|
||||||
#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
|
|
||||||
|
|
||||||
typedef struct _msg_node {
|
typedef struct _msg_node {
|
||||||
struct _msg_node *next;
|
struct _msg_node *next;
|
||||||
void * ahandle;
|
void * ahandle;
|
||||||
|
@ -58,7 +56,7 @@ typedef struct {
|
||||||
uint16_t tranId; // outgoing transcation ID, for build message
|
uint16_t tranId; // outgoing transcation ID, for build message
|
||||||
uint16_t outTranId; // outgoing transcation ID
|
uint16_t outTranId; // outgoing transcation ID
|
||||||
uint16_t inTranId;
|
uint16_t inTranId;
|
||||||
char outType;
|
uint8_t outType;
|
||||||
char inType;
|
char inType;
|
||||||
char closing;
|
char closing;
|
||||||
char rspReceived;
|
char rspReceived;
|
||||||
|
@ -203,7 +201,7 @@ static STaosHeader* taosDecompressRpcMsg(STaosHeader* pHeader, SSchedMsg* pSched
|
||||||
//tDump(pHeader->content, msgLen);
|
//tDump(pHeader->content, msgLen);
|
||||||
|
|
||||||
if (buf) {
|
if (buf) {
|
||||||
int32_t originalLen = LZ4_decompress_safe(pHeader->content + overhead, buf + sizeof(STaosHeader),
|
int32_t originalLen = LZ4_decompress_safe((const char*)(pHeader->content + overhead), buf + sizeof(STaosHeader),
|
||||||
msgLen - overhead, contLen);
|
msgLen - overhead, contLen);
|
||||||
|
|
||||||
memcpy(buf, pHeader, sizeof(STaosHeader));
|
memcpy(buf, pHeader, sizeof(STaosHeader));
|
||||||
|
@ -220,6 +218,8 @@ static STaosHeader* taosDecompressRpcMsg(STaosHeader* pHeader, SSchedMsg* pSched
|
||||||
tError("failed to allocate memory to decompress msg, contLen:%d, reason:%s", contLen, strerror(errno));
|
tError("failed to allocate memory to decompress msg, contLen:%d, reason:%s", contLen, strerror(errno));
|
||||||
pSchedMsg->msg = NULL;
|
pSchedMsg->msg = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *taosBuildReqHeader(void *param, char type, char *msg) {
|
char *taosBuildReqHeader(void *param, char type, char *msg) {
|
||||||
|
@ -245,7 +245,10 @@ char *taosBuildReqHeader(void *param, char type, char *msg) {
|
||||||
pHeader->sourceId = pConn->ownId;
|
pHeader->sourceId = pConn->ownId;
|
||||||
pHeader->destId = pConn->peerId;
|
pHeader->destId = pConn->peerId;
|
||||||
pHeader->port = 0;
|
pHeader->port = 0;
|
||||||
|
|
||||||
|
#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
|
||||||
pHeader->uid = (uint32_t)pConn + (uint32_t)getpid();
|
pHeader->uid = (uint32_t)pConn + (uint32_t)getpid();
|
||||||
|
#pragma GCC diagnostic warning "-Wpointer-to-int-cast"
|
||||||
|
|
||||||
memcpy(pHeader->meterId, pConn->meterId, tListLen(pHeader->meterId));
|
memcpy(pHeader->meterId, pConn->meterId, tListLen(pHeader->meterId));
|
||||||
|
|
||||||
|
@ -276,7 +279,11 @@ char *taosBuildReqMsgWithSize(void *param, char type, int size) {
|
||||||
|
|
||||||
pHeader->sourceId = pConn->ownId;
|
pHeader->sourceId = pConn->ownId;
|
||||||
pHeader->destId = pConn->peerId;
|
pHeader->destId = pConn->peerId;
|
||||||
|
|
||||||
|
#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
|
||||||
pHeader->uid = (uint32_t)pConn + (uint32_t)getpid();
|
pHeader->uid = (uint32_t)pConn + (uint32_t)getpid();
|
||||||
|
#pragma GCC diagnostic warning "-Wpointer-to-int-cast"
|
||||||
|
|
||||||
memcpy(pHeader->meterId, pConn->meterId, tListLen(pHeader->meterId));
|
memcpy(pHeader->meterId, pConn->meterId, tListLen(pHeader->meterId));
|
||||||
|
|
||||||
return (char *)pHeader->content;
|
return (char *)pHeader->content;
|
||||||
|
|
|
@ -127,7 +127,7 @@ typedef struct {
|
||||||
} SMnodeStatus;
|
} SMnodeStatus;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char dbId;
|
uint8_t dbId;
|
||||||
char type;
|
char type;
|
||||||
uint64_t version;
|
uint64_t version;
|
||||||
short dataLen;
|
short dataLen;
|
||||||
|
|
|
@ -287,7 +287,7 @@ sdb_exit1:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *sdbOpenTable(int maxRows, int32_t maxRowSize, char *name, char keyType, char *directory,
|
void *sdbOpenTable(int maxRows, int32_t maxRowSize, char *name, uint8_t keyType, char *directory,
|
||||||
void *(*appTool)(char, void *, char *, int, int *)) {
|
void *(*appTool)(char, void *, char *, int, int *)) {
|
||||||
SSdbTable *pTable = (SSdbTable *)malloc(sizeof(SSdbTable));
|
SSdbTable *pTable = (SSdbTable *)malloc(sizeof(SSdbTable));
|
||||||
if (pTable == NULL) return NULL;
|
if (pTable == NULL) return NULL;
|
||||||
|
|
Loading…
Reference in New Issue