Boost logo

Boost-Commit :

From: jmcintyre_at_[hidden]
Date: 2007-07-31 01:28:48


Author: jared
Date: 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
New Revision: 7612
URL: http://svn.boost.org/trac/boost/changeset/7612

Log:
cleanup gcc warnings
Text files modified:
   sandbox/pinhole/boost/pinhole/Editor.h | 10 +++++--
   sandbox/pinhole/boost/pinhole/action_info.h | 24 +++++++++++++-----
   sandbox/pinhole/boost/pinhole/map_key_value_iterators.h | 10 +++++--
   sandbox/pinhole/boost/pinhole/property_group.h | 36 +++++++++++++++++++++++-----
   sandbox/pinhole/boost/pinhole/property_info.h | 22 ++++++++++++-----
   sandbox/pinhole/boost/pinhole/property_manager.h | 32 +++++++++++++++++--------
   sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h | 50 ++++++++++++++++++++++++++++------------
   sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp | 1
   8 files changed, 132 insertions(+), 53 deletions(-)

Modified: sandbox/pinhole/boost/pinhole/Editor.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/Editor.h (original)
+++ sandbox/pinhole/boost/pinhole/Editor.h 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
@@ -107,10 +107,14 @@
 
         protected:
             EditorControlType m_UItype;
-#pragma warning(push)
-#pragma warning( disable: 4251 )
+ #if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4251 )
+ #endif
             property_collection m_properties;
-#pragma warning(pop)
+ #if defined(BOOST_MSVC)
+ #pragma warning(pop)
+ #endif
     };
 }}
 

Modified: sandbox/pinhole/boost/pinhole/action_info.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/action_info.h (original)
+++ sandbox/pinhole/boost/pinhole/action_info.h 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
@@ -8,17 +8,25 @@
 #ifndef BOOST_DETAILS_ACTION_INFO
 #define BOOST_DETAILS_ACTION_INFO
 
-#pragma warning(push)
-#pragma warning( disable: 4272 4394 )
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4272 4394 )
+#endif
 #include "Editor.h"
