[Libreoffice-commits] core.git: 3 commits - sal/osl sw/qa unoidl/source

Stephan Bergmann sbergman at redhat.com
Thu Oct 10 05:27:28 PDT 2013


 sal/osl/unx/thread.c                             |   10 +---------
 sal/osl/w32/thread.c                             |    9 +--------
 sw/qa/extras/inc/swmodeltestbase.hxx             |    8 ++++----
 unoidl/source/sourceprovider-parser-requires.hxx |   14 ++++++++++----
 unoidl/source/sourceprovider-scanner.hxx         |    9 +++++++--
 5 files changed, 23 insertions(+), 27 deletions(-)

New commits:
commit 215269e3031e31fd64e3aa38167875a042b8c80c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Oct 10 14:26:54 2013 +0200

    Silence some false Covertiy scan warnings about uninitialized members
    
    Change-Id: I5e1d870a60f4c0d4b805c615d0e3c958e856bf8c

diff --git a/unoidl/source/sourceprovider-parser-requires.hxx b/unoidl/source/sourceprovider-parser-requires.hxx
index 9865720..f9cd27e 100644
--- a/unoidl/source/sourceprovider-parser-requires.hxx
+++ b/unoidl/source/sourceprovider-parser-requires.hxx
@@ -85,13 +85,18 @@ struct SourceProviderType {
         TYPE_INTERFACE, TYPE_INSTANTIATED_POLYMORPHIC_STRUCT, TYPE_PARAMETER
     };
 
-    SourceProviderType() {}
+    SourceProviderType():
+        type(), entity() // avoid false warnings about uninitialized members
+    {}
 
-    explicit SourceProviderType(Type theType): type(theType)
+    explicit SourceProviderType(Type theType):
+        type(theType),
+        entity() // avoid false warnings about uninitialized member
     { assert(theType <= TYPE_ANY); }
 
     explicit SourceProviderType(SourceProviderType const * componentType):
