Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ca51b4

Browse files
committed
fix warnings in clang about long long formats
1 parent0a45dd2 commit2ca51b4

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

‎contrib/mmts/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ OBJS = multimaster.o raftable.o arbiter.o bytebuf.o bgwpool.o pglogical_output.o
33

44
overrideCPPFLAGS += -I../raftable
55

6-
SCRIPTS_built = tests/dtmbench
6+
#SCRIPTS_built = tests/dtmbench
77
EXTRA_INSTALL = contrib/raftable contrib/mmts
88

99
EXTENSION = multimaster
1010
DATA = multimaster--1.0.sql
1111

1212
.PHONY: all
1313

14-
all: multimaster.so tests/dtmbench
14+
all: multimaster.so#tests/dtmbench
1515

1616
tests/dtmbench:
1717
make -C tests

‎contrib/mmts/arbiter.c‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,18 @@ static int gateway;
105105
staticvoidMtmTransSender(Datumarg);
106106
staticvoidMtmTransReceiver(Datumarg);
107107

108-
staticcharconst*constmessageText[]=
109-
{
110-
"INVALID",
111-
"HANDSHAKE",
112-
"READY",
113-
"PREPARE",
114-
"PREPARED",
115-
"ABORTED",
116-
"STATUS"
117-
};
118-
108+
/*
109+
* static char const* const messageText[] =
110+
* {
111+
*"INVALID",
112+
*"HANDSHAKE",
113+
*"READY",
114+
*"PREPARE",
115+
*"PREPARED",
116+
*"ABORTED",
117+
*"STATUS"
118+
*};
119+
*/
119120

120121
staticBackgroundWorkerMtmSender= {
121122
"mtm-sender",
@@ -715,7 +716,7 @@ static void MtmTransReceiver(Datum arg)
715716
/* Coordinator's disabled mask is wider than of this node: so reject such transaction to avoid
716717
commit on smaller subset of nodes */
717718
elog(WARNING,"Coordinator of distributed transaction see less nodes than node %d: %lx instead of %lx",
718-
msg->node,Mtm->disabledNodeMask,msg->disabledNodeMask);
719+
msg->node,(long)Mtm->disabledNodeMask, (long)msg->disabledNodeMask);
719720
MtmAbortTransaction(ts);
720721
}
721722

