fixes for g++ 4.5 (some members returned "the constructor, not the type")
tho [Mon, 14 Feb 2011 10:36:53 +0000 (10:36 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1770 270642c3-0616-0410-b53a-bc976706d245

senf/PPI/ModuleManager.cci
senf/Scheduler/TimerEventProxy.test.cc
senf/Socket/FileHandle.cci
senf/Socket/Protocols/Raw/MACAddress.cc
senf/Socket/Protocols/Raw/MACAddress.ct
senf/Socket/Protocols/UN/UNAddressing.cci
senf/Utils/Logger/Target.cc

index e718754..8ab0b1f 100644 (file)
@@ -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();
index ed39af8..7b9c8a9 100644 (file)
 
 #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<int> timers ("unit-test");
+        scheduler::TimerEventProxy<int> 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);
     }
 }
 
index b23b3e4..5842237 100644 (file)
@@ -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;
 }
index f420543..121b0be 100644 (file)
@@ -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());
index 1238589..4aaefa7 100644 (file)
@@ -35,7 +35,7 @@
 // senf::MACAddress
 
 template <class InputIterator>
-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());
index 2ef629d..f270c84 100644 (file)
@@ -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;
index 2884449..08b2ab4 100644 (file)
@@ -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();