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

Commit9b0e4c8

Browse files
committed
Fix some warnings in raftable. Link raft as .o files instead of .a.
1 parentdae55b4 commit9b0e4c8

File tree

6 files changed

+9
-32
lines changed

6 files changed

+9
-32
lines changed

‎contrib/raftable/Makefile‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
MODULE_big = raftable
2-
OBJS = raftable.o worker.o state.o blockmem.o
2+
OBJS = raftable.o worker.o state.o blockmem.o raft/obj/raft.o raft/obj/util.o
33
EXTENSION = raftable
44
DATA = raftable--1.0.sql
55

6-
raftable.so: raft/lib/libraft.a
6+
.PHONY: all
77

8-
raft/lib/libraft.a:
9-
make -C raft
8+
all: raftable.so
9+
10+
raft/obj/raft.oraft/obj/util.o:
11+
make -C raft obj/raft.o obj/util.o
1012

1113
EXTRA_INSTALL = contrib/raftable
1214

13-
RAFT_PREFIX = raft
14-
overrideLDFLAGS += -L$(RAFT_PREFIX)/lib -Wl,-whole-archive -lraft -Wl,-no-whole-archive
15-
overrideCFLAGS += -Wfatal-errors
16-
overrideCPPFLAGS += -I$(RAFT_PREFIX)/include
15+
overrideCFLAGS += -Wfatal-errors -Wall
16+
overrideCPPFLAGS += -Iraft/include
1717

1818
ifdefUSE_PGXS
1919
PG_CONFIG = pg_config

‎contrib/raftable/README‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ Raftable
44
This extension allows you to have a key-value table replicated between several
55
Postgres instances over Raft protocol.
66

7-
Depends on
8-
----------
9-
10-
Raft implementation in C: https://github.com/kvap/raft
11-
Please compile the raft library with -fpic flag.
12-
137
Internals
148
---------
159

‎contrib/raftable/blockmem.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ typedef struct block_t
3232
int
3333
blockmem_format(void*origin,size_tsize)
3434
{
35-
block_t*block;
36-
meta_t*meta;
3735
intid;
3836
intblocks= (size-1) /BLOCK_LEN;
3937
if (blocks <=0)return0;

‎contrib/raftable/raftable.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ char *raftable_get(const char *key, size_t *len)
160160
Datum
161161
raftable_sql_get(PG_FUNCTION_ARGS)
162162
{
163-
RaftableEntry*e;
164163
RaftableKeykey;
165164
size_tlen;
166165
text_to_cstring_buffer(PG_GETARG_TEXT_P(0),key.data,sizeof(key.data));
@@ -178,16 +177,6 @@ raftable_sql_get(PG_FUNCTION_ARGS)
178177
PG_RETURN_NULL();
179178
}
180179

181-
staticvoidstart_timer(TimestampTz*timer)
182-
{
183-
*timer-=GetCurrentTimestamp();
184-
}
185-
186-
staticvoidstop_timer(TimestampTz*timer)
187-
{
188-
*timer+=GetCurrentTimestamp();
189-
}
190-
191180
staticlongmsec(TimestampTztimer)
192181
{
193182
longsec;

‎contrib/raftable/state.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ StateP state_shmem_init()
264264
info.keysize=sizeof(RaftableKey);
265265
info.entrysize=sizeof(RaftableEntry);
266266
boolfound;
267-
inti;
268267

269268
state=ShmemInitStruct(
270269
"raftable_state",

‎contrib/raftable/worker.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ static bool add_socket(int sock)
131131
staticbooladd_client(intsock)
132132
{
133133
inti;
134-
Client*c=server.clients;
135134

136135
if (server.clientnum >=MAX_CLIENTS)
137136
{
@@ -165,7 +164,6 @@ static bool remove_socket(int sock)
165164

166165
staticboolremove_client(Client*c)
167166
{
168-
inti=0;
169167
intsock=c->sock;
170168
Assert(sock >=0);
171169
c->sock=-1;
@@ -309,7 +307,7 @@ static void attend(Client *c)
309307
}
310308
}
311309

312-
staticboolnotify(void)
310+
staticvoidnotify(void)
313311
{
314312
inti=0;
315313
for (i=0;i<MAX_CLIENTS;i++)
@@ -343,7 +341,6 @@ static void drop_bads(void)
343341

344342
staticbooltick(inttimeout_ms)
345343
{
346-
inti;
347344
intnumready;
348345
boolraft_ready= false;
349346

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp