summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-10-18 23:05:58 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-10-18 23:10:56 +0200
commitbf1f0183d5c6b4c94acdbee27276d5a386a657f4 (patch)
tree3d4d60a59f935ee11011ebea33ccb6d9fab5063c
parent0eee1cf957d122ac0d805a9589a5db075a94e4a1 (diff)
Some fixes for "clang version 3.1 (trunk 142234)" (with --enable-werror, on Linux x86_64).
-rw-r--r--autodoc/source/inc/estack.hxx6
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx5
-rw-r--r--codemaker/source/javamaker/javatype.cxx8
-rw-r--r--cosv/inc/cosv/tpl/vvector.hxx2
-rw-r--r--cppu/qa/cppumaker/test_cppumaker.cxx44
-rw-r--r--cppu/qa/test_unotype.cxx2
-rw-r--r--cppuhelper/inc/cppuhelper/propertysetmixin.hxx2
-rw-r--r--l10ntools/source/export2.cxx14
-rw-r--r--rsc/inc/rscerror.h2
-rw-r--r--rsc/source/rscpp/cpp1.c2
-rw-r--r--sal/inc/rtl/allocator.hxx3
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx1
-rw-r--r--sdext/source/presenter/PresenterTimer.cxx4
-rw-r--r--svl/source/misc/urihelper.cxx60
-rw-r--r--testtools/source/bridgetest/bridgetest.cxx5
-rw-r--r--testtools/source/bridgetest/cppobj.cxx19
-rw-r--r--unotest/inc/unotest/oustringostreaminserter.hxx4
17 files changed, 76 insertions, 107 deletions
diff --git a/autodoc/source/inc/estack.hxx b/autodoc/source/inc/estack.hxx
index 1cb5855a1122..3eb5b838dbf3 100644
--- a/autodoc/source/inc/estack.hxx
+++ b/autodoc/source/inc/estack.hxx
@@ -63,12 +63,10 @@ class EStack : private std::list<ELEM>
{ base::operator=( i_rStack.Base() );
return *this; }
bool operator==(
- const EStack<ELEM> &
- i_r2 ) const
+ const EStack<ELEM> & ) const
{ return std::operator==( Base(), this->i_rStack.Base() ); }
bool operator<(
- const EStack<ELEM> &
- i_r2 ) const
+ const EStack<ELEM> & ) const
{ return std::operator<( Base(), this->i_rStack.Base() ); }
// OPERATIONS
void push(
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
index c830f877ccf2..a34d77f121b4 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
@@ -151,9 +151,8 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
"movq %%rdx, %5\n\t"
"movsd %%xmm0, %6\n\t"
"movsd %%xmm1, %7\n\t"
- :
- : "m" ( pMethod ), "m" ( pGPR ), "m" ( pFPR ), "m" ( nFPR ),
- "m" ( rax ), "m" ( rdx ), "m" ( xmm0 ), "m" ( xmm1 )
+ : "=m" ( rax ), "=m" ( rdx ), "=m" ( xmm0 ), "=m" ( xmm1 )
+ : "m" ( pMethod ), "m" ( pGPR ), "m" ( pFPR ), "m" ( nFPR )
: "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r11"
);
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 0d534526b3fb..805ad4ca7ad7 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -67,14 +67,6 @@ using codemaker::javamaker::ClassFile;
namespace {
-void checkNoTypeArguments(std::vector< rtl::OString > const & arguments) {
- if (!arguments.empty()) {
- throw CannotDumpException(
- rtl::OString(RTL_CONSTASCII_STRINGPARAM("Bad type information")));
- //TODO
- }
-}
-
// helper function for createUnoName
void appendUnoName(
TypeManager const & manager, rtl::OString const & nucleus, sal_Int32 rank,
diff --git a/cosv/inc/cosv/tpl/vvector.hxx b/cosv/inc/cosv/tpl/vvector.hxx
index 9832615f9f71..d9f43a253823 100644
--- a/cosv/inc/cosv/tpl/vvector.hxx
+++ b/cosv/inc/cosv/tpl/vvector.hxx
@@ -79,7 +79,7 @@ struct delete_ptrs
template <class TYPE>
struct keep_ptrs
{
- static void Destruct(std::vector< TYPE* > & v)
+ static void Destruct(std::vector< TYPE* > &)
{}
static void Erase(
diff --git a/cppu/qa/cppumaker/test_cppumaker.cxx b/cppu/qa/cppumaker/test_cppumaker.cxx
index 141c3e2fd1d7..11435e544b9a 100644
--- a/cppu/qa/cppumaker/test_cppumaker.cxx
+++ b/cppu/qa/cppumaker/test_cppumaker.cxx
@@ -380,6 +380,7 @@
//TODO, copied here from test/oustringostreaminserter.hxx, make DRY again:
#include "osl/thread.h"
+namespace rtl {
template< typename charT, typename traits > std::basic_ostream<charT, traits> &
operator <<(
std::basic_ostream<charT, traits> & stream, rtl::OUString const & string)
@@ -389,6 +390,30 @@ operator <<(
// best effort; potentially loses data due to conversion failures and
// embedded null characters
}
+}
+
+namespace com { namespace sun { namespace star { namespace uno {
+
+std::ostream & operator <<(
+ std::ostream & out, com::sun::star::uno::Exception const &)
+{
+ return out << "<UNO exception>";
+}
+
+} } } }
+
+namespace test { namespace codemaker { namespace cppumaker {
+
+bool operator ==(
+ test::codemaker::cppumaker::TestException1 const & e1,
+ test::codemaker::cppumaker::TestException1 const & e2)
+{
+ return e1.Message == e2.Message && e1.Context == e2.Context
+ && e1.m1 == e2.m1 && e1.m2 == e2.m2 && e1.m3 == e2.m3
+ && e1.m4.member1 == e2.m4.member1 && e1.m4.member2 == e2.m4.member2;
+}
+
+} } }
namespace {
@@ -503,25 +528,6 @@ void Test::testPolyStruct() {
static_cast< sal_uInt32 >(5));
}
-namespace {
-
-bool operator ==(
- test::codemaker::cppumaker::TestException1 const & e1,
- test::codemaker::cppumaker::TestException1 const & e2)
-{
- return e1.Message == e2.Message && e1.Context == e2.Context
- && e1.m1 == e2.m1 && e1.m2 == e2.m2 && e1.m3 == e2.m3
- && e1.m4.member1 == e2.m4.member1 && e1.m4.member2 == e2.m4.member2;
-}
-
-std::ostream & operator <<(
- std::ostream & out, com::sun::star::uno::Exception const &)
-{
- return out << "<UNO exception>";
-}
-
-}
-
void Test::testExceptions() {
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >
aEmptySequence;
diff --git a/cppu/qa/test_unotype.cxx b/cppu/qa/test_unotype.cxx
index 110ae204095c..dbb13d6b1d1f 100644
--- a/cppu/qa/test_unotype.cxx
+++ b/cppu/qa/test_unotype.cxx
@@ -61,6 +61,7 @@
//TODO, copied here from test/oustringostreaminserter.hxx, make DRY again:
#include "osl/thread.h"
+namespace rtl {
template< typename charT, typename traits > std::basic_ostream<charT, traits> &
operator <<(
std::basic_ostream<charT, traits> & stream, rtl::OUString const & string)
@@ -70,6 +71,7 @@ operator <<(
// best effort; potentially loses data due to conversion failures and
// embedded null characters
}
+}
namespace com { namespace sun { namespace star { namespace uno {
class Any;
diff --git a/cppuhelper/inc/cppuhelper/propertysetmixin.hxx b/cppuhelper/inc/cppuhelper/propertysetmixin.hxx
index 6ab242f111a0..f23aec1dcb35 100644
--- a/cppuhelper/inc/cppuhelper/propertysetmixin.hxx
+++ b/cppuhelper/inc/cppuhelper/propertysetmixin.hxx
@@ -477,7 +477,7 @@ protected:
private:
PropertySetMixin(PropertySetMixin &); // not defined
- void operator =(PropertySetMixin); // not defined
+ void operator =(PropertySetMixin &); // not defined
};
#if defined _MSC_VER
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index 60ca704c44f8..26f99b59e7c8 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -198,18 +198,10 @@ void Export::RemoveUTF8ByteOrderMarker( ByteString &rString ){
}
bool Export::hasUTF8ByteOrderMarker( const ByteString &rString ){
- // Byte order marker signature
-
- const unsigned char c1 = 0xEF;
- const unsigned char c2 = 0xBB;
- const unsigned char c3 = 0xBF;
-
- const char bom[ 3 ] = { c1 , c2 , c3 };
-
return rString.Len() >= 3 &&
- rString.GetChar( 0 ) == bom[ 0 ] &&
- rString.GetChar( 1 ) == bom[ 1 ] &&
- rString.GetChar( 2 ) == bom[ 2 ] ;
+ rString.GetChar( 0 ) == '\xEF' &&
+ rString.GetChar( 1 ) == '\xBB' &&
+ rString.GetChar( 2 ) == '\xBF' ;
}
bool Export::fileHasUTF8ByteOrderMarker( const ByteString &rString ){
SvFileStream aFileIn( String( rString , RTL_TEXTENCODING_ASCII_US ) , STREAM_READ );
diff --git a/rsc/inc/rscerror.h b/rsc/inc/rscerror.h
index bc1516a73c41..fc494c09d1d7 100644
--- a/rsc/inc/rscerror.h
+++ b/rsc/inc/rscerror.h
@@ -136,6 +136,8 @@ class RscError
void ErrorFormat( const ERRTYPE& rError, RscTop * pClass,
const RscId & aId );
public:
+ virtual ~RscError() {}
+
sal_uInt32 nErrors;// Anzahl der Fehler
RscError( RscVerbosity _verbosity ) {
fListing = NULL;
diff --git a/rsc/source/rscpp/cpp1.c b/rsc/source/rscpp/cpp1.c
index 014a14b1e65d..fbac898b7ed4 100644
--- a/rsc/source/rscpp/cpp1.c
+++ b/rsc/source/rscpp/cpp1.c
@@ -466,7 +466,7 @@ void cppmain()
unget(); /* Reread the char. */
for (;;) { /* For the whole line, */
do { /* Token concat. loop */
- for (counter = 0; (type[(c = get())] == SPA);) {
+ for (counter = 0; type[(c = get())] == SPA;) {
#if COMMENT_INVISIBLE
if (c != COM_SEP)
counter++;
diff --git a/sal/inc/rtl/allocator.hxx b/sal/inc/rtl/allocator.hxx
index 5b27beec8259..c19d8d2cb3e2 100644
--- a/sal/inc/rtl/allocator.hxx
+++ b/sal/inc/rtl/allocator.hxx
@@ -125,9 +125,8 @@ public:
are not enabled, e.g. GCC under Linux and it is
in general not desired to compile sal with exceptions
enabled. */
- pointer allocate (size_type n, const void* hint = 0)
+ pointer allocate (size_type n, const void* = 0)
{
- hint = hint; /* avoid warnings */
return reinterpret_cast<pointer>(
rtl_allocateMemory(sal_uInt32(n * sizeof(T))));
}
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index 7c4829ac81fd..a7d5081a2c35 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -66,6 +66,7 @@ namespace {
class Command
{
public:
+ virtual ~Command() {}
virtual void Execute (void) = 0;
virtual bool IsEnabled (void) const = 0;
virtual Any GetState (void) const = 0;
diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx
index 74517944f5e8..4668cddf570a 100644
--- a/sdext/source/presenter/PresenterTimer.cxx
+++ b/sdext/source/presenter/PresenterTimer.cxx
@@ -128,10 +128,6 @@ private:
virtual void SAL_CALL onTerminated (void);
};
-
-
-
-bool GetDateTime (oslDateTime& rDateTime);
} // end of anonymous namespace
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 1bef290f3dfd..937019f26339 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -74,35 +74,21 @@ using namespace com::sun::star;
//
//============================================================================
-namespace {
-
-inline UniString toUniString(ByteString const & rString)
-{
- return UniString(rString, RTL_TEXTENCODING_ISO_8859_1);
-}
-
-inline UniString toUniString(UniString const & rString)
-{
- return rString;
-}
-
-template< typename Str >
-inline UniString SmartRel2Abs_Impl(INetURLObject const & rTheBaseURIRef,
- Str const & rTheRelURIRef,
- Link const & rMaybeFileHdl,
- bool bCheckFileExists,
- bool bIgnoreFragment,
- INetURLObject::EncodeMechanism
- eEncodeMechanism,
- INetURLObject::DecodeMechanism
- eDecodeMechanism,
- rtl_TextEncoding eCharset,
- bool bRelativeNonURIs,
- INetURLObject::FSysStyle eStyle)
+UniString
+URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
+ UniString const & rTheRelURIRef,
+ Link const & rMaybeFileHdl,
+ bool bCheckFileExists,
+ bool bIgnoreFragment,
+ INetURLObject::EncodeMechanism eEncodeMechanism,
+ INetURLObject::DecodeMechanism eDecodeMechanism,
+ rtl_TextEncoding eCharset,
+ bool bRelativeNonURIs,
+ INetURLObject::FSysStyle eStyle)
{
// Backwards compatibility:
if (rTheRelURIRef.Len() != 0 && rTheRelURIRef.GetChar(0) == '#')
- return toUniString(rTheRelURIRef);
+ return rTheRelURIRef;
INetURLObject aAbsURIRef;
if (rTheBaseURIRef.HasError())
@@ -133,7 +119,7 @@ inline UniString SmartRel2Abs_Impl(INetURLObject const & rTheBaseURIRef,
bool bMaybeFile = false;
if (rMaybeFileHdl.IsSet())
{
- UniString aFilePath(toUniString(rTheRelURIRef));
+ UniString aFilePath(rTheRelURIRef);
bMaybeFile = rMaybeFileHdl.Call(&aFilePath) != 0;
}
if (!bMaybeFile)
@@ -144,26 +130,6 @@ inline UniString SmartRel2Abs_Impl(INetURLObject const & rTheBaseURIRef,
return aAbsURIRef.GetMainURL(eDecodeMechanism, eCharset);
}
-}
-
-UniString
-URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
- UniString const & rTheRelURIRef,
- Link const & rMaybeFileHdl,
- bool bCheckFileExists,
- bool bIgnoreFragment,
- INetURLObject::EncodeMechanism eEncodeMechanism,
- INetURLObject::DecodeMechanism eDecodeMechanism,
- rtl_TextEncoding eCharset,
- bool bRelativeNonURIs,
- INetURLObject::FSysStyle eStyle)
-{
- return SmartRel2Abs_Impl(rTheBaseURIRef, rTheRelURIRef, rMaybeFileHdl,
- bCheckFileExists, bIgnoreFragment,
- eEncodeMechanism, eDecodeMechanism, eCharset,
- bRelativeNonURIs, eStyle);
-}
-
//============================================================================
//
// SetMaybeFileHdl
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index a1bde57d438c..e777037c405e 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -657,10 +657,11 @@ static sal_Bool performTest(
sal_Int8 _arByte[] = { 1, 2, -1 };
sal_Int16 _arShort[] = { -0x8000, 1, 0x7FFF };
sal_uInt16 _arUShort[] = { 0 , 1, 0xFFFF };
- sal_Int32 _arLong[] = { 0x80000000, 1, 0x7FFFFFFF };
+ sal_Int32 _arLong[] = {
+ static_cast< sal_Int32 >(0x80000000), 1, 0x7FFFFFFF };
sal_uInt32 _arULong[] = { 0, 1, 0xFFFFFFFF };
sal_Int64 _arHyper[] = {
- SAL_CONST_INT64(0x8000000000000000), 1,
+ static_cast< sal_Int64 >(SAL_CONST_INT64(0x8000000000000000)), 1,
SAL_CONST_INT64(0x7FFFFFFFFFFFFFFF) };
sal_uInt64 _arUHyper[] = { 0, 1, SAL_CONST_UINT64(0xFFFFFFFFFFFFFFFF) };
float _arFloat[] = { 1.1f, 2.2f, 3.3f };
diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx
index da91ec80c4b1..5107e2358001 100644
--- a/testtools/source/bridgetest/cppobj.cxx
+++ b/testtools/source/bridgetest/cppobj.cxx
@@ -497,10 +497,22 @@ Any Test_Impl::transportAny( const Any & value ) throw ( ::com::sun::star::uno::
}
//__________________________________________________________________________________________________
+
+namespace {
+
+void wait(sal_Int32 microSeconds) {
+ OSL_ASSERT(microSeconds >= 0 && microSeconds <= SAL_MAX_INT32 / 1000);
+ TimeValue t = {
+ static_cast< sal_uInt32 >(microSeconds / 1000000),
+ static_cast< sal_uInt32 >(microSeconds * 1000) };
+ osl_waitThread(&t);
+}
+
+}
+
void Test_Impl::call( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw(::com::sun::star::uno::RuntimeException)
{
- TimeValue value = { nWaitMUSEC / 1000000 , nWaitMUSEC * 1000 };
- osl_waitThread( &value );
+ wait(nWaitMUSEC);
if( m_bFirstCall )
{
m_bFirstCall = sal_False;
@@ -515,8 +527,7 @@ void Test_Impl::call( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw(::com::su
//__________________________________________________________________________________________________
void Test_Impl::callOneway( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw (::com::sun::star::uno::RuntimeException)
{
- TimeValue value = { nWaitMUSEC / 1000000 , nWaitMUSEC * 1000 };
- osl_waitThread( &value );
+ wait(nWaitMUSEC);
m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed && (nCallId > m_nLastCallId);
m_nLastCallId = nCallId;
}
diff --git a/unotest/inc/unotest/oustringostreaminserter.hxx b/unotest/inc/unotest/oustringostreaminserter.hxx
index 2658cad31d67..143c3a5c262b 100644
--- a/unotest/inc/unotest/oustringostreaminserter.hxx
+++ b/unotest/inc/unotest/oustringostreaminserter.hxx
@@ -36,6 +36,8 @@
// Include this header to support rtl::OUString in CPPUNIT_ASSERT macros.
+namespace rtl {
+
template< typename charT, typename traits > std::basic_ostream<charT, traits> &
operator <<(
std::basic_ostream<charT, traits> & stream, rtl::OUString const & string)
@@ -46,6 +48,8 @@ operator <<(
// embedded null characters
}
+}
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */