Harmonize some more function parameter names.
authorPeter Geoghegan <[email protected]>
Thu, 13 Apr 2023 17:15:20 +0000 (10:15 -0700)
committerPeter Geoghegan <[email protected]>
Thu, 13 Apr 2023 17:15:20 +0000 (10:15 -0700)
Make sure that function declarations use names that exactly match the
corresponding names from function definitions in a few places.  These
inconsistencies were all introduced relatively recently, after the code
base had parameter name mismatches fixed in bulk (see commits starting
with commits 4274dc22 and 035ce1fe).

pg_bsd_indent still has a couple of similar inconsistencies, which I
(pgeoghegan) have left untouched for now.

Like all earlier commits that cleaned up function parameter names, this
commit was written with help from clang-tidy.

src/backend/parser/parse_expr.c
src/backend/storage/buffer/bufmgr.c
src/backend/utils/activity/pgstat_io.c
src/backend/utils/adt/pg_locale.c
src/bin/pg_dump/pg_dump.c
src/include/pgstat.h
src/include/replication/worker_internal.h
src/include/storage/buf_internals.h
src/pl/plpython/plpy_resultobject.c
src/test/modules/test_shm_mq/test_shm_mq.h
src/test/modules/worker_spi/worker_spi.c

index 4c99dd1dec3b53901d066ab44e14f37a82aaa475..64356436ef716ef8e4a2e032b3a5a9d9c6ed7211 100644 (file)
@@ -83,7 +83,7 @@ static Node *transformJsonArrayQueryConstructor(ParseState *pstate,
                                                                                                JsonArrayQueryConstructor *ctor);
 static Node *transformJsonObjectAgg(ParseState *pstate, JsonObjectAgg *agg);
 static Node *transformJsonArrayAgg(ParseState *pstate, JsonArrayAgg *agg);
