]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Make char2wchar() static.
authorJeff Davis <jdavis@postgresql.org>
Tue, 21 Oct 2025 16:32:12 +0000 (09:32 -0700)
committerJeff Davis <jdavis@postgresql.org>
Tue, 21 Oct 2025 16:32:12 +0000 (09:32 -0700)
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/0151ad01239e2cc7b3139644358cf8f7b9622ff7.camel@j-davis.com

src/backend/utils/adt/pg_locale_libc.c
src/include/utils/pg_locale.h

index 34865ccf00e24306f966d7f9f838879f1adc4647..19a50662398a6aa62cfaec8eaf59332cd1118dd2 100644 (file)
@@ -99,6 +99,9 @@ static int    strncoll_libc_win32_utf8(const char *arg1, ssize_t len1,
                                                                         pg_locale_t locale);
 #endif
 
+static size_t char2wchar(wchar_t *to, size_t tolen, const char *from,
+                                                size_t fromlen, locale_t loc);
+
 static size_t strlower_libc_sb(char *dest, size_t destsize,
                                                           const char *src, ssize_t srclen,
                                                           pg_locale_t locale);
@@ -1206,7 +1209,7 @@ wchar2char(char *to, const wchar_t *from, size_t tolen, locale_t loc)
  * input encoding.  tolen is the maximum number of wchar_t's to store at *to.
  * The output will be zero-terminated iff there is room.
  */
-size_t
+static size_t
 char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen,
                   locale_t loc)
 {
index e6f939cb085b1089530ed22a288b70904abfbbac..e08cb8228fa34b448e69b2990b4ed187dfa53572 100644 (file)
@@ -139,10 +139,8 @@ struct ctype_methods
  * "default" collation, there are separate static cache variables, since
  * consulting the pg_collation catalog doesn't tell us what we need.
  *
- * Note that some code relies on the flags not reporting false negatives
- * (that is, saying it's not C when it is).  For example, char2wchar()
- * could fail if the locale is C, so str_tolower() shouldn't call it
- * in that case.
+ * Note that some code, such as wchar2char(), relies on the flags not
+ * reporting false negatives (that is, saying it's not C when it is).
  */
 struct pg_locale_struct
 {
@@ -226,10 +224,8 @@ extern void icu_validate_locale(const char *loc_str);
 extern char *icu_language_tag(const char *loc_str, int elevel);
 extern void report_newlocale_failure(const char *localename);
 
-/* These functions convert from/to libc's wchar_t, *not* pg_wchar_t */
+/* This function converts from libc's wchar_t, *not* pg_wchar_t */
 extern size_t wchar2char(char *to, const wchar_t *from, size_t tolen,
                                                 locale_t loc);
-extern size_t char2wchar(wchar_t *to, size_t tolen,
-                                                const char *from, size_t fromlen, locale_t loc);
 
 #endif                                                 /* _PG_LOCALE_ */