Skip to content

Commit bce5f7b

Browse files
committed
chore: don't enforce isoc90 declaration after stmt
1 parent 1680fe4 commit bce5f7b

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
PG_CFLAGS = -Wno-declaration-after-statement
12
EXTENSION = pg_net
23
EXTVERSION = 0.7.3
34

src/worker.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ worker_main(Datum main_arg)
171171
CURL *eh=NULL;
172172
CURLMsg *msg=NULL;
173173
int still_running=0, msgs_left=0;
174-
int http_status_code;
175174
int res;
176175

177176
pqsignal(SIGTERM, handle_sigterm);
@@ -184,9 +183,6 @@ worker_main(Datum main_arg)
184183

185184
while (!got_sigterm)
186185
{
187-
int queue_query_rc;
188-
int ttl_query_rc;
189-
190186
WaitLatch(&MyProc->procLatch,
191187
WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH,
192188
1000L,
@@ -221,7 +217,7 @@ worker_main(Datum main_arg)
221217
argTypes[1] = INT4OID;
222218
argValues[1] = Int32GetDatum(batch_size);
223219

224-
ttl_query_rc = SPI_execute_with_args("\
220+
int ttl_query_rc = SPI_execute_with_args("\
225221
WITH\
226222
rows AS (\
227223
SELECT ctid\
@@ -248,7 +244,7 @@ worker_main(Datum main_arg)
248244
argTypes[0] = INT4OID;
249245
argValues[0] = Int32GetDatum(batch_size);
250246

251-
queue_query_rc = SPI_execute_with_args("\
247+
int queue_query_rc = SPI_execute_with_args("\
252248
WITH\
253249
rows AS (\
254250
SELECT id\
@@ -339,7 +335,6 @@ worker_main(Datum main_arg)
339335
eh = msg->easy_handle;
340336

341337
if (return_code != CURLE_OK) {
342-
int failed_query_rc;
343338
int argCount = 2;
344339
Oid argTypes[2];
345340
Datum argValues[2];
@@ -354,7 +349,7 @@ worker_main(Datum main_arg)
354349
argTypes[1] = CSTRINGOID;
355350
argValues[1] = CStringGetDatum(error_msg);
356351

357-
failed_query_rc = SPI_execute_with_args("\
352+
int failed_query_rc = SPI_execute_with_args("\
358353
insert into net._http_response(id, error_msg) values ($1, $2)",
359354
argCount, argTypes, argValues, NULL, false, 1);
360355

@@ -363,14 +358,14 @@ worker_main(Datum main_arg)
363358
ereport(ERROR, errmsg("Error when inserting failed response: %s", SPI_result_code_string(failed_query_rc)));
364359
}
365360
} else {
366-
int succ_query_rc;
367361
int argCount = 6;
368362
Oid argTypes[6];
369363
Datum argValues[6];
370364
char nulls[6];
371365
CurlData *cdata = NULL;
372366
char *contentType = NULL;
373367
bool timedOut = false;
368+
int http_status_code;
374369

375370
curl_easy_getinfo(eh, CURLINFO_RESPONSE_CODE, &http_status_code);
376371
curl_easy_getinfo(eh, CURLINFO_CONTENT_TYPE, &contentType);
@@ -406,7 +401,7 @@ worker_main(Datum main_arg)
406401
argValues[5] = BoolGetDatum(timedOut);
407402
nulls[5] = ' ';
408403

409-
succ_query_rc = SPI_execute_with_args("\
404+
int succ_query_rc = SPI_execute_with_args("\
410405
insert into net._http_response(id, status_code, content, headers, content_type, timed_out) values ($1, $2, $3, $4, $5, $6)",
411406
argCount, argTypes, argValues, nulls, false, 1);
412407

0 commit comments

Comments
 (0)