[gspell] icu: make some functions static



commit 8b85a04d076e7e31aa0d66c0b7ef40b575019619
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Oct 9 02:35:45 2020 +0200

    icu: make some functions static
    
    The functions copied from Tepl are unit-tested in Tepl, but not in
    gspell (doing so would require to keep the unit-test code in sync too,
    which is more work).

 gspell/gspell-icu.c | 11 ++++++-----
 gspell/gspell-icu.h | 28 ++++------------------------
 2 files changed, 10 insertions(+), 29 deletions(-)
---
diff --git a/gspell/gspell-icu.c b/gspell/gspell-icu.c
index 418e5a2..e81c58d 100644
--- a/gspell/gspell-icu.c
+++ b/gspell/gspell-icu.c
@@ -18,6 +18,7 @@
  */
 
 #include "gspell-icu.h"
+#include <unicode/ustring.h>
 #include <unicode/uloc.h>
 
 /* Implementation notes:
@@ -42,7 +43,7 @@
  * Returns: (transfer full) (nullable): the newly-allocated string with the
  * right size. Free with g_free() when no longer needed.
  */
-char *
+static char *
 _gspell_icu_strToUTF8 (int32_t     *pDestLength,
                       const UChar *src,
                       int32_t      srcLength,
@@ -83,7 +84,7 @@ _gspell_icu_strToUTF8 (int32_t     *pDestLength,
 /* Returns: (transfer full) (nullable): a nul-terminated UTF-8 string. Free with
  * g_free() when no longer needed.
  */
-char *
+static char *
 _gspell_icu_strToUTF8Simple (const UChar *uchars)
 {
        char *utf8_str;
@@ -105,7 +106,7 @@ _gspell_icu_strToUTF8Simple (const UChar *uchars)
  * Returns: (transfer full) (nullable): the result as a newly-allocated buffer
  * with the right size. Free with g_free() when no longer needed.
  */
-UChar *
+static UChar *
 _gspell_icu_loc_getDisplayName (const char *localeID,
                                const char *inLocaleID,
                                UErrorCode *err)
@@ -169,7 +170,7 @@ _gspell_icu_loc_getDisplayNameSimple (const char *localeID,
  * Returns: (transfer full) (nullable): the result as a newly-allocated buffer
  * with the right size. Free with g_free() when no longer needed.
  */
-char *
+static char *
 _gspell_icu_loc_canonicalize (const char *localeID,
                              UErrorCode *err)
 {
@@ -198,7 +199,7 @@ _gspell_icu_loc_canonicalize (const char *localeID,
 /* Returns: (transfer full) (nullable): the result, or %NULL in case of error.
  * Free with g_free() when no longer needed.
  */
-char *
+static char *
 _gspell_icu_loc_canonicalizeSimple (const char *localeID)
 {
        char *result;
diff --git a/gspell/gspell-icu.h b/gspell/gspell-icu.h
index 381fa33..14e6cbe 100644
--- a/gspell/gspell-icu.h
+++ b/gspell/gspell-icu.h
@@ -21,37 +21,17 @@
 #define GSPELL_ICU_H
 
 #include <glib.h>
-#include <unicode/ustring.h>
 
 G_BEGIN_DECLS
 
 G_GNUC_INTERNAL
-char *                 _gspell_icu_strToUTF8                   (int32_t     *pDestLength,
-                                                                const UChar *src,
-                                                                int32_t      srcLength,
-                                                                UErrorCode  *pErrorCode);
+char * _gspell_icu_get_language_name_from_code (const char *language_code);
 
-G_GNUC_INTERNAL
-char *                 _gspell_icu_strToUTF8Simple             (const UChar *uchars);
-
-G_GNUC_INTERNAL
-UChar *                        _gspell_icu_loc_getDisplayName          (const char *localeID,
-                                                                const char *inLocaleID,
-                                                                UErrorCode *err);
-
-G_GNUC_INTERNAL
-char *                 _gspell_icu_loc_getDisplayNameSimple    (const char *localeID,
-                                                                const char *inLocaleID);
-
-G_GNUC_INTERNAL
-char *                 _gspell_icu_loc_canonicalize            (const char *localeID,
-                                                                UErrorCode *err);
-
-G_GNUC_INTERNAL
-char *                 _gspell_icu_loc_canonicalizeSimple      (const char *localeID);
+/* Intermediate functions, for unit tests: */
 
 G_GNUC_INTERNAL
-char *                 _gspell_icu_get_language_name_from_code (const char *language_code);
+char * _gspell_icu_loc_getDisplayNameSimple    (const char *localeID,
+                                                const char *inLocaleID);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]