From 075b3c8d6a84a76a06a4c1cdf65b2d9614aabecc Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 30 Dec 2008 07:28:34 +0100 Subject: [PATCH 1/3] fix some warnings... --- src/gui/guinotificationfacade.cpp | 34 ++++++++++++++++-------------- src/gui/guistart.cpp | 34 ++++++++++++++++-------------- src/lib/meta/configflags.hpp | 30 +++++++++++++++++++------- src/lib/sync.hpp | 6 +++--- src/lib/test/testoption.cpp | 2 +- src/lib/test/testoption.hpp | 6 +++--- tests/lib/meta/configflagstest.cpp | 2 +- tests/lib/sync-waiting-test.cpp | 2 +- 8 files changed, 67 insertions(+), 49 deletions(-) diff --git a/src/gui/guinotificationfacade.cpp b/src/gui/guinotificationfacade.cpp index a697367d4..67ae31162 100644 --- a/src/gui/guinotificationfacade.cpp +++ b/src/gui/guinotificationfacade.cpp @@ -68,40 +68,42 @@ namespace gui { ,lumieraorg_GuiNotificationFacade_descriptor , NULL, NULL, NULL , LUMIERA_INTERFACE_INLINE (name, "\044\117\156\365\344\056\362\220\166\350\320\214\115\221\302\177", - const char*, (LumieraInterface iface), - { return "GuiNotification"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "GuiNotification"; } ) , LUMIERA_INTERFACE_INLINE (brief, "\160\240\102\325\175\145\270\140\350\241\163\303\331\343\253\142", - const char*, (LumieraInterface iface), - { return "GUI Interface: push state update and notification of events into the GUI"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "GUI Interface: push state update and notification of events into the GUI"; } ) , LUMIERA_INTERFACE_INLINE (homepage, "\217\232\066\101\042\116\054\217\070\233\253\241\166\145\234\133", - const char*, (LumieraInterface iface), - { return "http://www.lumiera.org/develompent.html" ;} + const char*, (LumieraInterface ifa), + { (void)ifa; return "http://www.lumiera.org/develompent.html" ;} ) , LUMIERA_INTERFACE_INLINE (version, "\350\365\121\052\037\022\300\021\171\357\017\367\270\071\266\376", - const char*, (LumieraInterface iface), - { return "0.1~pre"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "0.1~pre"; } ) , LUMIERA_INTERFACE_INLINE (author, "\117\007\006\234\153\206\000\344\303\043\027\261\045\320\166\133", - const char*, (LumieraInterface iface), - { return "Hermann Vosseler"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "Hermann Vosseler"; } ) , LUMIERA_INTERFACE_INLINE (email, "\356\243\022\137\345\275\016\034\337\144\031\260\303\050\140\327", - const char*, (LumieraInterface iface), - { return "Ichthyostega@web.de"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "Ichthyostega@web.de"; } ) , LUMIERA_INTERFACE_INLINE (copyright, "\365\220\260\051\267\345\330\046\145\134\331\320\115\157\332\356", - const char*, (LumieraInterface iface), + const char*, (LumieraInterface ifa), { + (void)ifa; return "Copyright (C) Lumiera.org\n" " 2008 Hermann Vosseler "; } ) , LUMIERA_INTERFACE_INLINE (license, "\155\335\361\364\221\012\115\325\306\046\153\152\002\117\075\077", - const char*, (LumieraInterface iface), + const char*, (LumieraInterface ifa), { + (void)ifa; return "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" @@ -119,8 +121,8 @@ namespace gui { } ) , LUMIERA_INTERFACE_INLINE (state, "\227\170\230\144\310\330\131\175\367\152\327\324\113\275\223\245", - int, (LumieraInterface iface), - {return LUMIERA_INTERFACE_EXPERIMENTAL; } + int, (LumieraInterface ifa), + {(void)ifa; return LUMIERA_INTERFACE_EXPERIMENTAL; } ) , LUMIERA_INTERFACE_INLINE (versioncmp, "\253\066\335\233\025\161\135\347\377\156\121\135\347\313\130\014", int, (const char* a, const char* b), diff --git a/src/gui/guistart.cpp b/src/gui/guistart.cpp index 8de92793e..6060073ac 100644 --- a/src/gui/guistart.cpp +++ b/src/gui/guistart.cpp @@ -106,32 +106,33 @@ extern "C" { /* ================== define an lumieraorg_Gui instance =========== ,lumieraorg_GuiStarterPlugin_descriptor , NULL, NULL, NULL , LUMIERA_INTERFACE_INLINE (name, "\126\247\365\337\126\254\173\037\130\310\337\345\200\347\323\136", - const char*, (LumieraInterface iface), - { return "GuiStarterPlugin"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "GuiStarterPlugin"; } ) , LUMIERA_INTERFACE_INLINE (brief, "\056\346\322\365\344\104\232\232\355\213\367\056\301\144\051\021", - const char*, (LumieraInterface iface), - { return "entry point to start up the Lumiera GTK GUI contained in this dynamic module"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "entry point to start up the Lumiera GTK GUI contained in this dynamic module"; } ) , LUMIERA_INTERFACE_INLINE (homepage, "\357\056\117\165\320\066\273\130\113\100\367\022\221\350\236\256", - const char*, (LumieraInterface iface), - { return "http://www.lumiera.org/develompent.html" ;} + const char*, (LumieraInterface ifa), + { (void)ifa; return "http://www.lumiera.org/develompent.html" ;} ) , LUMIERA_INTERFACE_INLINE (version, "\013\117\366\210\070\320\274\076\253\230\032\116\271\161\027\354", - const char*, (LumieraInterface iface), - { return "0.1~pre"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "0.1~pre"; } ) , LUMIERA_INTERFACE_INLINE (author, "\371\262\024\273\170\105\163\261\351\240\051\003\153\040\256\155", - const char*, (LumieraInterface iface), - { return "Joel Holdsworth, Christian Thaeter, Hermann Vosseler"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "Joel Holdsworth, Christian Thaeter, Hermann Vosseler"; } ) , LUMIERA_INTERFACE_INLINE (email, "\353\242\247\130\056\242\314\145\053\162\003\060\200\357\303\214", - const char*, (LumieraInterface iface), - { return "Lumiera@lists.lumiera.org"; } + const char*, (LumieraInterface ifa), + { (void)ifa; return "Lumiera@lists.lumiera.org"; } ) , LUMIERA_INTERFACE_INLINE (copyright, "\172\325\335\304\015\222\377\372\343\151\255\020\030\103\320\101", - const char*, (LumieraInterface iface), + const char*, (LumieraInterface ifa), { + (void)ifa; return "Copyright (C) Lumiera.org\n" "2007-2008, Joel Holdsworth \n" @@ -140,8 +141,9 @@ extern "C" { /* ================== define an lumieraorg_Gui instance =========== } ) , LUMIERA_INTERFACE_INLINE (license, "\016\264\202\005\160\305\033\227\037\077\143\363\263\011\167\257", - const char*, (LumieraInterface iface), + const char*, (LumieraInterface ifa), { + (void)ifa; return "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" @@ -159,8 +161,8 @@ extern "C" { /* ================== define an lumieraorg_Gui instance =========== } ) , LUMIERA_INTERFACE_INLINE (state, "\006\070\035\065\267\073\016\107\376\027\355\035\135\176\107\064", - int, (LumieraInterface iface), - {return LUMIERA_INTERFACE_EXPERIMENTAL; } + int, (LumieraInterface ifa), + {(void)ifa; return LUMIERA_INTERFACE_EXPERIMENTAL; } ) , LUMIERA_INTERFACE_INLINE (versioncmp, "\224\077\275\040\357\244\311\244\112\030\042\163\061\166\245\325", int, (const char* a, const char* b), diff --git a/src/lib/meta/configflags.hpp b/src/lib/meta/configflags.hpp index af6686ea9..f0f27012c 100644 --- a/src/lib/meta/configflags.hpp +++ b/src/lib/meta/configflags.hpp @@ -25,7 +25,7 @@ ** Under some circumstances it is necessary to assemble functionality ** out of elementary building blocks. Especially, this assembly can be ** expressed as template specialisations directed by a configuration type. - ** Thus, the purpose of this header is to encode flag-like configuraitons + ** Thus, the purpose of this header is to encode flag-like configurations ** as distinct types, which can be used to select such specialisations. ** Each possible configuration can be encoded as a list of flags, which allows ** to generate, filter and process those configurations. The final goal is to @@ -33,8 +33,8 @@ ** configured according to the situation encoded in the flags. ** ** @note currently there is an inherent limitation to configurations defined by - ** a maximum of 5 independant flags. While it is easy to increase this limit, - ** you should consider that the final goal is to genarate template instantiations, + ** a maximum of 5 independent flags. While it is easy to increase this limit, + ** you should consider that the final goal is to generate template instantiations, ** which would lead to more and more code bloat with growing number of possible ** combination. ** @@ -127,20 +127,31 @@ namespace lumiera { >::Config Config; typedef Config Type; }; + /** create a configuration type for the given list-of-flags */ template struct DefineConfigByFlags : BuildConfigFromFlags { }; + namespace { + /** helper comparing enum values and chars (flags) */ + template + struct maxC + { + enum{ VAL = ii < jj? jj : ii }; + }; + } + + /** * Helper for calculating values and for * invoking runtime code based on a given FlagTuple. * Can also be used on a Typelist of several Configs. * The latter case is typically used to invoke an operation - * while ennumerating all Flag-Configurations defined in Code. + * while enumerating all Flag-Configurations defined in Code. * An example would be to build (at runtime) an dispatcher table. * Explanation: For the Case covering a List of Configs, we provide - * a templated visitaion function, which can accept a functor object + * a templated visitation function, which can accept a functor object * to be invoked on each Configuration. */ template @@ -149,10 +160,11 @@ namespace lumiera { template struct FlagInfo, FLAGS> > { - enum{ BITS = MAX(ff, FlagInfo::BITS) - , CODE = (1<::CODE + enum{ BITS = maxC< ff, FlagInfo::BITS> ::VAL + , CODE = (1<::CODE }; }; + template<> struct FlagInfo { @@ -167,11 +179,13 @@ namespace lumiera { return functor.done(); } }; + template struct FlagInfo > { typedef typename CONF::Flags ThisFlags; - enum{ BITS = MAX (char(FlagInfo::BITS), char(FlagInfo::BITS)) + enum{ + BITS = maxC< FlagInfo::BITS, FlagInfo::BITS > ::VAL }; template diff --git a/src/lib/sync.hpp b/src/lib/sync.hpp index 347106a3d..2bdde0252 100644 --- a/src/lib/sync.hpp +++ b/src/lib/sync.hpp @@ -269,7 +269,7 @@ namespace lib { template struct BoolMethodPredicate { - typedef volatile bool (X::*Method)(void); + typedef bool (X::*Method)(void); X& instance_; Method method_; @@ -307,7 +307,7 @@ namespace lib { template bool - wait (X& instance, volatile bool (X::*method)(void), ulong timedwait=0) + wait (X& instance, bool (X::*method)(void), ulong timedwait=0) { BoolMethodPredicate invokeMethod(instance, method); return IMPL::wait(invokeMethod, timeout_.setOffset(timedwait)); @@ -391,7 +391,7 @@ namespace lib { * observing a condition defined as member function. */ template - Lock(X* it, volatile bool (X::*method)(void)) + Lock(X* it, bool (X::*method)(void)) : mon_(getMonitor(it)) { mon_.acquireLock(); diff --git a/src/lib/test/testoption.cpp b/src/lib/test/testoption.cpp index 9dc7503e1..b0807ab63 100644 --- a/src/lib/test/testoption.cpp +++ b/src/lib/test/testoption.cpp @@ -107,7 +107,7 @@ namespace test } /** @return \c true if --describe switch was given */ - const bool + bool TestOption::getDescribe () { return parameters["describe"].as(); diff --git a/src/lib/test/testoption.hpp b/src/lib/test/testoption.hpp index 0bdb9f616..d9b31521a 100644 --- a/src/lib/test/testoption.hpp +++ b/src/lib/test/testoption.hpp @@ -33,8 +33,8 @@ -namespace test - { +namespace test { + using std::string; using std::ostream; @@ -56,7 +56,7 @@ namespace test TestOption (util::Cmdline& cmdline); const string getTestgroup (); const string getTestID (); - const bool getDescribe (); + bool getDescribe (); private: boost::program_options::options_description syntax; diff --git a/tests/lib/meta/configflagstest.cpp b/tests/lib/meta/configflagstest.cpp index cc0bffcb6..1098b0385 100644 --- a/tests/lib/meta/configflagstest.cpp +++ b/tests/lib/meta/configflagstest.cpp @@ -132,7 +132,7 @@ namespace lumiera { */ class ConfigFlags_test : public Test { - virtual void run(Arg arg) + virtual void run(Arg) { check_testdata (); check_flags(); diff --git a/tests/lib/sync-waiting-test.cpp b/tests/lib/sync-waiting-test.cpp index 59065dcb9..2c6a280fb 100644 --- a/tests/lib/sync-waiting-test.cpp +++ b/tests/lib/sync-waiting-test.cpp @@ -94,7 +94,7 @@ namespace lib { class SyncOnMemberPredicate : public SyncOnBool { - volatile bool checkTheFlag() { return this->got_new_data_; } + bool checkTheFlag() { return this->got_new_data_; } public: void getIt() From bb8f825afe17ff2033fb82e3c4f43f346564123a Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Fri, 2 Jan 2009 01:51:22 +0100 Subject: [PATCH 2/3] add AC_CONFIG_MACRO_DIR and fixed some m4 quoting --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index eb78e6d9a..abd465973 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,7 @@ AC_INIT(lumiera, 0.1pre) -AC_CONFIG_SRCDIR(src/lib/luid.c) -AC_CONFIG_AUX_DIR(scripts) +AC_CONFIG_SRCDIR([src/lib/luid.c]) +AC_CONFIG_AUX_DIR([scripts]) +AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE AC_PREREQ(2.59) From 9749178a06bf98b7ac7544320481be353ec514a4 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Mon, 5 Jan 2009 08:33:15 +0100 Subject: [PATCH 3/3] Add some missing semicolons, the upcoming NoBug will be picky about that --- src/gui/output/displayer.cpp | 8 ++++---- src/gui/widgets/timeline-widget.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/output/displayer.cpp b/src/gui/output/displayer.cpp index a7676c8dd..482db826e 100644 --- a/src/gui/output/displayer.cpp +++ b/src/gui/output/displayer.cpp @@ -74,10 +74,10 @@ Displayer::calculateVideoLayout( video_x = ( widget_width - video_width ) / 2; video_y = ( widget_height - video_height ) / 2; - ENSURE(video_x >= 0 && video_x < widget_width) - ENSURE(video_y >= 0 && video_y < widget_height) - ENSURE(video_width <= widget_width) - ENSURE(video_width <= widget_width) + ENSURE(video_x >= 0 && video_x < widget_width); + ENSURE(video_y >= 0 && video_y < widget_height); + ENSURE(video_width <= widget_width); + ENSURE(video_width <= widget_width); } } // namespace output diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 7f375fae2..28ab754f0 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -387,7 +387,7 @@ TimelineWidget::remove_orphaned_tracks() pair; BOOST_FOREACH( pair, orphan_track_map ) { - ENSURE(pair.first) + ENSURE(pair.first); trackMap.erase(pair.first); } }