-        type(TYPE_SEQUENCE)
+        type(TYPE_SEQUENCE),
+        entity() // avoid false warnings about uninitialized member
     { assert(componentType != 0); subtypes.push_back(*componentType); }
 
     SourceProviderType(
@@ -113,7 +118,8 @@ struct SourceProviderType {
     { assert(theEntity != 0); }
 
     explicit SourceProviderType(OUString const & identifier):
-        type(TYPE_PARAMETER), name(identifier)
+        type(TYPE_PARAMETER), name(identifier),
+        entity() // avoid false warnings about uninitialized member
     {}
 
     OUString getName() const;
diff --git a/unoidl/source/sourceprovider-scanner.hxx b/unoidl/source/sourceprovider-scanner.hxx
index ed5105f..c1959a7 100644
--- a/unoidl/source/sourceprovider-scanner.hxx
+++ b/unoidl/source/sourceprovider-scanner.hxx
@@ -233,7 +233,9 @@ struct SourceProviderEntity {
     explicit SourceProviderEntity(Kind theKind): kind(theKind)
     { assert(theKind >= KIND_INTERFACE_DECL); }
 
-    SourceProviderEntity() {} // needed for std::map::operator []
+    SourceProviderEntity(): // needed for std::map::operator []
+        kind() // avoid false warnings about uninitialized members
+    {}
 
     Kind kind;
     rtl::Reference<unoidl::Entity> entity;
@@ -243,7 +245,10 @@ struct SourceProviderEntity {
 struct SourceProviderScannerData {
     SourceProviderScannerData(
         rtl::Reference<unoidl::Manager> const & theManager):
-        manager(theManager), errorLine(0)
+        manager(theManager),
+        sourcePosition(), sourceEnd(),
+            // avoid false warnings about uninitialized members
+        errorLine(0)
     { assert(manager.is()); }
 
     void setSource(void const * address, sal_uInt64 size) {
commit acbe968ef0d40fb90e0f839e3e2702a43a0ae703
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Oct 10 14:26:06 2013 +0200

    Minor improvements
    
    Change-Id: I1dfe57368f438087d6e6131d36128db4438792eb

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 81a4aa2..29f4dc1 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -161,18 +161,18 @@ protected:
     }
 
     template< typename T >
-    T getProperty( uno::Any obj, const OUString& name ) const
+    T getProperty( const uno::Any& obj, const OUString& name ) const
     {
-        uno::Reference< beans::XPropertySet > properties( obj, uno::UNO_QUERY );
+        uno::Reference< beans::XPropertySet > properties( obj, uno::UNO_QUERY_THROW );
         T data = T();
         properties->getPropertyValue( name ) >>= data;
         return data;
     }
 
     template< typename T >
-    T getProperty( uno::Reference< uno::XInterface > obj, const OUString& name ) const
+    T getProperty( const uno::Reference< uno::XInterface >& obj, const OUString& name ) const
     {
-        uno::Reference< beans::XPropertySet > properties( obj, uno::UNO_QUERY );
+        uno::Reference< beans::XPropertySet > properties( obj, uno::UNO_QUERY_THROW );
         T data = T();
         properties->getPropertyValue( name ) >>= data;
         return data;
commit 668c627eb4e66208738d5acdecbcad106efa8252
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Oct 10 14:22:54 2013 +0200

    Remove support for undocumented SOLAR_USER_RTL_TEXTENCODING env var
    
    ...introduced in 2001 with a Sun-internal bug ID as
    3b1d10acc297db493b1f4e1999f6ba71f72db7f1 and
    54007bb90c30469a5357c56056b8fdba3a233e24 "#84715# osl_getThreadTextEncoding
    first defaults to contents of environment variable SOLAR_USER_RTL_TEXTENCODING."
    
    Change-Id: I991b4777c27a24419bf066cf41b3c4545d0fa681

diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c
index 598fd92..3b09d3f 100644
--- a/sal/osl/unx/thread.c
+++ b/sal/osl/unx/thread.c
@@ -951,19 +951,11 @@ sal_Bool SAL_CALL osl_setThreadKeyData(oslThreadKey Key, void *pData)
 /*****************************************************************************/
 static void osl_thread_textencoding_init_Impl (void)
 {
-    rtl_TextEncoding defaultEncoding;
-    const char *     pszEncoding;
-
     /* create thread specific data key */
     pthread_key_create (&(g_thread.m_textencoding.m_key), NULL);
 
     /* determine default text encoding */
-    pszEncoding = getenv ("SOLAR_USER_RTL_TEXTENCODING");
-    if (pszEncoding)
-        defaultEncoding = atoi(pszEncoding);
-    else
-        defaultEncoding = osl_getTextEncodingFromLocale(NULL);
-
+    rtl_TextEncoding defaultEncoding = osl_getTextEncodingFromLocale(NULL);
     OSL_ASSERT(defaultEncoding != RTL_TEXTENCODING_DONTKNOW);
 
     /*
diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c
index d4dbc7f..0bb7172 100644
--- a/sal/osl/w32/thread.c
+++ b/sal/osl/w32/thread.c
@@ -576,16 +576,9 @@ rtl_TextEncoding SAL_CALL osl_getThreadTextEncoding(void)
     _encoding = LOWORD(dwEncoding);
     gotACP = HIWORD(dwEncoding);
 
-
     if ( !gotACP )
     {
-        char    *pszEncoding;
-
-        if ( NULL != (pszEncoding = getenv( "SOLAR_USER_RTL_TEXTENCODING" )) )
-            _encoding = (rtl_TextEncoding)atoi(pszEncoding);
-        else
-            _encoding = rtl_getTextEncodingFromWindowsCodePage( GetACP() );
-
+        _encoding = rtl_getTextEncodingFromWindowsCodePage( GetACP() );
         TlsSetValue( g_dwTLSTextEncodingIndex, (LPVOID)(DWORD_PTR)MAKELONG( _encoding, TRUE ) );
     }
 


More information about the Libreoffice-commits mailing list