From dc1c4691bb6040e4bf28d46e1644b774c705ce74 Mon Sep 17 00:00:00 2001 From: florent <florent@laas.fr> Date: Mon, 15 Nov 2010 14:57:20 +0100 Subject: [PATCH] Fix compilation error messages after rebase * include/dynamic-graph/command-getter.h, * include/dynamic-graph/command-setter.h, * include/dynamic-graph/command.h, * include/dynamic-graph/entity.h, * include/dynamic-graph/value.h, * src/command/command.cpp, * src/command/value.cpp. --- include/dynamic-graph/command-getter.h | 2 +- include/dynamic-graph/command-setter.h | 2 +- include/dynamic-graph/command.h | 2 +- include/dynamic-graph/entity.h | 2 +- include/dynamic-graph/value.h | 14 +++++++------- src/command/command.cpp | 1 - src/command/value.cpp | 18 +++++++++++------- 7 files changed, 22 insertions(+), 19 deletions(-) diff --git a/include/dynamic-graph/command-getter.h b/include/dynamic-graph/command-getter.h index 3db2d17..336eea5 100644 --- a/include/dynamic-graph/command-getter.h +++ b/include/dynamic-graph/command-getter.h @@ -53,7 +53,7 @@ namespace dynamicgraph { /// \li prototype of E::getParameter should be exactly as specified in this /// example. template <class E, typename T> - class Getter : public Command { + class DYNAMIC_GRAPH_DLLEXPORT Getter : public Command { public: /// Pointer to method that sets paramter of type T typedef T (E::*GetterMethod) () const; diff --git a/include/dynamic-graph/command-setter.h b/include/dynamic-graph/command-setter.h index 3d04e26..f6648c1 100644 --- a/include/dynamic-graph/command-setter.h +++ b/include/dynamic-graph/command-setter.h @@ -53,7 +53,7 @@ namespace dynamicgraph { /// \li prototype of E::setParameter should be exactly as specified in this /// example. template <class E, typename T> - class Setter : public Command { + class DYNAMIC_GRAPH_DLLEXPORT Setter : public Command { public: /// Pointer to method that sets paramter of type T typedef void (E::*SetterMethod) (const T&); diff --git a/include/dynamic-graph/command.h b/include/dynamic-graph/command.h index 9ab5f06..f15e793 100644 --- a/include/dynamic-graph/command.h +++ b/include/dynamic-graph/command.h @@ -40,7 +40,7 @@ namespace dynamicgraph { /// Parameters are set by calling Command::setParameterValues with a /// vector of Values the types of which should fit the vector specified /// at construction. - class DYNAMICGRAPH_EXPORT Command + class DYNAMIC_GRAPH_DLLEXPORT Command { public: virtual ~Command(); diff --git a/include/dynamic-graph/entity.h b/include/dynamic-graph/entity.h index c1c5f4d..b586ad9 100644 --- a/include/dynamic-graph/entity.h +++ b/include/dynamic-graph/entity.h @@ -44,7 +44,7 @@ namespace dynamicgraph { // Forward declaration namespace command { class Command; - }; + } /* --------------------------------------------------------------------- */ /* --- CLASS ----------------------------------------------------------- */ diff --git a/include/dynamic-graph/value.h b/include/dynamic-graph/value.h index 4846800..5346afb 100644 --- a/include/dynamic-graph/value.h +++ b/include/dynamic-graph/value.h @@ -41,7 +41,7 @@ namespace dynamicgraph { const Value* value_; }; - class DYNAMICGRAPH_EXPORT Value { + class DYNAMIC_GRAPH_DLLEXPORT Value { public: enum Type { NONE, @@ -86,12 +86,12 @@ namespace dynamicgraph { friend std::ostream& operator<<(std::ostream& os, const Value& value); private: friend class EitherType; - const bool boolValue() const; - const unsigned unsignedValue() const; - const int intValue() const; - const float floatValue() const; - const double doubleValue() const; - const std::string stringValue() const; + bool boolValue() const; + unsigned unsignedValue() const; + int intValue() const; + float floatValue() const; + double doubleValue() const; + std::string stringValue() const; Type type_; const void* value_; }; diff --git a/src/command/command.cpp b/src/command/command.cpp index eb89ec8..ea6343d 100644 --- a/src/command/command.cpp +++ b/src/command/command.cpp @@ -36,7 +36,6 @@ namespace dynamicgraph { void Command::setParameterValues(const std::vector<Value>& values) { - unsigned int size = values.size(); const std::vector<Value::Type>& paramTypes = valueTypes(); // Check that number of parameters is correct if (values.size() != paramTypes.size()) { diff --git a/src/command/value.cpp b/src/command/value.cpp index 121c8f5..b965bf3 100644 --- a/src/command/value.cpp +++ b/src/command/value.cpp @@ -76,6 +76,7 @@ namespace dynamicgraph { case STRING: delete (std::string*)value_; break; + default:; } } @@ -152,7 +153,7 @@ namespace dynamicgraph { return type_; } - const bool Value::boolValue () const + bool Value::boolValue () const { if (type_ == BOOL) return *((bool*)value_); @@ -160,7 +161,7 @@ namespace dynamicgraph { "value is not an bool"); } - const unsigned Value::unsignedValue () const + unsigned Value::unsignedValue () const { if (type_ == UNSIGNED) return *((unsigned*)value_); @@ -168,7 +169,7 @@ namespace dynamicgraph { "value is not an unsigned int"); } - const int Value::intValue () const + int Value::intValue () const { if (type_ == INT) return *((int*)value_); @@ -176,7 +177,7 @@ namespace dynamicgraph { "value is not an int int"); } - const float Value::floatValue () const + float Value::floatValue () const { float result; if (type_ == FLOAT) @@ -186,7 +187,7 @@ namespace dynamicgraph { "value is not a float"); } - const double Value::doubleValue () const + double Value::doubleValue () const { double result; if (type_ == DOUBLE) @@ -196,7 +197,7 @@ namespace dynamicgraph { "value is not a double"); } - const std::string Value::stringValue () const + std::string Value::stringValue () const { if (type_ == STRING) return *((std::string*)value_); @@ -219,8 +220,9 @@ namespace dynamicgraph { return std::string("double"); case STRING: return std::string("string"); + default: + return std::string("unknown"); } - return std::string("unknown"); } std::ostream& operator<<(std::ostream& os, const Value& value) @@ -246,6 +248,8 @@ namespace dynamicgraph { case Value::STRING: os << value.stringValue(); break; + default: + return os; } return os; } -- GitLab