fix warnings and problems detected by gcc 4.3 / Lenny
This commit is contained in:
parent
b6fb135398
commit
f75bb233ba
6 changed files with 40 additions and 23 deletions
|
|
@ -101,7 +101,11 @@ namespace lumiera {
|
|||
ifa->version,
|
||||
ifa->name));
|
||||
}
|
||||
|
||||
} // (End) impl details
|
||||
|
||||
|
||||
namespace facade {
|
||||
|
||||
/**
|
||||
* @internal Helper/Adapter for establishing a link
|
||||
|
|
@ -113,13 +117,13 @@ namespace lumiera {
|
|||
* when destroying the InstanceHandle, the proxy will be closed.
|
||||
*/
|
||||
template<class I, class FA>
|
||||
struct FacadeLink
|
||||
struct Link
|
||||
: boost::noncopyable
|
||||
{
|
||||
typedef InstanceHandle<I,FA> IH;
|
||||
|
||||
FacadeLink (IH const& iha) { facade::openProxy(iha); }
|
||||
~FacadeLink() { facade::closeProxy<IH>(); }
|
||||
Link (IH const& iha) { facade::openProxy(iha); }
|
||||
~Link() { facade::closeProxy<IH>(); }
|
||||
|
||||
FA&
|
||||
operator() (IH const&) const
|
||||
|
|
@ -132,16 +136,16 @@ namespace lumiera {
|
|||
/**
|
||||
* @internal when the InstanceHandle isn't associated with a
|
||||
* facade interface, then this specialisation switches
|
||||
* the FacadeLink into "NOP" mode.
|
||||
* the facade::Link into "NOP" mode.
|
||||
*/
|
||||
template<class I>
|
||||
struct FacadeLink<I,I>
|
||||
struct Link<I,I>
|
||||
: boost::noncopyable
|
||||
{
|
||||
typedef InstanceHandle<I,I> IH;
|
||||
|
||||
FacadeLink (IH const&) { /* NOP */ }
|
||||
~FacadeLink() { /* NOP */ }
|
||||
Link (IH const&) { /* NOP */ }
|
||||
~Link() { /* NOP */ }
|
||||
|
||||
I&
|
||||
operator() (IH const& handle) const
|
||||
|
|
@ -150,7 +154,7 @@ namespace lumiera {
|
|||
}
|
||||
};
|
||||
|
||||
} // (End) impl details
|
||||
} // namespace facade (impl details)
|
||||
|
||||
|
||||
|
||||
|
|
@ -174,7 +178,7 @@ namespace lumiera {
|
|||
{
|
||||
LumieraInterface desc_;
|
||||
I* instance_;
|
||||
FacadeLink<I,FA> facadeLink_;
|
||||
facade::Link<I,FA> facadeLink_;
|
||||
|
||||
typedef InstanceHandle<I,FA> _ThisType;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace lumiera {
|
|||
protected:
|
||||
typedef InstanceHandle<I,FA> IHandle;
|
||||
typedef Holder<IHandle> THolder;
|
||||
typedef Proxy<IHandle> Proxy;
|
||||
typedef Proxy<IHandle> TProxy;
|
||||
typedef Accessor<FA> Access;
|
||||
|
||||
I& _i_;
|
||||
|
|
@ -69,10 +69,10 @@ namespace lumiera {
|
|||
{ }
|
||||
|
||||
public:
|
||||
static Proxy& open(IHandle const& iha)
|
||||
static TProxy& open(IHandle const& iha)
|
||||
{
|
||||
static char buff[sizeof(Proxy)];
|
||||
Proxy* p = new(buff) Proxy(iha);
|
||||
static char buff[sizeof(TProxy)];
|
||||
TProxy* p = new(buff) TProxy(iha);
|
||||
Access::implProxy_ = p;
|
||||
return *p;
|
||||
}
|
||||
|
|
@ -80,9 +80,9 @@ namespace lumiera {
|
|||
static void close()
|
||||
{
|
||||
if (!Access::implProxy_) return;
|
||||
Proxy* p = static_cast<Proxy*> (Access::implProxy_);
|
||||
TProxy* p = static_cast<TProxy*> (Access::implProxy_);
|
||||
Access::implProxy_ = 0;
|
||||
p->~Proxy();
|
||||
p->~TProxy();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -162,10 +162,12 @@ namespace lumiera {
|
|||
bool started = susy->start (opts_, bind (&SubsystemRunner::sigTerm, this, susy, _1));
|
||||
|
||||
if (started)
|
||||
if (susy->isRunning())
|
||||
running_.push_back (susy); // now responsible for managing the started subsystem
|
||||
else
|
||||
throw error::Logic("Subsystem "+string(*susy)+" failed to start");
|
||||
{
|
||||
if (susy->isRunning())
|
||||
running_.push_back (susy); // now responsible for managing the started subsystem
|
||||
else
|
||||
throw error::Logic("Subsystem "+string(*susy)+" failed to start");
|
||||
}
|
||||
|
||||
if (!and_all (susy->getPrerequisites(), isRunning() ))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#define GTK_LUMIERA_HPP
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <nobug.h>
|
||||
#include <nobug.h> // need to include this after gtkmm.h, because types.h from GTK tries to shaddow the ERROR macro from windows, which kills NoBug's ERROR macro
|
||||
#include <vector>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
|
|
|||
|
|
@ -45,8 +45,9 @@
|
|||
** @see gui::GtkLumiera#main the GTK GUI main
|
||||
*/
|
||||
|
||||
#include <locale> // need to include this to prevent errors when libintl.h defines textdomain (because gtk-lumiera removes the def when ENABLE_NLS isn't defined)
|
||||
|
||||
#include "gui/gtk-lumiera.hpp"
|
||||
#include "gui/gtk-lumiera.hpp" // need to include this before nobugcfg.h, because types.h from GTK tries to shaddow the ERROR macro from windows, which kills nobug's ERROR macro
|
||||
#include "include/nobugcfg.h"
|
||||
#include "lib/error.hpp"
|
||||
#include "gui/guifacade.hpp"
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ namespace lumiera {
|
|||
|| "throw"==startSpec;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm termination)
|
||||
{
|
||||
|
|
@ -282,8 +283,8 @@ namespace lumiera {
|
|||
MockSys unit4 ("U4", "start(true), run(false).");
|
||||
SubsystemRunner runner(dummyOpt);
|
||||
|
||||
runner.maybeRun (unit1);
|
||||
runner.maybeRun (unit4);
|
||||
runner.maybeRun (unit1); // this one doesn't start at all, which isn't considered an error
|
||||
|
||||
try
|
||||
{
|
||||
runner.maybeRun (unit2);
|
||||
|
|
@ -302,6 +303,15 @@ namespace lumiera {
|
|||
{
|
||||
ASSERT (lumiera_error() == error::LUMIERA_ERROR_LOGIC); // incorrect behaviour trapped
|
||||
}
|
||||
try
|
||||
{
|
||||
runner.maybeRun (unit4);
|
||||
NOTREACHED;
|
||||
}
|
||||
catch (lumiera::Error&)
|
||||
{
|
||||
ASSERT (lumiera_error() == error::LUMIERA_ERROR_LOGIC); // detected that the subsystem didn't come up
|
||||
}
|
||||
|
||||
|
||||
bool emergency = runner.wait();
|
||||
|
|
|
|||
Loading…
Reference in a new issue