From e95c284e257c33e5b5fee2220595b8f6883f93d0 Mon Sep 17 00:00:00 2001 From: Peter Geoghegan Date: Wed, 21 Sep 2022 18:47:52 -0700 Subject: [PATCH v5 3/4] Harmonize more lexer function parameter names. Make sure that function declarations use names that exactly match the corresponding names from function definitions for several "lexer adjacent" backend functions. These functions were missed by recent commits because they were obscured by clang-tidy warnings about functions whose signature is directly under the control of the lexer (flex seems to always generate function declarations with unnamed parameters). Oversight in commit aab06442. Author: Peter Geoghegan Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com --- src/include/bootstrap/bootstrap.h | 2 +- src/include/parser/scanner.h | 2 +- src/include/replication/walsender_private.h | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/bin/pgbench/pgbench.h | 6 +++--- src/test/isolation/isolationtester.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h index 89f5b01b3..c825adc40 100644 --- a/src/include/bootstrap/bootstrap.h +++ b/src/include/bootstrap/bootstrap.h @@ -57,6 +57,6 @@ extern void boot_get_type_io_data(Oid typid, extern int boot_yyparse(void); extern int boot_yylex(void); -extern void boot_yyerror(const char *str) pg_attribute_noreturn(); +extern void boot_yyerror(const char *message) pg_attribute_noreturn(); #endif /* BOOTSTRAP_H */ diff --git a/src/include/parser/scanner.h b/src/include/parser/scanner.h index 084348151..e775d96c7 100644 --- a/src/include/parser/scanner.h +++ b/src/include/parser/scanner.h @@ -138,7 +138,7 @@ extern core_yyscan_t scanner_init(const char *str, const ScanKeywordList *keywordlist, const uint16 *keyword_tokens); extern void scanner_finish(core_yyscan_t yyscanner); -extern int core_yylex(core_YYSTYPE *lvalp, YYLTYPE *llocp, +extern int core_yylex(core_YYSTYPE *yylval_param, YYLTYPE *yylloc_param, core_yyscan_t yyscanner); extern int scanner_errposition(int location, core_yyscan_t yyscanner); extern void setup_scanner_errposition_callback(ScannerCallbackState *scbstate, diff --git a/src/include/replication/walsender_private.h b/src/include/replication/walsender_private.h index cb4da76a8..7897c7458 100644 --- a/src/include/replication/walsender_private.h +++ b/src/include/replication/walsender_private.h @@ -118,7 +118,7 @@ extern void WalSndSetState(WalSndState state); */ extern int replication_yyparse(void); extern int replication_yylex(void); -extern void replication_yyerror(const char *str) pg_attribute_noreturn(); +extern void replication_yyerror(const char *message) pg_attribute_noreturn(); extern void replication_scanner_init(const char *str); extern void replication_scanner_finish(void); extern bool replication_scanner_is_replication_command(void); diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index ea824bae7..948f379e7 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -37,7 +37,7 @@ static char *scanbuf; static int scanbuflen; static void addstring(bool init, char *s, int l); -static void addchar(bool init, char s); +static void addchar(bool init, char c); static enum yytokentype checkKeyword(void); static void parseUnicode(char *s, int l); static void parseHexChar(char *s); diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h index 40903bc16..a8a0dcaa3 100644 --- a/src/bin/pgbench/pgbench.h +++ b/src/bin/pgbench/pgbench.h @@ -141,9 +141,9 @@ struct PgBenchExprList extern PgBenchExpr *expr_parse_result; extern int expr_yyparse(yyscan_t yyscanner); -extern int expr_yylex(union YYSTYPE *lvalp, yyscan_t yyscanner); -extern void expr_yyerror(yyscan_t yyscanner, const char *str) pg_attribute_noreturn(); -extern void expr_yyerror_more(yyscan_t yyscanner, const char *str, +extern int expr_yylex(union YYSTYPE *yylval_param, yyscan_t yyscanner); +extern void expr_yyerror(yyscan_t yyscanner, const char *message) pg_attribute_noreturn(); +extern void expr_yyerror_more(yyscan_t yyscanner, const char *message, const char *more) pg_attribute_noreturn(); extern bool expr_lex_one_word(PsqlScanState state, PQExpBuffer word_buf, int *offset); diff --git a/src/test/isolation/isolationtester.h b/src/test/isolation/isolationtester.h index e00bc6b81..77134b03b 100644 --- a/src/test/isolation/isolationtester.h +++ b/src/test/isolation/isolationtester.h @@ -88,6 +88,6 @@ extern TestSpec parseresult; extern int spec_yyparse(void); extern int spec_yylex(void); -extern void spec_yyerror(const char *str); +extern void spec_yyerror(const char *message); #endif /* ISOLATIONTESTER_H */ -- 2.34.1