diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-12-19 10:59:25 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-12-19 11:00:03 +0100 |
commit | 8ee1a76b735acd39861f13a0dbb9c56f8eec96f4 (patch) | |
tree | 2fd0c0481d26908460df741dab864e55f890331f | |
parent | f233f3973631c664e0953f04f88a58234390c088 (diff) |
-Werror=shadow and -Werror=sign-promo fixes
-rw-r--r-- | sal/osl/unx/thread.c | 26 | ||||
-rw-r--r-- | sal/osl/unx/time.c | 6 | ||||
-rw-r--r-- | sal/rtl/source/logfile.cxx | 2 | ||||
-rw-r--r-- | sal/textenc/convertbig5hkscs.c | 8 |
4 files changed, 33 insertions, 9 deletions
diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c index 520274305ed4..766cf0615244 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 31530be2195f..602fe64593c0 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 7a267eab9cd3..7229a5956fce 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 2237a96475d9..0839e56acee1 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)); |