-static Node *transformJsonIsPredicate(ParseState *pstate, JsonIsPredicate *p);
+static Node *transformJsonIsPredicate(ParseState *pstate, JsonIsPredicate *pred);
 static Node *make_row_comparison_op(ParseState *pstate, List *opname,
                                                                        List *largs, List *rargs, int location);
 static Node *make_row_distinct_op(ParseState *pstate, List *opname,
index 7778dde3e57de942eb43cbd59fa3b80845e2dc0f..b31632083359737f977928e0dcaa32c8266212fc 100644 (file)
@@ -5176,9 +5176,9 @@ TerminateBufferIO(BufferDesc *buf, bool clear_dirty, uint32 set_flag_bits)
  *     possible the error condition wasn't related to the I/O.
  */
 void
-AbortBufferIO(Buffer buf)
+AbortBufferIO(Buffer buffer)
 {
-       BufferDesc *buf_hdr = GetBufferDescriptor(buf - 1);
+       BufferDesc *buf_hdr = GetBufferDescriptor(buffer - 1);
        uint32          buf_state;
 
        buf_state = LockBufHdr(buf_hdr);
index a1355698650217755ec5bd611a6d06eedfeebe00..25735eb6c045d04d2c4124f021976b48ef17dcb6 100644 (file)
@@ -109,7 +109,7 @@ pgstat_prepare_io_time(void)
  * Like pgstat_count_io_op_n() except it also accumulates time.
  */
 void
-pgstat_count_io_op_time(IOObject io_obj, IOContext io_context, IOOp io_op,
+pgstat_count_io_op_time(IOObject io_object, IOContext io_context, IOOp io_op,
                                                instr_time start_time, uint32 cnt)
 {
        if (track_io_timing)
@@ -122,21 +122,21 @@ pgstat_count_io_op_time(IOObject io_obj, IOContext io_context, IOOp io_op,
                if (io_op == IOOP_WRITE)
                {
                        pgstat_count_buffer_write_time(INSTR_TIME_GET_MICROSEC(io_time));
-                       if (io_obj == IOOBJECT_RELATION)
+                       if (io_object == IOOBJECT_RELATION)
                                INSTR_TIME_ADD(pgBufferUsage.blk_write_time, io_time);
                }
                else if (io_op == IOOP_READ)
                {
                        pgstat_count_buffer_read_time(INSTR_TIME_GET_MICROSEC(io_time));
-                       if (io_obj == IOOBJECT_RELATION)
+                       if (io_object == IOOBJECT_RELATION)
                                INSTR_TIME_ADD(pgBufferUsage.blk_read_time, io_time);
                }
 
-               INSTR_TIME_ADD(PendingIOStats.pending_times[io_obj][io_context][io_op],
+               INSTR_TIME_ADD(PendingIOStats.pending_times[io_object][io_context][io_op],
                                           io_time);
        }
 
-       pgstat_count_io_op_n(io_obj, io_context, io_op, cnt);
+       pgstat_count_io_op_n(io_object, io_context, io_op, cnt);
 }
 
 PgStat_IO *
index 1848d42f764d04c27c0d4eb3143473aa2cd6b911..092b620673f87e6e856c52bd00ea76177ad69cb7 100644 (file)
@@ -149,7 +149,7 @@ static size_t uchar_length(UConverter *converter,
                                                   const char *str, int32_t len);
 static int32_t uchar_convert(UConverter *converter,
                                                         UChar *dest, int32_t destlen,
-                                                        const char *str, int32_t srclen);
+                                                        const char *src, int32_t srclen);
 static void icu_set_collation_attributes(UCollator *collator, const char *loc,
                                                                                 UErrorCode *status);
 #endif
index 7a504dfe25bc575c8256b9a6036e5ba9ec6cf3e2..73a6c964baf9544535d36d659933aa29385a0154 100644 (file)
@@ -290,7 +290,7 @@ static char *getFormattedOperatorName(const char *oproid);
 static char *convertTSFunction(Archive *fout, Oid funcOid);
 static const char *getFormattedTypeName(Archive *fout, Oid oid, OidOptions opts);
 static void getLOs(Archive *fout);
-static void dumpLO(Archive *fout, const LoInfo *binfo);
+static void dumpLO(Archive *fout, const LoInfo *loinfo);
 static int     dumpLOs(Archive *fout, const void *arg);
 static void dumpPolicy(Archive *fout, const PolicyInfo *polinfo);
 static void dumpPublication(Archive *fout, const PublicationInfo *pubinfo);
index a1e51404970395ef9960e337f473cdf08914c679..fff4ad5b6dd9aaed20bfa223b33acda80ed6e6c6 100644 (file)
@@ -515,13 +515,13 @@ extern PgStat_CheckpointerStats *pgstat_fetch_stat_checkpointer(void);
  * Functions in pgstat_io.c
  */
 
-extern bool pgstat_bktype_io_stats_valid(PgStat_BktypeIO *context_ops,
+extern bool pgstat_bktype_io_stats_valid(PgStat_BktypeIO *backend_io,
                                                                                 BackendType bktype);
 extern void pgstat_count_io_op(IOObject io_object, IOContext io_context, IOOp io_op);
 extern void pgstat_count_io_op_n(IOObject io_object, IOContext io_context, IOOp io_op, uint32 cnt);
 extern instr_time pgstat_prepare_io_time(void);
 extern void pgstat_count_io_op_time(IOObject io_object, IOContext io_context,
-                                                                       IOOp io_op, instr_time time, uint32 cnt);
+                                                                       IOOp io_op, instr_time start_time, uint32 cnt);
 
 extern PgStat_IO *pgstat_fetch_stat_io(void);
 extern const char *pgstat_get_io_context_name(IOContext io_context);
index dc87a4edd1315b8a43be408d31ef0a94e8157d15..dce71d2c501af81fdf3e6dc13a56aebff3013a90 100644 (file)
@@ -282,7 +282,7 @@ extern void pa_switch_to_partial_serialize(ParallelApplyWorkerInfo *winfo,
                                                                                   bool stream_locked);
 
 extern void pa_set_xact_state(ParallelApplyWorkerShared *wshared,
-                                                         ParallelTransState in_xact);
+                                                         ParallelTransState xact_state);
 extern void pa_set_stream_apply_worker(ParallelApplyWorkerInfo *winfo);
 
 extern void pa_start_subtrans(TransactionId current_xid,
index 34feaea9945a2cfb95c58e0724b6dd655e74c724..136cf8fbaf3899629305396b7bfbb62e7e9c60af 100644 (file)
@@ -392,7 +392,7 @@ extern void IssuePendingWritebacks(WritebackContext *context);
 extern void ScheduleBufferTagForWriteback(WritebackContext *context, BufferTag *tag);
 
 /* freelist.c */
-extern IOContext IOContextForStrategy(BufferAccessStrategy bas);
+extern IOContext IOContextForStrategy(BufferAccessStrategy strategy);
 extern BufferDesc *StrategyGetBuffer(BufferAccessStrategy strategy,
                                                                         uint32 *buf_state, bool *from_ring);
 extern void StrategyFreeBuffer(BufferDesc *buf);
index a8516b2db306761abfe991b414f5eada64c573e7..95acce654935c8743b544535402bb0c92c3f0165 100644 (file)
@@ -20,7 +20,7 @@ static Py_ssize_t PLy_result_length(PyObject *arg);
 static PyObject *PLy_result_item(PyObject *arg, Py_ssize_t idx);
 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 int     PLy_result_ass_subscript(PyObject *arg, PyObject *item, PyObject *value);
 
 static char PLy_result_doc[] = "Results of a PostgreSQL query";
 
index ba5418e82d5717cef59adc26406638e73eea8598..21a2b54bccbf00e75b56a77229a9e7c81ffa7cb3 100644 (file)
@@ -36,7 +36,7 @@ typedef struct
 
 /* Set up dynamic shared memory and background workers for test run. */
 extern void test_shm_mq_setup(int64 queue_size, int32 nworkers,
-                                                         dsm_segment **seg, shm_mq_handle **output,
+                                                         dsm_segment **segp, shm_mq_handle **output,
                                                          shm_mq_handle **input);
 
 /* Main entrypoint for a worker. */
index f536120bf15211c326eca345a71c76cc3be55272..ad491d772294577e4a5d9b289feb908fd30a2e2f 100644 (file)
@@ -46,7 +46,7 @@ PG_MODULE_MAGIC;
 
 PG_FUNCTION_INFO_V1(worker_spi_launch);
 
-PGDLLEXPORT void worker_spi_main(Datum) pg_attribute_noreturn();
+PGDLLEXPORT void worker_spi_main(Datum main_arg) pg_attribute_noreturn();
 
 /* GUC variables */
 static int     worker_spi_naptime = 10;