fix warnings found by CLang (3.5)
Note: not fixing all relevant warnings. Especially, the "-Woverloaded-virtual" of Clang defeats the whole purpose of generated generic interfaces. For example, our Variant type is instantiated with a list of types the variant can hold. Through metaprogramming, this instantiation generates also an embedded Visitor interface, which has virtual 'handle(TY)' functions for all the types in question The client now may implement, or even partially implement this Visitor, to retrieve specific data out of given Variant instance with unknown conent. To complain that some other virtual overload is now shaddowed is besides the point, so we might consider to disable this warning altogether
This commit is contained in:
parent
266cce9abe
commit
9ff79b86cf
16 changed files with 41 additions and 14 deletions
|
|
@ -23,6 +23,7 @@
|
|||
/** @file timeline-widget.hpp
|
||||
** This file defines the core component of the Lumiera GUI
|
||||
**
|
||||
** @deprecated broken since transition to GTK-3
|
||||
** @todo needs to be reworked from ground as if 5/2015
|
||||
** GTK-3 uses different event handling callbacks,
|
||||
** so the existing implementation is defunct.
|
||||
|
|
@ -67,6 +68,7 @@ namespace widget {
|
|||
* Core timeline display (custom widget).
|
||||
* @remarks This widget is a composite of several widgets contained
|
||||
* within the timeline namespace.
|
||||
* @deprecated dysfunctional and broken by switch to GTK-3. Needs to be rewritten
|
||||
*/
|
||||
class TimelineWidget
|
||||
: public Gtk::Table
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ protected:
|
|||
|
||||
/**
|
||||
* The event handler for when the TimelineWidget's state is switched.
|
||||
* @deprecated needs to be rewritten from scratch for GTK-3
|
||||
*/
|
||||
void on_state_changed (shared_ptr<TimelineState> newState);
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ namespace diff{
|
|||
|
||||
using std::string;
|
||||
|
||||
class GenNode;
|
||||
struct GenNode;
|
||||
|
||||
using Rec = Record<GenNode>;
|
||||
using RecRef = RecordRef<GenNode>;
|
||||
|
|
@ -170,7 +170,7 @@ namespace diff{
|
|||
class ID
|
||||
: public idi::BareEntryID
|
||||
{
|
||||
friend class GenNode;
|
||||
friend struct GenNode;
|
||||
|
||||
template<typename X>
|
||||
ID (X*, string const& symbolicID)
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace diff{
|
|||
|
||||
namespace {
|
||||
template<class PAR>
|
||||
class Builder;
|
||||
struct Builder;
|
||||
|
||||
using ID = Literal;
|
||||
using Attribute = DataCap;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@
|
|||
namespace std { // forward declaration to avoid including <iostream>
|
||||
|
||||
template<typename C>
|
||||
class char_traits;
|
||||
struct char_traits;
|
||||
|
||||
template<typename C, class _TRAITS>
|
||||
class basic_ostream;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ namespace lib {
|
|||
|
||||
|
||||
namespace { // internal helpers
|
||||
void
|
||||
inline void
|
||||
_throwIterExhausted()
|
||||
{
|
||||
throw lumiera::error::Invalid ("Can't iterate further",
|
||||
|
|
|
|||
|
|
@ -34,16 +34,16 @@
|
|||
** a virtual function (which requires a VTable): Even if for everyone else any
|
||||
** knowledge regarding the exact implementation type has been discarded ("erased"),
|
||||
** the function pointers in the VTable still implicitly hold onto that precise
|
||||
** implementation type, since they were setup during construction, where the
|
||||
** implementation type, since they were set up during construction, where the
|
||||
** type was still available. Such a scheme of dealing with "opaque" copy operations
|
||||
** is known as <b>virtual copy</b> -- it can be dangerous and tricky to get right
|
||||
** and is preferably used only in flat class hierarchies.
|
||||
**
|
||||
** This helper template simplifies the construction of such a scheme.
|
||||
** - a base interface defines the available virtual copy operations
|
||||
** - a set of CRTP-style templates covers all the case of
|
||||
** - a set of CRTP-style templates covers all the cases of
|
||||
** - full copy support
|
||||
** - copy construction but not assignment
|
||||
** - copy construction but no assignment
|
||||
** - only move construction allowed
|
||||
** - noncopyable type
|
||||
** - we use type traits and a policy template to pick the correct implementation
|
||||
|
|
@ -144,6 +144,8 @@ namespace meta{
|
|||
: public BASE
|
||||
{
|
||||
public:
|
||||
virtual ~VirtualCopySupportInterface() { }
|
||||
|
||||
virtual void copyInto (void* targetStorage) const =0;
|
||||
virtual void moveInto (void* targetStorage) =0;
|
||||
virtual void copyInto (IFA& target) const =0;
|
||||
|
|
@ -198,6 +200,9 @@ namespace meta{
|
|||
D& src = static_cast<D&> (*this);
|
||||
new(targetStorage) D(move(src));
|
||||
}
|
||||
|
||||
using I::copyInto;
|
||||
using I::moveInto;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -211,6 +216,9 @@ namespace meta{
|
|||
D const& src = static_cast<D const&> (*this);
|
||||
new(targetStorage) D(src);
|
||||
}
|
||||
|
||||
using I::copyInto;
|
||||
using I::moveInto;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -233,6 +241,9 @@ namespace meta{
|
|||
D& s = static_cast<D&> (*this);
|
||||
t = move(s);
|
||||
}
|
||||
|
||||
using I::copyInto;
|
||||
using I::moveInto;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,14 @@
|
|||
** concrete type does not support assignment or copy construction, the respective access
|
||||
** function is replaced by an implementation raising a runtime error.
|
||||
**
|
||||
** @note we use a Visitor interface generated through metaprogramming.
|
||||
** This may generate a lot of warnings "-Woverloaded-virtual",
|
||||
** since one \c handle(TX) function may shadow other \c handle(..) functions
|
||||
** from the inherited (generated) Visitor interface. These warnings are besides
|
||||
** the point, since not the \em client uses these functions, but the Variant does,
|
||||
** after upcasting to the interface. Make sure you define your specialisations with
|
||||
** the override modifier; when done so, it is safe to disable this warning here.
|
||||
**
|
||||
** @see Veriant_test
|
||||
** @see lib::diff::GenNode
|
||||
** @see virtual-copy-support.hpp
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace asset {
|
|||
|
||||
class Proc;
|
||||
class ProcPatt;
|
||||
class BuildInstruct;
|
||||
struct BuildInstruct;
|
||||
typedef lib::P<const asset::Proc> PProc;
|
||||
typedef lib::P<const asset::ProcPatt> PProcPatt;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ using boost::format;
|
|||
|
||||
|
||||
namespace proc {
|
||||
class StreamType;
|
||||
struct StreamType;
|
||||
|
||||
namespace mobject {
|
||||
namespace session {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ namespace builder {
|
|||
public:
|
||||
|
||||
/** @internal record to describe a model port */
|
||||
struct ModelPortDescriptor;
|
||||
class ModelPortDescriptor;
|
||||
|
||||
|
||||
static void shutdown ();
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ namespace session {
|
|||
{
|
||||
typedef typename WrapReturn<TY>::Wrapper Ret;
|
||||
|
||||
public:
|
||||
|
||||
/** (dummy) implementation of the QueryHandler interface */
|
||||
virtual bool
|
||||
resolve (Ret& solution, Query<TY> const& q)
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ namespace proc {
|
|||
using lib::Symbol;
|
||||
|
||||
|
||||
// "yes mummy, we all know this code is not finished yet..."
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
|
||||
/**
|
||||
* TODO write type comment
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace test_format {
|
|||
class StreamTypeBasics_test : public Test
|
||||
{
|
||||
virtual void
|
||||
run (Arg arg)
|
||||
run (Arg)
|
||||
{
|
||||
ImplType iType = buildImplType ();
|
||||
basicImplTypeProperties (iType);
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ namespace test {
|
|||
CHECK (mp1);
|
||||
CHECK (mp2);
|
||||
CHECK (mp1x);
|
||||
CHECK (mp2x);
|
||||
CHECK (!mpNull); // bool check verifies setup and connected state
|
||||
|
||||
CHECK ( ModelPort::exists (pipeA)); // this is the same check, but invoked just with an pipe-ID
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ namespace test{
|
|||
++scope;
|
||||
CHECK (luid == scope->data.get<LuidH>());
|
||||
++scope;
|
||||
CHECK (Time(0.92,0) == scope->data.get<TimeSpan>().end());
|
||||
CHECK (Time(920,0) == scope->data.get<TimeSpan>().end());
|
||||
++scope;
|
||||
auto spam = *scope;
|
||||
CHECK (!++scope);
|
||||
|
|
|
|||
Loading…
Reference in a new issue