‎contrib/mmts/multimaster.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ void MtmJoinTransaction(GlobalTransactionId* gtid, csn_t globalSnapshot)
879879
if (!TransactionIdIsValid(gtid->xid)) {
880880
/* In case of recovery InvalidTransactionId is passed */
881881
if (Mtm->status!=MTM_RECOVERY) {
882-
elog(PANIC,"Node %d tries to recover node %d which is in %s mode",MtmReplicationNode,MtmNodeId,MtmNodeStatusMnem[Mtm->status]);
882+
elog(PANIC,"Node %d tries to recover node %d which is in %s mode",MtmReplicationNodeId,MtmNodeId,MtmNodeStatusMnem[Mtm->status]);
883883
}
884884
}elseif (Mtm->status==MTM_RECOVERY) {
885885
/* When recovery is completed we get normal transaction ID and switch to normal mode */
@@ -1138,7 +1138,7 @@ MtmCheckClusterLock()
11381138
}else {
11391139
/* All lockers are synchronized their logs */
11401140
/* Remove lock and mark them as receovered */
1141-
elog(WARNING,"Complete recovery of %d nodes (node mask %lx)",Mtm->nLockers,Mtm->nodeLockerMask);
1141+
elog(WARNING,"Complete recovery of %d nodes (node mask %lx)",Mtm->nLockers,(long)Mtm->nodeLockerMask);
11421142
Assert(Mtm->walSenderLockerMask==0);
11431143
Assert((Mtm->nodeLockerMask&Mtm->disabledNodeMask)==Mtm->nodeLockerMask);
11441144
Mtm->disabledNodeMask &= ~Mtm->nodeLockerMask;
@@ -1198,7 +1198,7 @@ bool MtmRefreshClusterStatus(bool nowait)
11981198

11991199
clique=MtmFindMaxClique(matrix,MtmNodes,&clique_size);
12001200
if (clique_size >=MtmNodes/2+1) {/* have quorum */
1201-
elog(WARNING,"Find clique %lx, disabledNodeMask %lx",clique,Mtm->disabledNodeMask);
1201+
elog(WARNING,"Find clique %lx, disabledNodeMask %lx",(long)clique, (long)Mtm->disabledNodeMask);
12021202
MtmLock(LW_EXCLUSIVE);
12031203
mask= ~clique& (((nodemask_t)1 <<MtmNodes)-1)& ~Mtm->disabledNodeMask;/* new disabled nodes mask */
12041204
for (i=0;mask!=0;i++,mask >>=1) {
@@ -1226,7 +1226,7 @@ bool MtmRefreshClusterStatus(bool nowait)
12261226
MtmSwitchClusterMode(MTM_RECOVERY);
12271227
}
12281228
}else {
1229-
elog(WARNING,"Clique %lx has no quorum",clique);
1229+
elog(WARNING,"Clique %lx has no quorum",(long)clique);
12301230
MtmSwitchClusterMode(MTM_IN_MINORITY);
12311231
}
12321232
return true;
@@ -1236,12 +1236,12 @@ void MtmCheckQuorum(void)
12361236
{
12371237
if (Mtm->nNodes<MtmNodes/2+1) {
12381238
if (Mtm->status==MTM_ONLINE) {/* out of quorum */
1239-
elog(WARNING,"Node is in minority: disabled mask %lx",Mtm->disabledNodeMask);
1239+
elog(WARNING,"Node is in minority: disabled mask %lx",(long)Mtm->disabledNodeMask);
12401240
MtmSwitchClusterMode(MTM_IN_MINORITY);
12411241
}
12421242
}else {
12431243
if (Mtm->status==MTM_IN_MINORITY) {
1244-
elog(WARNING,"Node is in majority: dissbled mask %lx",Mtm->disabledNodeMask);
1244+
elog(WARNING,"Node is in majority: dissbled mask %lx",(long)Mtm->disabledNodeMask);
12451245
MtmSwitchClusterMode(MTM_ONLINE);
12461246
}
12471247
}
@@ -2229,7 +2229,7 @@ MtmNoticeReceiver(void *i, const PGresult *res)
22292229
/* Strip "NOTICE: " from beginning and "\n" from end of error string */
22302230
strncpy(stripped_notice,notice+9,len-1-9);
22312231

2232-
elog(NOTICE,stripped_notice);
2232+
elog(NOTICE,"%s",stripped_notice);
22332233
pfree(stripped_notice);
22342234
}
22352235

@@ -2273,7 +2273,7 @@ static void MtmBroadcastUtilityStmt(char const* sql, bool ignoreError)
22732273
if (MtmGUCBufferAllocated&& !MtmRunUtilityStmt(conns[i],MtmGUCBuffer->data,&utility_errmsg)&& !ignoreError)
22742274
{
22752275
errorMsg="Failed to set GUC variables at node %d";
2276-
elog(ERROR,utility_errmsg);
2276+
elog(NOTICE,"%s",utility_errmsg);
22772277
failedNode=i;
22782278
break;
22792279
}
@@ -2289,7 +2289,7 @@ static void MtmBroadcastUtilityStmt(char const* sql, bool ignoreError)
22892289
errorMsg=utility_errmsg;
22902290
else
22912291
{
2292-
elog(ERROR,utility_errmsg);
2292+
elog(ERROR,"%s",utility_errmsg);
22932293
errorMsg="Failed to run command at node %d";
22942294
}
22952295

‎contrib/mmts/pglogical_output.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ pg_decode_origin_filter(LogicalDecodingContext *ctx,
493493
}
494494

495495
if (!data->forward_changesets&&origin_id!=InvalidRepOriginId) {
496-
*(int*)0=0;
497496
return true;
498497
}
499498

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp