From: tho Date: Mon, 14 Feb 2011 10:36:53 +0000 (+0000) Subject: fixes for g++ 4.5 (some members returned "the constructor, not the type") X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=93d9568d448749dc187e7622b733a4a3caa319df;p=senf.git fixes for g++ 4.5 (some members returned "the constructor, not the type") git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1770 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/PPI/ModuleManager.cci b/senf/PPI/ModuleManager.cci index e718754..8ab0b1f 100644 --- a/senf/PPI/ModuleManager.cci +++ b/senf/PPI/ModuleManager.cci @@ -116,8 +116,7 @@ prefix_ bool senf::ppi::ModuleManager::Initializable::initializationScheduled() return moduleManager().initializableRegistered(*this); } -prefix_ senf::ppi::ModuleManager::ModuleManager & -senf::ppi::ModuleManager::Initializable::moduleManager() +prefix_ senf::ppi::ModuleManager & senf::ppi::ModuleManager::Initializable::moduleManager() const { return ModuleManager::instance(); diff --git a/senf/Scheduler/TimerEventProxy.test.cc b/senf/Scheduler/TimerEventProxy.test.cc index ed39af8..7b9c8a9 100644 --- a/senf/Scheduler/TimerEventProxy.test.cc +++ b/senf/Scheduler/TimerEventProxy.test.cc @@ -36,19 +36,21 @@ #define prefix_ //-///////////////////////////////////////////////////////////////////////////////////////////////// +using namespace senf; + namespace { int mask = 0; - void handler( senf::ClockService::clock_type time, int const &id) + void handler(ClockService::clock_type time, int const &id) { mask = mask + id; } - void run(senf::ClockService::clock_type t) { - senf::scheduler::TimerEvent timeout( - "test-timeout", &senf::scheduler::terminate, senf::scheduler::now() + t); - senf::scheduler::process(); + void run(ClockService::clock_type t) { + scheduler::TimerEvent timeout( + "test-timeout", &scheduler::terminate, scheduler::now() + t); + scheduler::process(); } } @@ -56,30 +58,31 @@ namespace { SENF_AUTO_UNIT_TEST(timerEventProxy) { // // abort on watchdog timeout -// senf::scheduler::watchdogAbort( true); -// senf::scheduler::watchdogTimeout(5000); +// scheduler::watchdogAbort( true); +// scheduler::watchdogTimeout(5000); - senf::ClockService::clock_type t (senf::ClockService::now()); + ClockService::clock_type now (ClockService::now()); { - senf::scheduler::TimerEventProxy timers ("unit-test"); + scheduler::TimerEventProxy timers ("unit-test"); -// timers.add( t + senf::ClockService::milliseconds(10000), 0 , &handler); - timers.add( t + senf::ClockService::milliseconds(800), 4, &handler); - timers.add( t + senf::ClockService::milliseconds(200), 1, &handler); +// timers.add( t + ClockService::milliseconds(10000), 0 , &handler); + timers.add( now + ClockService::milliseconds(800), 4, &handler); + timers.add( now + ClockService::milliseconds(200), 1, &handler); BOOST_CHECK( timers.remove( 4)); BOOST_CHECK(! timers.remove( 4)); - timers.add( t + senf::ClockService::milliseconds(700), 2, &handler); + BOOST_CHECK_EQUAL( timers.timeout(4), 0); + timers.add( now + ClockService::milliseconds(700), 2, &handler); - BOOST_CHECK_EQUAL( timers.timeout(1), t + senf::ClockService::milliseconds(200)); - BOOST_CHECK_EQUAL( timers.timeout(2), t + senf::ClockService::milliseconds(700)); + BOOST_CHECK_EQUAL( timers.timeout(1), now + ClockService::milliseconds(200)); + BOOST_CHECK_EQUAL( timers.timeout(2), now + ClockService::milliseconds(700)); - timers.add( t + senf::ClockService::milliseconds(800), 2, &handler); - BOOST_CHECK_EQUAL( timers.timeout(2), t + senf::ClockService::milliseconds(800)); - BOOST_CHECK_EQUAL( timers.timeout(4), 0); + timers.add( now + ClockService::milliseconds(800), 2, &handler); + BOOST_CHECK_EQUAL( timers.timeout(2), now + ClockService::milliseconds(800)); + timers.add( now, 4, &handler); - run( senf::ClockService::milliseconds( 2000)); + run( ClockService::milliseconds( 2000)); - BOOST_CHECK( mask == 3); + BOOST_CHECK( mask == 7); } } diff --git a/senf/Socket/FileHandle.cci b/senf/Socket/FileHandle.cci index b23b3e4..5842237 100644 --- a/senf/Socket/FileHandle.cci +++ b/senf/Socket/FileHandle.cci @@ -227,8 +227,7 @@ prefix_ senf::FileBody & senf::FileHandle::body(FileHandle & handle) return handle.body(); } -prefix_ senf::FileBody const & -senf::FileHandle::body(FileHandle const & handle) +prefix_ senf::FileBody const & senf::FileHandle::body(FileHandle const & handle) { return handle.body(); } @@ -238,14 +237,12 @@ prefix_ void senf::FileHandle::fd(int fd) body().fd(fd); } -prefix_ senf::FileHandle::FileHandle -senf::FileHandle::cast_static(FileHandle handle) +prefix_ senf::FileHandle senf::FileHandle::cast_static(FileHandle handle) { return handle; } -prefix_ senf::FileHandle -senf::FileHandle::cast_dynamic(FileHandle handle) +prefix_ senf::FileHandle senf::FileHandle::cast_dynamic(FileHandle handle) { return handle; } diff --git a/senf/Socket/Protocols/Raw/MACAddress.cc b/senf/Socket/Protocols/Raw/MACAddress.cc index f420543..121b0be 100644 --- a/senf/Socket/Protocols/Raw/MACAddress.cc +++ b/senf/Socket/Protocols/Raw/MACAddress.cc @@ -42,7 +42,7 @@ //-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::MACAddress -prefix_ senf::MACAddress::MACAddress senf::MACAddress::from_string(std::string const & s) +prefix_ senf::MACAddress senf::MACAddress::from_string(std::string const & s) { MACAddress mac (senf::noinit); detail::parseHexString(s, ":-", mac.begin(), mac.end()); diff --git a/senf/Socket/Protocols/Raw/MACAddress.ct b/senf/Socket/Protocols/Raw/MACAddress.ct index 1238589..4aaefa7 100644 --- a/senf/Socket/Protocols/Raw/MACAddress.ct +++ b/senf/Socket/Protocols/Raw/MACAddress.ct @@ -35,7 +35,7 @@ // senf::MACAddress template -prefix_ senf::MACAddress::MACAddress senf::MACAddress::from_data(InputIterator i) +prefix_ senf::MACAddress senf::MACAddress::from_data(InputIterator i) { MACAddress mac (senf::noinit); senf::config::copy_n(i, 6, mac.begin()); diff --git a/senf/Socket/Protocols/UN/UNAddressing.cci b/senf/Socket/Protocols/UN/UNAddressing.cci index 2ef629d..f270c84 100644 --- a/senf/Socket/Protocols/UN/UNAddressing.cci +++ b/senf/Socket/Protocols/UN/UNAddressing.cci @@ -43,11 +43,11 @@ prefix_ senf::UNSocketAddress::UNSocketAddress(std::string const & p) path(p); } -prefix_ senf::UNSocketAddress::UNSocketAddress(const UNSocketAddress& other) +prefix_ senf::UNSocketAddress::UNSocketAddress(UNSocketAddress const & other) : BSDSocketAddress (other) {} -prefix_ senf::UNSocketAddress& senf::UNSocketAddress::operator=(const UNSocketAddress& other) +prefix_ senf::UNSocketAddress& senf::UNSocketAddress::operator=(UNSocketAddress const & other) { BSDSocketAddress::operator=(other); return *this; @@ -59,8 +59,7 @@ prefix_ std::string senf::UNSocketAddress::path() return std::string(addr_.sun_path, socklen()-sizeof(short)); } -prefix_ std::ostream & senf::operator<<(std::ostream & os, - senf::UNSocketAddress::UNSocketAddress const & addr) +prefix_ std::ostream & senf::operator<<(std::ostream & os, UNSocketAddress const & addr) { os << addr.path(); return os; diff --git a/senf/Utils/Logger/Target.cc b/senf/Utils/Logger/Target.cc index 2884449..08b2ab4 100644 --- a/senf/Utils/Logger/Target.cc +++ b/senf/Utils/Logger/Target.cc @@ -499,8 +499,7 @@ prefix_ void senf::log::detail::LogParameters::setDefaults() level = MESSAGE::value; } -prefix_ senf::log::detail::LogParameters::LogParameters -senf::log::detail::LogParameters::defaultParameters() +prefix_ senf::log::detail::LogParameters senf::log::detail::LogParameters::defaultParameters() { LogParameters pm; pm.clear();