From 3350fb5d1f9d73de15428e9bfa83dce96421fc14 Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Thu, 21 May 2020 08:31:16 -0700 Subject: [PATCH] Clear some style deviations. --- contrib/pgcrypto/pgp-mpi-internal.c | 2 +- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/storage/smgr/md.c | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- src/pl/plpython/plpy_cursorobject.c | 4 +--- src/pl/plpython/plpy_planobject.c | 4 +--- src/pl/plpython/plpy_resultobject.c | 4 +--- src/pl/plpython/plpy_subxactobject.c | 5 ++--- src/port/random.c | 2 +- 11 files changed, 12 insertions(+), 19 deletions(-) diff --git a/contrib/pgcrypto/pgp-mpi-internal.c b/contrib/pgcrypto/pgp-mpi-internal.c index 2353a48a07..0cea514180 100644 --- a/contrib/pgcrypto/pgp-mpi-internal.c +++ b/contrib/pgcrypto/pgp-mpi-internal.c @@ -35,7 +35,7 @@ #include "px.h" static mpz_t * -mp_new() +mp_new(void) { mpz_t *mp = mp_int_alloc(); diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 6829ff3e8f..a8d4dfdd7c 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e4..942f8d4edd 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index e0b020da11..0eacd461cd 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -1114,7 +1114,7 @@ _mdfd_openseg(SMgrRelation reln, ForkNumber forknum, BlockNumber segno, int oflags) { MdfdVec *v; - int fd; + File fd; char *fullpath; fullpath = _mdfd_segpath(reln, forknum, segno); diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b3..31de81f353 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f9631..9afa0533a6 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/src/pl/plpython/plpy_cursorobject.c b/src/pl/plpython/plpy_cursorobject.c index 4c37ff898c..08d8b607e3 100644 --- a/src/pl/plpython/plpy_cursorobject.c +++ b/src/pl/plpython/plpy_cursorobject.c @@ -27,9 +27,7 @@ static PyObject *PLy_cursor_iternext(PyObject *self); static PyObject *PLy_cursor_fetch(PyObject *self, PyObject *args); static PyObject *PLy_cursor_close(PyObject *self, PyObject *unused); -static char PLy_cursor_doc[] = { - "Wrapper around a PostgreSQL cursor" -}; +static char PLy_cursor_doc[] = "Wrapper around a PostgreSQL cursor"; static PyMethodDef PLy_cursor_methods[] = { {"fetch", PLy_cursor_fetch, METH_VARARGS, NULL}, diff --git a/src/pl/plpython/plpy_planobject.c b/src/pl/plpython/plpy_planobject.c index c23e79fe55..5951d2a6ff 100644 --- a/src/pl/plpython/plpy_planobject.c +++ b/src/pl/plpython/plpy_planobject.c @@ -18,9 +18,7 @@ static PyObject *PLy_plan_cursor(PyObject *self, PyObject *args); static PyObject *PLy_plan_execute(PyObject *self, PyObject *args); static PyObject *PLy_plan_status(PyObject *self, PyObject *args); -static char PLy_plan_doc[] = { - "Store a PostgreSQL plan" -}; +static char PLy_plan_doc[] = "Store a PostgreSQL plan"; static PyMethodDef PLy_plan_methods[] = { {"cursor", PLy_plan_cursor, METH_VARARGS, NULL}, diff --git a/src/pl/plpython/plpy_resultobject.c b/src/pl/plpython/plpy_resultobject.c index b31dbdaa1d..54f39419c8 100644 --- a/src/pl/plpython/plpy_resultobject.c +++ b/src/pl/plpython/plpy_resultobject.c @@ -22,9 +22,7 @@ static PyObject *PLy_result_str(PyObject *arg); static PyObject *PLy_result_subscript(PyObject *arg, PyObject *item); static int PLy_result_ass_subscript(PyObject *self, PyObject *item, PyObject *value); -static char PLy_result_doc[] = { - "Results of a PostgreSQL query" -}; +static char PLy_result_doc[] = "Results of a PostgreSQL query"; static PySequenceMethods PLy_result_as_sequence = { .sq_length = PLy_result_length, diff --git a/src/pl/plpython/plpy_subxactobject.c b/src/pl/plpython/plpy_subxactobject.c index 98d7c90c81..5c92a0e089 100644 --- a/src/pl/plpython/plpy_subxactobject.c +++ b/src/pl/plpython/plpy_subxactobject.c @@ -19,9 +19,8 @@ static void PLy_subtransaction_dealloc(PyObject *subxact); static PyObject *PLy_subtransaction_enter(PyObject *self, PyObject *unused); static PyObject *PLy_subtransaction_exit(PyObject *self, PyObject *args); -static char PLy_subtransaction_doc[] = { - "PostgreSQL subtransaction context manager" -}; +static char PLy_subtransaction_doc[] = +"PostgreSQL subtransaction context manager"; static PyMethodDef PLy_subtransaction_methods[] = { {"__enter__", PLy_subtransaction_enter, METH_VARARGS, NULL}, diff --git a/src/port/random.c b/src/port/random.c index f3021458be..f04432fe1f 100644 --- a/src/port/random.c +++ b/src/port/random.c @@ -19,7 +19,7 @@ long -random() +random(void) { return pg_lrand48(); }