-#pragma warning(pop)
-
-#pragma warning(push)
-#pragma warning( disable: 4561 4793 )
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
+
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4561 4793 )
+#endif
 #include <boost/type_traits.hpp>
 #include <boost/function.hpp>
 #include <boost/lexical_cast.hpp>
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
 namespace boost { namespace pinhole { namespace detail
 {
@@ -29,6 +37,8 @@
 
     public:
         typedef boost::function<void ()> action_type;
+
+ virtual ~action_info(){;}
 
         action_type m_action;
         std::string m_name;

Modified: sandbox/pinhole/boost/pinhole/map_key_value_iterators.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/map_key_value_iterators.h (original)
+++ sandbox/pinhole/boost/pinhole/map_key_value_iterators.h 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
@@ -8,15 +8,19 @@
 #ifndef BOOST_MAP_KEY_VALUE_ITERATORS
 #define BOOST_MAP_KEY_VALUE_ITERATORS
 
-#pragma warning(push)
-#pragma warning(disable: 4561 4996)
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning(disable: 4561 4996)
+#endif
 #include <boost/iterator.hpp>
 #include <boost/iterator/iterator_adaptor.hpp>
 #include <boost/iterator/iterator_categories.hpp>
 
 #include <boost/type_traits/is_pointer.hpp>
 #include <boost/static_assert.hpp>
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
 namespace boost { namespace pinhole
 {

Modified: sandbox/pinhole/boost/pinhole/property_group.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_group.h (original)
+++ sandbox/pinhole/boost/pinhole/property_group.h 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
@@ -17,14 +17,18 @@
 #include <list>
 #include <sstream>
 
-#pragma warning(push)
-#pragma warning( disable: 4561)
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4561)
+#endif
 #include <boost/bind.hpp>
 #include <boost/static_assert.hpp>
 #include <boost/type_traits.hpp>
 #include <boost/function.hpp>
 #include <boost/any.hpp>
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
 #define BOOST_SETTER(c) boost::bind(c, this, _1)
 #define BOOST_GETTER(c) boost::bind(c, this)
@@ -462,7 +466,21 @@
             * @retval false The property is writeable.
             * @throw std::out_of_range The property requested does not exist.
             */
- bool is_read_only(const std::string &property) const;
+ bool is_read_only(const std::string &property) const
+ {
+ property_collection::const_iterator itemItr = m_properties.find(property);
+
+ if( itemItr != m_properties.end() )
+ {
+ return (*itemItr).second->is_read_only();
+ }
+ else
+ {
+ stringstream err;
+ err << "The requested property \"" << property << "\" does not exist.";
+ throw std::out_of_range(err.str().c_str());
+ }
+ }
         //@}
 
         /** @name Actions */
@@ -628,13 +646,17 @@
             }
         }
 
- #pragma warning(push)
- #pragma warning( disable: 4251 )
+ #if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4251 )
+ #endif
             category_collection m_category_collection;
             children_collection m_children_collection;
             property_collection m_properties;
             action_collection m_actions;
- #pragma warning(pop)
+ #if defined(BOOST_MSVC)
+ #pragma warning(pop)
+ #endif
 
     private:
         property_group();

Modified: sandbox/pinhole/boost/pinhole/property_info.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_info.h (original)
+++ sandbox/pinhole/boost/pinhole/property_info.h 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
@@ -8,17 +8,25 @@
 #ifndef BOOST_PROPERTY_INFO
 #define BOOST_PROPERTY_INFO
 
-#pragma warning(push)
-#pragma warning( disable: 4272 4394 )
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4272 4394 )
+#endif
 #include "Editor.h"
-#pragma warning(pop)
-
-#pragma warning(push)
-#pragma warning( disable: 4561 4793 )
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
+
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4561 4793 )
+#endif
 #include <boost/type_traits.hpp>
 #include <boost/function.hpp>
 #include <boost/lexical_cast.hpp>
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
 namespace boost { namespace pinhole { namespace detail
 {

Modified: sandbox/pinhole/boost/pinhole/property_manager.h
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_manager.h (original)
+++ sandbox/pinhole/boost/pinhole/property_manager.h 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
@@ -12,12 +12,16 @@
 #include <set>
 #include <string>
 
-#pragma warning(push)
-#pragma warning( disable: 4561 4793 )
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4561 4793 )
+#endif
 #include <boost/shared_ptr.hpp>
 #include <boost/signals.hpp>
 #include <boost/algorithm/string.hpp>
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
 namespace boost { namespace pinhole
 {
@@ -39,11 +43,15 @@
             return m_instance; // address of sole instance
         }
         
- #pragma warning(push)
- #pragma warning( disable: 4251 )
+ #if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4251 )
+ #endif
             boost::signal<void(property_group*)> add_event;
             boost::signal<void(property_group*)> remove_event;
- #pragma warning(pop)
+ #if defined(BOOST_MSVC)
+ #pragma warning(pop)
+ #endif
         void raise_on_add_event( property_group *group )
         {
             add_event( group );
@@ -103,7 +111,7 @@
     // checked_delete can't be made a friend in gcc, so I can't shared_ptr
     // to work.
     public:
- ~property_manager()
+ virtual ~property_manager()
         {
             category_to_property_group_map::iterator itr = m_property_group_collection.begin();
             category_to_property_group_map::iterator itr_end = m_property_group_collection.end();
@@ -256,12 +264,16 @@
         }
         
     protected:
- #pragma warning(push)
- #pragma warning( disable: 4251 )
+ #if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4251 )
+ #endif
             static boost::shared_ptr<property_manager> m_instance;
             category_to_property_group_map m_property_group_collection;
             category_collection m_category_collection;
- #pragma warning(pop)
+ #if defined(BOOST_MSVC)
+ #pragma warning(pop)
+ #endif
             
         friend class property_group;
     };

Modified: sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h (original)
+++ sandbox/pinhole/libs/pinhole/test/TestClassesAndConstants.h 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
@@ -119,8 +119,10 @@
 class TestPropertyGroup : public property_group
 {
 public:
-#pragma warning(push)
-#pragma warning( disable: 4355 )
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
         TestPropertyGroup() : property_group( PROPERTY_GROUP_NAME, NULL ), m_child1( this ), m_child2( this )
         {
         m_bVarBool = false;
@@ -136,7 +138,9 @@
         add_property<string>(PROPERTY_STRING_2_VAR, "PropertyStringVar description", BOOST_SETTER_VAR(m_strVarString2), BOOST_GETTER_VAR(m_strVarString2), new StringEditor());
         add_property<bool>(PROPERTY_BOOL_VAR, "PropertyBoolVar description", BOOST_SETTER_VAR(m_bVarBool), BOOST_GETTER_VAR(m_bVarBool), new BoolEditor());
         }
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
         TestPropertyChildGroup m_child1;
         TestPropertyChildGroup m_child2;
@@ -243,8 +247,10 @@
 class TestPropertyGroup_3 : public property_group
 {
 public:
-#pragma warning(push)
-#pragma warning( disable: 4355 )
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
         TestPropertyGroup_3() : property_group( PROPERTY_GROUP_NAME, NULL ), m_child1( this ), m_child2( this )
         {
                 add_property<float>(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyGroup_3::SetFloat), BOOST_GETTER(&TestPropertyGroup_3::GetFloat), new FloatEditor() );
@@ -252,7 +258,9 @@
                 add_property<string>(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyGroup_3::SetPropertyString2), BOOST_GETTER(&TestPropertyGroup_3::GetPropertyString2), new StringEditor());
                 add_property<bool>(PROPERTY_BOOL, "PropertyBool description", BOOST_SETTER(&TestPropertyGroup_3::SetBool), BOOST_GETTER(&TestPropertyGroup_3::GetBool), new BoolEditor());
         }
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
         TestPropertyChildGroup_1 m_child1;
         TestPropertyChildGroup_1 m_child2;
@@ -300,8 +308,10 @@
 class TestPropertyGroup_4 : public property_group
 {
 public:
-#pragma warning(push)
-#pragma warning( disable: 4355 )
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
         TestPropertyGroup_4() : property_group( PROPERTY_GROUP_NAME, NULL ), m_child1( this ), m_child2( this )
         {
                 add_property<float>(PROPERTY_FLOAT_1, "PropertyFloat1 description", BOOST_SETTER(&TestPropertyGroup_4::SetFloat), BOOST_GETTER(&TestPropertyGroup_4::GetFloat), new FloatEditor() );
@@ -311,7 +321,9 @@
                 add_property<string>(PROPERTY_STRING_2, "PropertyString2 description", BOOST_SETTER(&TestPropertyGroup_4::SetPropertyString2), BOOST_GETTER(&TestPropertyGroup_4::GetPropertyString2), new StringEditor());
                 add_property<bool>(PROPERTY_BOOL, "PropertyBool description", BOOST_SETTER(&TestPropertyGroup_4::SetBool), BOOST_GETTER(&TestPropertyGroup_4::GetBool), new BoolEditor());
         }
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
         TestPropertyChildGroup_1 m_child1;
         TestPropertyChildGroup_1 m_child2;
@@ -382,8 +394,10 @@
 class TestAutoGeneratedDesigners : public property_group
 {
 public:
-#pragma warning(push)
-#pragma warning( disable: 4355 )
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
         TestAutoGeneratedDesigners() : property_group( PROPERTY_GROUP_NAME, NULL )
         {
                 add_property<string>(PROPERTY_STRING_1, "PropertyString1 description",
@@ -400,7 +414,9 @@
                                         BOOST_SETTER(&TestAutoGeneratedDesigners::SetDouble), BOOST_GETTER(&TestAutoGeneratedDesigners::GetDouble));
 
         }
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
 private:
         string GetPropertyString1(){return PROPERTY_STRING_1_VALUE;}
@@ -450,8 +466,10 @@
 class TestActionsFixture : public property_group
 {
 public:
-#pragma warning(push)
-#pragma warning( disable: 4355 )
+#if defined(BOOST_MSVC)
+ #pragma warning(push)
+ #pragma warning( disable: 4355 )
+#endif
         TestActionsFixture() : property_group( PROPERTY_GROUP_NAME, NULL )
         {
                 bTriggeredAction1 = false;
@@ -460,7 +478,9 @@
                 add_action(ACTION_1, "First BOOST_ACTION", BOOST_ACTION(&TestActionsFixture::Action1));
                 add_action(ACTION_2, "Second BOOST_ACTION", BOOST_ACTION(&TestActionsFixture::Action2));
         }
-#pragma warning(pop)
+#if defined(BOOST_MSVC)
+ #pragma warning(pop)
+#endif
 
         void Action1(){bTriggeredAction1 = true;}
         void Action2(){bTriggeredAction2 = true;}

Modified: sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/TestStringProperties.cpp 2007-07-31 01:28:47 EDT (Tue, 31 Jul 2007)
@@ -72,7 +72,6 @@
     BOOST_CHECK( typeid(double) != testGroup.get_type_info(PROPERTY_STRING_2) );
     BOOST_CHECK( typeid(std::string) == testGroup.get_type_info(PROPERTY_STRING_2) );
 
- const StringEditor *pEditor = dynamic_cast<const StringEditor*>(testGroup.get_metadata( PROPERTY_STRING_2 ));
         BOOST_CHECK( testGroup.get_metadata(PROPERTY_STRING_2)->getEditorPropertyType() == StringType );
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk