[Libreoffice-commits] .: sal/osl sal/rtl sal/textenc

Stephan Bergmann sbergmann at kemper.freedesktop.org
Mon Dec 19 02:00:32 PST 2011


 sal/osl/unx/thread.c           |   26 ++++++++++++++++++++++++++
 sal/osl/unx/time.c             |    6 +++---
 sal/rtl/source/logfile.cxx     |    2 +-
 sal/textenc/convertbig5hkscs.c |    8 +++-----
 4 files changed, 33 insertions(+), 9 deletions(-)

New commits:
commit 8ee1a76b735acd39861f13a0dbb9c56f8eec96f4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Dec 19 10:59:25 2011 +0100

    -Werror=shadow and -Werror=sign-promo fixes

diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c
index 5202743..766cf06 100644
--- a/sal/osl/unx/thread.c
+++ b/sal/osl/unx/thread.c
@@ -247,7 +247,20 @@ static void* osl_thread_start_Impl (void* pData)
     pthread_mutex_lock (&(pImpl->m_Lock));
 
     /* install cleanup handler */
+#if defined __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Wshadow"
+#endif
+#endif
     pthread_cleanup_push (osl_thread_cleanup_Impl, pData);
+#if defined __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
+#endif
 
     /* request oslThreadIdentifier @@@ see TODO @@@ */
     pImpl->m_Ident = insertThreadId (pImpl->m_hThread);
@@ -261,7 +274,20 @@ static void* osl_thread_start_Impl (void* pData)
     while (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED)
     {
         /* wait until SUSPENDED flag is cleared */
+#if defined __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Wshadow"
+#endif
+#endif
         pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock));
+#if defined __GNUC__
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#pragma GCC diagnostic pop
+#endif
+#endif
         pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock));
         pthread_cleanup_pop (0);
     }
diff --git a/sal/osl/unx/time.c b/sal/osl/unx/time.c
index 31530be..602fe64 100644
--- a/sal/osl/unx/time.c
+++ b/sal/osl/unx/time.c
@@ -45,15 +45,15 @@
  * osl_getSystemTime
  *-------------------------------------------------*/
 
-sal_Bool SAL_CALL osl_getSystemTime(TimeValue* TimeValue)
+sal_Bool SAL_CALL osl_getSystemTime(TimeValue* tv)
 {
     struct timeval tp;
 
     /* FIXME: use higher resolution */
     gettimeofday(&tp, NULL);
 
-    TimeValue->Seconds = tp.tv_sec;
-    TimeValue->Nanosec = tp.tv_usec * 1000;
+    tv->Seconds = tp.tv_sec;
+    tv->Nanosec = tp.tv_usec * 1000;
 
     return (sal_True);
 }
diff --git a/sal/rtl/source/logfile.cxx b/sal/rtl/source/logfile.cxx
index 7a267ea..7229a59 100644
--- a/sal/rtl/source/logfile.cxx
+++ b/sal/rtl/source/logfile.cxx
@@ -185,7 +185,7 @@ void init() {
                 {
                     SAL_WARN(
                         "sal",
-                        "Couldn't open logfile " << o << '(' << e << ')');
+                        "Couldn't open logfile " << o << '(' << +e << ')');
                 }
             }
             g_bHasBeenCalled = sal_True;
diff --git a/sal/textenc/convertbig5hkscs.c b/sal/textenc/convertbig5hkscs.c
index 2237a96..0839e56 100644
--- a/sal/textenc/convertbig5hkscs.c
+++ b/sal/textenc/convertbig5hkscs.c
@@ -119,12 +119,10 @@ sal_Size ImplConvertBig5HkscsToUnicode(ImplTextConverterData const * pData,
                 }
                 if (nUnicode == 0xFFFF)
                 {
-                    sal_uInt32 nFirst = pBig5Data[nRow].mnTrailStart;
-                    if (nChar >= nFirst
-                        && nChar <= pBig5Data[nRow].mnTrailEnd)
+                    sal_uInt32 n = pBig5Data[nRow].mnTrailStart;
+                    if (nChar >= n && nChar <= pBig5Data[nRow].mnTrailEnd)
                     {
-                        nUnicode
-                            = pBig5Data[nRow].mpToUniTrailTab[nChar - nFirst];
+                        nUnicode = pBig5Data[nRow].mpToUniTrailTab[nChar - n];
                         if (nUnicode == 0)
                             nUnicode = 0xFFFF;
                         OSL_VERIFY(!ImplIsHighSurrogate(nUnicode));


More information about the Libreoffice-commits mailing list