remove warnings
This commit is contained in:
parent
ecdb23c9db
commit
8cdd7023c6
|
@ -100,12 +100,12 @@ int32_t taosParseTime(const char* timestr, int64_t* time, int32_t len, int32_t t
|
||||||
} else if (checkTzPresent(timestr, len)) {
|
} else if (checkTzPresent(timestr, len)) {
|
||||||
return parseTimeWithTz(timestr, time, timePrec, 0);
|
return parseTimeWithTz(timestr, time, timePrec, 0);
|
||||||
} else {
|
} else {
|
||||||
return (*parseLocaltimeFp[day_light])(timestr, time, timePrec);
|
return (*parseLocaltimeFp[day_light])((char*)timestr, time, timePrec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkTzPresent(const char *str, int32_t len) {
|
bool checkTzPresent(const char* str, int32_t len) {
|
||||||
char *seg = forwardToTimeStringEnd(str);
|
char* seg = forwardToTimeStringEnd((char*)str);
|
||||||
int32_t seg_len = len - (int32_t)(seg - str);
|
int32_t seg_len = len - (int32_t)(seg - str);
|
||||||
|
|
||||||
char *c = &seg[seg_len - 1];
|
char *c = &seg[seg_len - 1];
|
||||||
|
@ -267,7 +267,7 @@ int32_t parseTimeWithTz(const char* timestr, int64_t* time, int32_t timePrec, ch
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int64_t fraction = 0;
|
int64_t fraction = 0;
|
||||||
str = forwardToTimeStringEnd(timestr);
|
str = forwardToTimeStringEnd((char*)timestr);
|
||||||
|
|
||||||
if ((str[0] == 'Z' || str[0] == 'z') && str[1] == '\0') {
|
if ((str[0] == 'Z' || str[0] == 'z') && str[1] == '\0') {
|
||||||
/* utc time, no millisecond, return directly*/
|
/* utc time, no millisecond, return directly*/
|
||||||
|
|
|
@ -37,7 +37,7 @@ int syncRaftHandleVoteMessage(SSyncRaft* pRaft, const SSyncMessage* pMsg) {
|
||||||
if (pRespMsg == NULL) {
|
if (pRespMsg == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
syncInfo("[%d:%d] [logterm: %" PRId64 ", index: %" PRId64 ", vote: %d] %s for %d"\
|
syncInfo("[%d:%d] [logterm: %" PRId64 ", index: %" PRId64 ", vote: %d] %s for %d"
|
||||||
"[logterm: %" PRId64 ", index: %" PRId64 "] at term %" PRId64 "",
|
"[logterm: %" PRId64 ", index: %" PRId64 "] at term %" PRId64 "",
|
||||||
pRaft->selfGroupId, pRaft->selfId, lastTerm, lastIndex, pRaft->voteFor,
|
pRaft->selfGroupId, pRaft->selfId, lastTerm, lastIndex, pRaft->voteFor,
|
||||||
grant ? "grant" : "reject",
|
grant ? "grant" : "reject",
|
||||||
|
|
|
@ -23,8 +23,8 @@ SSyncManager* gSyncManager = NULL;
|
||||||
#define SYNC_ACTIVITY_TIMER 5
|
#define SYNC_ACTIVITY_TIMER 5
|
||||||
#define SYNC_SERVER_WORKER 2
|
#define SYNC_SERVER_WORKER 2
|
||||||
|
|
||||||
static void syncProcessRsp(SRpcMsg *pMsg, SEpSet *pEpSet);
|
static void syncProcessRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet);
|
||||||
static void syncProcessReqMsg(SRpcMsg *pMsg, SEpSet *pEpSet);
|
static void syncProcessReqMsg(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet);
|
||||||
|
|
||||||
static int syncInitRpcServer(SSyncManager* syncManager, const SSyncCluster* pSyncCfg);
|
static int syncInitRpcServer(SSyncManager* syncManager, const SSyncCluster* pSyncCfg);
|
||||||
static int syncInitRpcClient(SSyncManager* syncManager);
|
static int syncInitRpcClient(SSyncManager* syncManager);
|
||||||
|
@ -119,7 +119,7 @@ SSyncNode* syncStart(const SSyncInfo* pInfo) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pNode->syncTimer = taosTmrStart(syncNodeTick, SYNC_TICK_TIMER, (void*)pInfo->vgId, gSyncManager->syncTimerManager);
|
pNode->syncTimer = taosTmrStart(syncNodeTick, SYNC_TICK_TIMER, (void*)((int64_t)pInfo->vgId), gSyncManager->syncTimerManager);
|
||||||
|
|
||||||
// start raft
|
// start raft
|
||||||
pNode->raft.pNode = pNode;
|
pNode->raft.pNode = pNode;
|
||||||
|
@ -176,12 +176,12 @@ int32_t syncRemoveNode(SSyncNode syncNode, const SNodeInfo *pNode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// process rpc rsp message from other sync server
|
// process rpc rsp message from other sync server
|
||||||
static void syncProcessRsp(SRpcMsg *pMsg, SEpSet *pEpSet) {
|
static void syncProcessRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// process rpc message from other sync server
|
// process rpc message from other sync server
|
||||||
static void syncProcessReqMsg(SRpcMsg *pMsg, SEpSet *pEpSet) {
|
static void syncProcessReqMsg(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ static int syncInitRpcServer(SSyncManager* syncManager, const SSyncCluster* pSyn
|
||||||
}
|
}
|
||||||
assert(pSyncCfg->selfIndex < pSyncCfg->replica && pSyncCfg->selfIndex >= 0);
|
assert(pSyncCfg->selfIndex < pSyncCfg->replica && pSyncCfg->selfIndex >= 0);
|
||||||
const SNodeInfo* pNode = &(pSyncCfg->nodeInfo[pSyncCfg->replica]);
|
const SNodeInfo* pNode = &(pSyncCfg->nodeInfo[pSyncCfg->replica]);
|
||||||
char buffer[20] = {'\0'};
|
char buffer[156] = {'\0'};
|
||||||
snprintf(buffer, sizeof(buffer), "%s:%d", &(pNode->nodeFqdn[0]), pNode->nodePort);
|
snprintf(buffer, sizeof(buffer), "%s:%d", &(pNode->nodeFqdn[0]), pNode->nodePort);
|
||||||
size_t len = strlen(buffer);
|
size_t len = strlen(buffer);
|
||||||
void** ppRpcServer = taosHashGet(gSyncManager->rpcServerTable, buffer, len);
|
void** ppRpcServer = taosHashGet(gSyncManager->rpcServerTable, buffer, len);
|
||||||
|
@ -287,7 +287,7 @@ static void *syncWorkerMain(void *argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void syncNodeTick(void *param, void *tmrId) {
|
static void syncNodeTick(void *param, void *tmrId) {
|
||||||
SyncGroupId vgId = (SyncGroupId)param;
|
SyncGroupId vgId = (SyncGroupId)((int64_t)param);
|
||||||
SSyncNode **ppNode = taosHashGet(gSyncManager->vgroupTable, &vgId, sizeof(SyncGroupId*));
|
SSyncNode **ppNode = taosHashGet(gSyncManager->vgroupTable, &vgId, sizeof(SyncGroupId*));
|
||||||
if (ppNode == NULL) {
|
if (ppNode == NULL) {
|
||||||
return;
|
return;
|
||||||
|
@ -298,5 +298,5 @@ static void syncNodeTick(void *param, void *tmrId) {
|
||||||
syncRaftTick(&pNode->raft);
|
syncRaftTick(&pNode->raft);
|
||||||
pthread_mutex_unlock(&pNode->mutex);
|
pthread_mutex_unlock(&pNode->mutex);
|
||||||
|
|
||||||
pNode->syncTimer = taosTmrStart(syncNodeTick, SYNC_TICK_TIMER, (void*)pNode->vgId, gSyncManager->syncTimerManager);
|
pNode->syncTimer = taosTmrStart(syncNodeTick, SYNC_TICK_TIMER, (void*)(int64_t)pNode->vgId, gSyncManager->syncTimerManager);
|
||||||
}
|
}
|
Loading…
Reference in New Issue