diff --git a/CMakeLists.txt b/CMakeLists.txt index 552615e..9b83163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem # Saurel, JRL, CNRS/AIST, LAAS-CNRS -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.10) # Project properties set(PROJECT_ORG stack-of-tasks) diff --git a/cmake b/cmake index 08c2c18..f0843d8 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 08c2c18b9033c2f0a86b885b589f4fa63a163caf +Subproject commit f0843d890d005a0b1f6c7bbe6e702b6f9c8136eb diff --git a/include/dynamic-graph/python/interpreter.hh b/include/dynamic-graph/python/interpreter.hh index 7ac7f05..6889cb4 100644 --- a/include/dynamic-graph/python/interpreter.hh +++ b/include/dynamic-graph/python/interpreter.hh @@ -51,8 +51,6 @@ class DYNAMIC_GRAPH_PYTHON_DLLAPI Interpreter { PyThreadState* _pyState; /// Pointer to the dictionary of global variables PyObject* globals_; - /// Pointer to the dictionary of local variables - PyObject* locals_; PyObject* mainmod_; }; } // namespace python diff --git a/src/dynamic_graph/convert-dg-to-py.cc b/src/dynamic_graph/convert-dg-to-py.cc index d4b1f50..a112446 100644 --- a/src/dynamic_graph/convert-dg-to-py.cc +++ b/src/dynamic_graph/convert-dg-to-py.cc @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -30,11 +31,11 @@ command::Value toValue(bp::object o, const command::Value::Type& valueType) { case (Value::UNSIGNED): return Value(bp::extract(o)); case (Value::UNSIGNEDLONGINT): - return Value(bp::extract(o)); + return Value(bp::extract(o)); case (Value::INT): return Value(bp::extract(o)); case (Value::LONGINT): - return Value(bp::extract(o)); + return Value(bp::extract(o)); case (Value::FLOAT): return Value(bp::extract(o)); case (Value::DOUBLE): diff --git a/src/dynamic_graph/entity-py.cc b/src/dynamic_graph/entity-py.cc index b62839c..c258424 100644 --- a/src/dynamic_graph/entity-py.cc +++ b/src/dynamic_graph/entity-py.cc @@ -83,8 +83,11 @@ bp::object executeCmd(bp::tuple args, bp::dict) { throw std::out_of_range("Wrong number of arguments"); std::vector values; values.reserve(command.valueTypes().size()); - for (int i = 1; i < bp::len(args); ++i) - values.push_back(convert::toValue(args[i], command.valueTypes()[i - 1])); + for (bp::ssize_t i = 1; i < bp::len(args); ++i) + values.push_back(convert::toValue( + args[i], + command + .valueTypes()[static_cast::size_type>(i - 1)])); command.setParameterValues(values); return convert::fromValue(command.execute()); } diff --git a/src/interpreter.cc b/src/interpreter.cc index f80dbb1..97fcbe0 100644 --- a/src/interpreter.cc +++ b/src/interpreter.cc @@ -247,9 +247,9 @@ void Interpreter::runMain(void) { std::string Interpreter::processStream(std::istream& stream, std::ostream& os) { char line[10000]; - sprintf(line, "%s", "\n"); - std::string command; std::streamsize maxSize = 10000; + snprintf(line, static_cast(maxSize), "%s", "\n"); + std::string command; #if 0 while (line != std::string("")) { stream.getline(line, maxSize, '\n');