diff options
author | Peter Geoghegan <pg@bowt.ie> | 2022-09-22 12:53:20 -0700 |
---|---|---|
committer | Peter Geoghegan <pg@bowt.ie> | 2022-09-22 12:53:20 -0700 |
commit | 3535ebce5dc542b90f14d6e81cce80fe7226bda5 (patch) | |
tree | d522e66b87443f8b4d344889ecd1d8729be1b030 /src/interfaces/ecpg/preproc/c_keywords.c | |
parent | 163b0993a162ebae00fe5de8f593a5da28821a1b (diff) |
Harmonize parameter names in ecpg code.
Make ecpg function declarations consistently use named parameters. Also
make sure that the declarations use names that match corresponding names
from function definitions.
Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy.
Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
Diffstat (limited to 'src/interfaces/ecpg/preproc/c_keywords.c')
-rw-r--r-- | src/interfaces/ecpg/preproc/c_keywords.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/preproc/c_keywords.c b/src/interfaces/ecpg/preproc/c_keywords.c index e51c036101e..14f20e2d25d 100644 --- a/src/interfaces/ecpg/preproc/c_keywords.c +++ b/src/interfaces/ecpg/preproc/c_keywords.c @@ -33,7 +33,7 @@ static const uint16 ScanCKeywordTokens[] = { * ScanKeywordLookup(), except we want case-sensitive matching. */ int -ScanCKeywordLookup(const char *str) +ScanCKeywordLookup(const char *text) { size_t len; int h; @@ -43,7 +43,7 @@ ScanCKeywordLookup(const char *str) * Reject immediately if too long to be any keyword. This saves useless * hashing work on long strings. */ - len = strlen(str); + len = strlen(text); if (len > ScanCKeywords.max_kw_len) return -1; @@ -51,7 +51,7 @@ ScanCKeywordLookup(const char *str) * Compute the hash function. Since it's a perfect hash, we need only * match to the specific keyword it identifies. */ - h = ScanCKeywords_hash_func(str, len); + h = ScanCKeywords_hash_func(text, len); /* An out-of-range result implies no match */ if (h < 0 || h >= ScanCKeywords.num_keywords) @@ -59,7 +59,7 @@ ScanCKeywordLookup(const char *str) kw = GetScanKeyword(h, &ScanCKeywords); - if (strcmp(kw, str) == 0) + if (strcmp(kw, text) == 0) return ScanCKeywordTokens[h]; return -1; |