[Libreoffice-commits] core.git: sal/rtl sal/util

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 05:26:39 UTC 2018


 sal/rtl/locale.cxx |   20 ++++++++++++--------
 sal/util/sal.map   |    7 -------
 2 files changed, 12 insertions(+), 15 deletions(-)

New commits:
commit 4464f851a34fb000673e54a3f7d6395682d53003
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Sep 13 21:54:31 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Sep 14 07:26:09 2018 +0200

    These rtl_hash* functions appear to never have been exported from sal
    
    They were introduced with 9399c662f36c385b0c705eb34e636a9aec450282 "initial
    import" without any trace of being exported DLLPUBLIC-style, and were probably
    included in error in the initial sal/util/sal.map when that was introduced in
    92b0714c409bd3cffcefd338371ee000fa1b5805 "new".
    
    That means the functions themselves can be moved from extern "C" to an unnamed
    namespace (and the resulting loplugin:salbool warnings be fixed).
    
    Change-Id: Ida99540edce9560e69081f507e41db2af34966fb
    Reviewed-on: https://gerrit.libreoffice.org/60469
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sal/rtl/locale.cxx b/sal/rtl/locale.cxx
index 3fb85e1b8bb7..579538f056f3 100644
--- a/sal/rtl/locale.cxx
+++ b/sal/rtl/locale.cxx
@@ -47,7 +47,9 @@ static RTL_HASHTABLE* g_pLocaleTable = nullptr;
 
 static rtl_Locale* g_pDefaultLocale = nullptr;
 
-extern "C" void rtl_hashentry_destroy(RTL_HASHENTRY* entry)
+namespace {
+
+void rtl_hashentry_destroy(RTL_HASHENTRY* entry)
 {
     rtl_uString_release(entry->Entry->Language);
     rtl_uString_release(entry->Entry->Country);
@@ -60,7 +62,7 @@ extern "C" void rtl_hashentry_destroy(RTL_HASHENTRY* entry)
     free(entry);
 }
 
-extern "C" void rtl_hashtable_destroy(RTL_HASHTABLE* table)
+void rtl_hashtable_destroy(RTL_HASHTABLE* table)
 {
     sal_Int32 size = 0;
 
@@ -81,7 +83,7 @@ extern "C" void rtl_hashtable_destroy(RTL_HASHTABLE* table)
     free(table);
 }
 
-extern "C" void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex)
+void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex)
 {
     sal_Int32 nSize = RTL_HASHTABLE_SIZE[sizeIndex];
 
@@ -102,14 +104,14 @@ extern "C" void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex)
     }
 }
 
-extern "C" sal_Int32 rtl_hashfunc(RTL_HASHTABLE* table, sal_Int32 key)
+sal_Int32 rtl_hashfunc(RTL_HASHTABLE* table, sal_Int32 key)
 {
     return (static_cast<sal_uInt32>(key) % table->Size);
 }
 
-extern "C" sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table);
+bool rtl_hashtable_grow(RTL_HASHTABLE** table);
 
-extern "C" rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* value)
+rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* value)
 {
     sal_Int32 key = 0;
 
@@ -138,7 +140,7 @@ extern "C" rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* valu
     return nullptr;
 }
 
-sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table)
+bool rtl_hashtable_grow(RTL_HASHTABLE** table)
 {
     RTL_HASHTABLE* pNewTable = nullptr;
     sal_Int32 i = 0;
@@ -175,7 +177,7 @@ sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table)
     return true;
 }
 
-extern "C" sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hashCode, rtl_Locale** pValue)
+bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hashCode, rtl_Locale** pValue)
 {
     if (!table)
         return false;
@@ -202,6 +204,8 @@ extern "C" sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal
     return true;
 }
 
+}
+
 void rtl_locale_init()
 {
     OSL_ASSERT(!g_pLocaleTable);
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 86ad07525ee6..07150ab0340d 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -196,13 +196,6 @@ UDK_3_0_0 {
         rtl_reallocateMemory;
         rtl_zeroMemory;
         rtl_findInMemory;
-        rtl_hashentry_destroy;
-        rtl_hashfunc;
-        rtl_hashtable_add;
-        rtl_hashtable_destroy;
-        rtl_hashtable_find;
-        rtl_hashtable_grow;
-        rtl_hashtable_init;
         rtl_locale_equals;
         rtl_locale_getCountry;
         rtl_locale_getDefault;


More information about the Libreoffice-commits mailing list