kill some warnings

This commit is contained in:
Fischlurch 2008-12-26 23:17:51 +01:00
parent e0b698d25a
commit cbbc298fe9
27 changed files with 114 additions and 111 deletions

View file

@ -1,5 +1,5 @@
/*
mmap.c - memory mapped acces to files
mmap.c - memory mapped access to files
Copyright (C) Lumiera.org
2008, Christian Thaeter <ct@pipapo.org>
@ -38,7 +38,7 @@ NOBUG_DEFINE_FLAG_PARENT (mmap_all, backend);
NOBUG_DEFINE_FLAG_PARENT (mmap, mmap_all);
LUMIERA_ERROR_DEFINE (MMAP_NWRITE, "Backing file not writeable");
LUMIERA_ERROR_DEFINE (MMAP_NWRITE, "Backing file not writable");
LUMIERA_ERROR_DEFINE (MMAP_SPACE, "Address space exhausted");
@ -63,7 +63,7 @@ lumiera_mmap_init (LumieraMMap self, LumieraFile file, off_t start, size_t size)
{
once = 1;
/**
* default size for the mmaping window
* default size for the mmapping window
* 128MB on 32 bit arch
* 2GB on 64 bit arch
*/
@ -90,25 +90,25 @@ lumiera_mmap_init (LumieraMMap self, LumieraFile file, off_t start, size_t size)
size_t chunksize = lumiera_file_chunksize_get (file);
/**
* Maintaining the right[tm] mmaping size is a bit tricky:
* Maintaining the right[tm] mmapping size is a bit tricky:
* - We have the default mmap_window_size which will be backed off when address space gets exhausted
* - When a biggier size is requested we have to fullfill it
* - The last mmaped chunk of a file can be as small as possible when the file is readonly
* - When the file is writeable, the last chunk should be rounded up to chunksize
* - When a bigger size is requested we have to fulfil it
* - The last mmapped chunk of a file can be as small as possible when the file is readonly
* - When the file is writable, the last chunk should be rounded up to chunksize
* - All boundaries will be aligned up/down to chunk boundaries
* - Requests beyond the file end must ftruncate and map additional pages
* - Create the 'refmap' which contains a refounter per chunk
* - Create the 'refmap' which contains a refcounter per chunk
**/
/**
* Recovering address space strategies:
* mmap() will fail when too much memory got mmaped after some time which is then
* mmap() will fail when too much memory got mmapped after some time which is then
* recovered in the following way
* 1. create a new mmap while the cachelimit is not reached.
* 2. All unused mmaps are kept in a mrucache, drop the oldest one.
* mmap() still fails..
* 3.a When the intented mmaping size is the same as mmap_window_size then reduce (/2) the window size and retry.
* 3.b When the intented mmaping size was biggier than mmap_window_size then free more mmaps from the cache.
* 3.a When the intended mmapping size is the same as mmap_window_size then reduce (/2) the window size and retry.
* 3.b When the intended mmapping size was bigger than mmap_window_size then free more mmaps from the cache.
* 4 When the cache is empty (that means all mmaps in use), scan the mmaps in use if they can be reduced
* mmap_window_size is already reduced now (half of refmap free from either end)
**/
@ -122,7 +122,7 @@ lumiera_mmap_init (LumieraMMap self, LumieraFile file, off_t start, size_t size)
while (addr == (void*)-1)
{
TODO ("check if current mmaped size exceeds configured as_size (as_size be smaller than retrieved from getrlimit())");
TODO ("check if current mmapped size exceeds configured as_size (as_size be smaller than retrieved from getrlimit())");
switch (strategy++)
{
@ -137,7 +137,7 @@ lumiera_mmap_init (LumieraMMap self, LumieraFile file, off_t start, size_t size)
/* request past the end */
if ((descriptor->flags & O_ACCMODE) == O_RDWR)
{
/* extend file (writeable) */
/* extend file (writable) */
if (ftruncate (fd, begin+length) == -1)
{
LUMIERA_ERROR_SET (mmap, ERRNO);
@ -152,7 +152,7 @@ lumiera_mmap_init (LumieraMMap self, LumieraFile file, off_t start, size_t size)
if ((descriptor->flags & O_ACCMODE) == O_RDONLY)
{
/* The last mmaped chunk of a file can be as small as possible when the file is readonly */
/* The last mmapped chunk of a file can be as small as possible when the file is readonly */
length = start+size - begin;
}
break;
@ -234,7 +234,7 @@ lumiera_mmap_delete (LumieraMMap self)
{
lumiera_mmapcache_forget (lumiera_mcache, self);
/* The matching mappings->lock must be hold or being unrelevant (mappings destructor) here, we can't asset this from here, good luck */
/* The matching mappings->lock must be hold or being irrelevant (mappings destructor) here, we can't asset this from here, good luck */
llist_unlink (&self->searchnode);
TRACE (mmap, "unmap at %p with size %zd", self->address, self->size);
@ -254,7 +254,7 @@ lumiera_mmap_destroy_node (LList node)
lumiera_mmapcache_forget (lumiera_mcache, self);
llist_unlink (&self->searchnode); TODO ("must lock mmapings -> deadlock");
llist_unlink (&self->searchnode); TODO ("must lock mmappings -> deadlock");
munmap (self->address, self->size);
lumiera_free (self->refmap);

View file

@ -1,5 +1,5 @@
/*
mmap.h - memory mapped acces to files
mmap.h - memory mapped access to files
Copyright (C) Lumiera.org
2008, Christian Thaeter <ct@pipapo.org>

View file

@ -1,5 +1,5 @@
/*
MockConfigRules - mock implementation of the config rules system
FakeConfigRules - dummy implementation of the config rules system
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
@ -34,11 +34,10 @@
using util::isnil;
namespace lumiera
{
namespace lumiera {
namespace query
{
namespace query {
using asset::Struct;
using asset::Pipe;
using asset::PPipe;
@ -46,8 +45,8 @@ namespace lumiera
using asset::ProcPatt;
using asset::PProcPatt;
namespace
{
namespace {
typedef std::pair<const string, any> AnyPair;
/** helper to simplify creating mock table entries, wrapped correctly */
@ -81,7 +80,7 @@ namespace lumiera
/** hard coded answers to configuration queries.
* @note while filling the table re-entrace
* @note while filling the table re-entrance
* will be quite common, so the order of
* creating the objects is important.
*/

View file

@ -74,7 +74,7 @@ namespace lumiera
template<class TOOLImpl>
static Tag&
get (TOOLImpl* const concreteTool=0)
get (TOOLImpl* const =0)
{
Tag& t = TagTypeRegistry<TOOL,TOOLImpl>::tag;
if (!t) generateID (t.tagID);

View file

@ -32,7 +32,7 @@ PLANNED "DeleteAsset_test" DeleteAsset_test <<END
END
TEST "DependantAssets_test" DependantAssets_test <<END
TEST "DependentAssets_test" DependentAssets_test <<END
return: 0
END

View file

@ -43,7 +43,7 @@ test_components_SOURCES = \
$(testcomponents_srcdir)/proc/asset/mediastructurequerytest.cpp \
$(testcomponents_srcdir)/proc/asset/basicpipetest.cpp \
$(testcomponents_srcdir)/proc/asset/createassettest.cpp \
$(testcomponents_srcdir)/proc/asset/dependantassetstest.cpp \
$(testcomponents_srcdir)/proc/asset/dependent-assets-test.cpp \
$(testcomponents_srcdir)/proc/asset/makecliptest.cpp \
$(testcomponents_srcdir)/proc/asset/orderingofassetstest.cpp \
$(testcomponents_srcdir)/proc/asset/testasset.cpp \

View file

@ -53,7 +53,7 @@ namespace backend_interface
{
typedef MediaAccessFacade MAF;
virtual void run(Arg arg)
virtual void run(Arg)
{
MAF::instance.injectSubclass (new MediaAccessMock);

View file

@ -51,7 +51,7 @@ namespace asset
*/
class AssetCategory_test : public Test
{
virtual void run(Arg arg)
virtual void run(Arg)
{
createCategory();
containmentQuery();

View file

@ -42,7 +42,7 @@ namespace asset
/*******************************************************************
* @test deleting an Asset includes removing all dependant Assets
* @test deleting an Asset includes removing all dependent Assets
* and all MObjects relying on these. Especially this means
* breaking all links between the involved Objects, so the
* shared-ptrs can do the actual cleanup.
@ -51,7 +51,7 @@ namespace asset
*/
class DeleteAsset_test : public Test
{
virtual void run(Arg arg)
virtual void run(Arg)
{
UNIMPLEMENTED ("delete asset and update all dependencies");
}

View file

@ -1,5 +1,5 @@
/*
DependantAssets(Test) - check the asset dependency handling
DependentAssets(Test) - check the asset dependency handling
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
@ -42,14 +42,14 @@ namespace asset
/*******************************************************************
* @test the handling of Assets dependant on other Assets and the
* @test the handling of Assets dependent on other Assets and the
* enabling/disabling of Assets.
* @see asset::Asset
* @see asset::Clip
*/
class DependantAssets_test : public Test
class DependentAssets_test : public Test
{
virtual void run (Arg arg)
virtual void run (Arg)
{
checkDependencyMechanics ();
checkUnlinking ();
@ -206,7 +206,7 @@ namespace asset
/** Register this test class... */
LAUNCHER (DependantAssets_test, "unit function asset");
LAUNCHER (DependentAssets_test, "unit function asset");

View file

@ -52,7 +52,7 @@ namespace asset {
typedef P<asset::Media> PM;
typedef asset::Media::PClipMO PC;
virtual void run (Arg arg)
virtual void run (Arg)
{
PM mm = asset::Media::create("test-1", VIDEO);

View file

@ -49,7 +49,7 @@ namespace asset
*/
class MediaStructureQuery_test : public Test
{
virtual void run(Arg arg)
virtual void run(Arg)
{
UNIMPLEMENTED ("querying media file structure from backend");
}

View file

@ -34,10 +34,8 @@ using util::isnil;
using std::string;
namespace asset
{
namespace test
{
namespace asset {
namespace test {
@ -46,7 +44,7 @@ namespace asset
* @test validate the equality and order relations of
* Asset::Ident and Asset objects.
* @note a known problem is that only Asset smart ptrs
* are supported for comparison, not smartptrs
* are supported for comparison, not smartpointers
* of Asset subclasses. To solve this, we would
* either have to repeat the operator definitions,
* or resort to template metaprogramming tricks.
@ -57,7 +55,7 @@ namespace asset
*/
class OrderingOfAssets_test : public Test
{
virtual void run(Arg arg)
virtual void run(Arg)
{
Asset::Ident key1("Au-1", Category(AUDIO), "ichthyo", 5);
PAsset mm1 = asset::Media::create(key1, "Name-1");

View file

@ -52,7 +52,7 @@ namespace engine {
struct DummyArray : RefArray<E>
{
E decoy;
E const& operator[] (uint i) const { return decoy;}
E const& operator[] (uint) const { return decoy;}
};
DummyArray<ChannelDescriptor> dummy1;
DummyArray<InChanDescriptor> dummy2;
@ -133,7 +133,7 @@ namespace engine {
PSto pStorage;
ulong counter;
virtual void run(Arg arg)
virtual void run(Arg)
{
counter = 0;
std::srand (time (NULL));

View file

@ -1,5 +1,5 @@
/*
SourceNode(Test) - unit test of the source readering render node
SourceNode(Test) - unit test of the source reading render node
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
@ -46,7 +46,7 @@ namespace engine
*/
class SourceNode_test : public Test
{
virtual void run(Arg arg)
virtual void run(Arg)
{
UNIMPLEMENTED ("render node pulling source data from backend");
}

View file

@ -1,5 +1,5 @@
/*
BuilderTool(Test) - specialized visitor used within the builder for processing Placements
BuilderTool(Test) - specialised visitor used within the builder for processing Placements
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
@ -63,14 +63,14 @@ namespace mobject {
};
/**
* Subclass-1 is \em not defined "processable",
* Subclass-1 is \em not defined "processible",
* thus will always be handled as TestMO...
*/
class TestSubMO1 : public TestMO
{ };
/**
* Subclass-2 \em is defined "processable",
* Subclass-2 \em is defined "processible",
* but we omit the necessary "applicable" definition in TestTool,
* resulting in an invocation of the error (catch-all) function...
*/
@ -91,14 +91,14 @@ namespace mobject {
/**
* BuilderTool implementation for checking the invokation of the correct
* BuilderTool implementation for checking the invocation of the correct
* \c treat() function and for accessing the original Placement from
* within this invocation. It is declared to be applicable to Clip
* and TestMO objects (wrapped into any acceptable shared-ptr).
* Intentionally, we omit to declare it applicable to TestSubMO2 instances.
* In reality this would be a case of misconfiguration, because TestSubMO2
* is defined to be processable and consequently has an \apply() function,
* which, due to this ommission can't find a dispatcher entry when invoked,
* which, due to this omission can't find a dispatcher entry when invoked,
* so it will call the \c onUnknown(Buildable&) instead
*/
class TestTool
@ -111,6 +111,7 @@ namespace mobject {
{
Placement<Clip>& pC = getPlacement<Clip>();
cout << "Clip on media : "<< str(pC->getMedia()) <<"\n";
ASSERT (pC->operator==(c));
log_ = string (pC);
}
void treat (AbstractMO&)
@ -118,7 +119,7 @@ namespace mobject {
cout << "treat (AbstractMO&);\n";
log_ = string (getPlacement<MObject>());
}
void onUnknown (Buildable& bxx)
void onUnknown (Buildable&)
{
cout << "catch-all-function called...\n";
log_ = string (getPlacement<MObject>());
@ -131,13 +132,13 @@ namespace mobject {
/*************************************************************************************
* @test the generic visitor pattern specialized for treating MObjects in the builder.
* @test the generic visitor pattern specialised for treating MObjects in the builder.
* Besides using existing MObject types (at the moment session::Clip),
* we create a yet-unknown new MObject subclass. When passing such to any
* BuilderTool subclass, the compiler enforces the definition of a catch-all
* function, which is called, when there is no other applicable \c treat(MO&)
* function. Note further, whithin the specific treat-functions we get direct
* references, whithout interfering with Placements and memory management.
* function. Note further, within the specific treat-functions we get direct
* references, without interfering with Placements and memory management.
* But from within the \c treat() function, we may access the wrapper object
* (i.e. shared_ptr, or lumiera::P or Placement) used when invoking the
* BuilderTool by using the protected interface on BuilderTool.
@ -146,7 +147,7 @@ namespace mobject {
*/
class BuilderTool_test : public Test
{
virtual void run(Arg arg)
virtual void run(Arg)
{
TestTool t1;

View file

@ -49,7 +49,7 @@ namespace mobject
*/
class BuildSegment_test : public Test
{
virtual void run(Arg arg)
virtual void run(Arg)
{
UNIMPLEMENTED ("oh my");
}

View file

@ -41,12 +41,9 @@ using std::string;
using std::cout;
namespace mobject
{
namespace session
{
namespace test
{
namespace mobject {
namespace session {
namespace test {
using asset::VIDEO;
@ -65,7 +62,7 @@ namespace mobject
typedef shared_ptr<asset::Clip> PCA;
virtual void
run (Arg arg)
run (Arg)
{
// create Clip-MObject, which is wrapped into a placement (smart ptr)
PM media = asset::Media::create("test-1", VIDEO);
@ -77,12 +74,12 @@ namespace mobject
ASSERT (clip_media->ident.category.hasKind (VIDEO));
// using the Placement interface
// TODO: how to handle unterdetermined Placement? Throw?
// TODO: how to handle insufficiently determinated Placement? Throw?
FixedLocation & fixloc = pc.chain(Time(1)); // TODO: the track??
ExplicitPlacement expla = pc.resolve();
ASSERT (expla.time == 1);
ASSERT (!expla.chain.isOverdetermined());
//ASSERT (*expla == *pc); ////////////////////////TODO: definie equality on placements
//ASSERT (*expla == *pc); ////////////////////////TODO: define equality on placements
// now overconstraining with another Placement
pc.chain(Time(2));

View file

@ -56,7 +56,7 @@ namespace mobject
class AddClip_test : public Test
{
virtual void
run (Arg arg)
run (Arg)
{
PSess sess = Session::current;
PMO clip = TestClip::create();

View file

@ -40,10 +40,9 @@ using util::isnil;
using std::string;
namespace asset
{
namespace test
{
namespace asset {
namespace test {
using mobject::Session;
using lumiera::Symbol;
using lumiera::Query;
@ -81,7 +80,8 @@ namespace asset
*/
class DefsManagerImpl_test : public Test
{
virtual void run(Arg arg)
virtual void
run(Arg)
{
define_and_search();
string pipeID = create();
@ -91,12 +91,13 @@ namespace asset
void define_and_search ()
void
define_and_search ()
{
string sID = newID ("stream");
// create Pipes explicitly
// (without utilizing default queries)
// (without utilising default queries)
PPipe pipe1 = Struct::create (newID("pipe"), newID("stream"));
PPipe pipe2 = Struct::create (newID("pipe"), sID );
@ -122,7 +123,8 @@ lumiera::query::setFakeBypass("stream("+sID+")"); //////////////////////////////
}
const string& create ()
const string&
create()
{
string sID = newID ("stream");
Query<Pipe> query_for_streamID ("stream("+sID+")");
@ -143,7 +145,8 @@ lumiera::query::setFakeBypass("stream("+sID+")"); //////////////////////////////
}
void forget(string pID)
void
forget (string pID)
{
PPipe pipe = Pipe::query ("pipe("+pID+")");
REQUIRE (find (pipe->getPipeID()), "need an object registered as default");

View file

@ -76,7 +76,8 @@ namespace asset
*/
class DefsManager_test : public Test
{
virtual void run(Arg arg)
virtual void
run (Arg arg)
{
string pipeID = isnil(arg)? "Black Hole" : arg[1];
string streamID = 2>arg.size()? "teststream" : arg[2] ;
@ -93,7 +94,8 @@ namespace asset
void retrieveSimpleDefault (string pID)
void
retrieveSimpleDefault (string)
{
PPipe pipe1 = Pipe::query (""); // "the default pipe"
PPipe pipe2;
@ -112,8 +114,9 @@ namespace asset
}
void retrieveConstrainedDefault (string pID, string sID)
{
void
retrieveConstrainedDefault (string pID, string sID)
{
PPipe pipe1 = Pipe::query (""); // "the default pipe"
ASSERT (sID != pipe1->getProcPatt()->queryStreamID(),
"stream-ID \"%s\" not suitable for test, because "
@ -133,7 +136,7 @@ namespace asset
string failureCreatesNewDefault ()
{
PPipe pipe1 = Session::current->defaults(Query<Pipe> ()); // "the default pipe"
string new_pID (str (format ("dummy_%s_%i")
% pipe1->getPipeID()
% std::rand()
@ -168,7 +171,7 @@ namespace asset
QueryHandler<Pipe>& typeHandler = ConfigRules::instance();
PPipe pipe2 = asset::Struct::create (pID, "quatsch");
typeHandler.resolve (pipe2, query_for_pID); // in the mock impl this has the side effect
ASSERT (pipe2); // of replacing the mock entry
//////////////////////////////////////////// so from now on the test works as intended....

View file

@ -49,12 +49,9 @@ using std::map;
namespace mobject
{
namespace session
{
namespace test
{
namespace mobject {
namespace session {
namespace test {
format typePatt ("Dummy<%2i>");
format instancePatt ("obj_%s_%i");
@ -131,7 +128,8 @@ namespace mobject
{ }
virtual void run(Arg arg)
virtual void
run (Arg)
{
this->reg_.reset (new DefsRegistry);
@ -143,10 +141,11 @@ namespace mobject
void fill_table ()
void
fill_table ()
{
// at start the registry is indeed empty
// thus a query doesnt yield any results....
// thus a query doesn't yield any results....
ASSERT ( ! *(reg_->candidates(Q13 ("something"))) );
reg_->put (o1, q5);
@ -168,7 +167,8 @@ namespace mobject
}
void check_query ()
void
check_query ()
{
Iter13 i (reg_->candidates(Q13 ("irrelevant query")));
ASSERT ( i.hasNext());
@ -223,7 +223,8 @@ namespace mobject
}
void check_remove ()
void
check_remove ()
{
reg_->forget (o2);

View file

@ -61,7 +61,7 @@ namespace mobject
class DeleteClip_test : public Test
{
virtual void
run (Arg arg)
run (Arg)
{
buildTestseesion1();
PSess sess = Session::current;

View file

@ -38,7 +38,7 @@ namespace util
class SanitizedIdentifier_test : public Test
{
virtual void run (Arg arg)
virtual void run (Arg)
{
print_clean ("Word");
print_clean ("a Sentence");

View file

@ -144,7 +144,7 @@ namespace lumiera
*/
class VisitingToolExtended_test : public Test
{
virtual void run(Arg arg)
virtual void run(Arg)
{
known_visitor_known_class();
visitor_not_visiting_some_class();

View file

@ -32,12 +32,10 @@ using std::string;
using std::cout;
namespace lumiera
{
namespace visitor
{
namespace test1
{
namespace lumiera {
namespace visitor {
namespace test1 {
typedef visitor::Tool<> VisitingTool;
class HomoSapiens : public Visitable<>
@ -100,7 +98,7 @@ namespace lumiera
/*************************************************************************
* @test our lib implementation of the visitor pattern.
* Defines a hierarchy of test classes to check the following cases
* <ul><li>calling the correct visiting tool specialized function
* <ul><li>calling the correct visiting tool specialised function
* for given concrete hierarchy classes</li>
* <li>visiting tool not declaring to visit some class
* is silently ignored by default</li>
@ -110,13 +108,15 @@ namespace lumiera
*/
class VisitingTool_test : public Test
{
virtual void run(Arg arg)
virtual void
run (Arg)
{
known_visitor_known_class();
visiting_extended_hierarchy();
}
void known_visitor_known_class()
void
known_visitor_known_class()
{
Boss x1;
BigBoss x2;
@ -132,7 +132,8 @@ namespace lumiera
homo2.apply (vista);
}
void visiting_extended_hierarchy()
void
visiting_extended_hierarchy()
{
HomoSapiens x1;
Leader x2;
@ -144,7 +145,7 @@ namespace lumiera
Babbler bab;
VisitingTool& vista (bab);
homo1.apply (vista); // silent error handler (not Applicable to HomoSapiens)
homo2.apply (vista); // Leader handeld as Visionary and treated as Boss
homo2.apply (vista); // Leader handled as Visionary and treated as Boss
}
};

View file

@ -1,5 +1,5 @@
/*
test-psplay.c - test the probanilistic splay tree
test-psplay.c - test the probabilistic splay tree
Copyright (C) Lumiera.org
2008, Christian Thaeter <ct@pipapo.org>