Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 5330bd0

Browse files
authored
Merge pull request #115 from olivier-stasse/devel
Bug fixes
2 parents 380360b + f683732 commit 5330bd0

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem
22
# Saurel, JRL, CNRS/AIST, LAAS-CNRS
33

4-
cmake_minimum_required(VERSION 3.1)
4+
cmake_minimum_required(VERSION 3.10)
55

66
# Project properties
77
set(PROJECT_ORG stack-of-tasks)

include/dynamic-graph/python/interpreter.hh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class DYNAMIC_GRAPH_PYTHON_DLLAPI Interpreter {
5151
PyThreadState* _pyState;
5252
/// Pointer to the dictionary of global variables
5353
PyObject* globals_;
54-
/// Pointer to the dictionary of local variables
55-
PyObject* locals_;
5654
PyObject* mainmod_;
5755
};
5856
} // namespace python

src/dynamic_graph/convert-dg-to-py.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <boost/python.hpp>
1010
#include <boost/python/stl_iterator.hpp>
11+
#include <cstdint>
1112
#include <iostream>
1213
#include <sstream>
1314

@@ -30,11 +31,11 @@ command::Value toValue(bp::object o, const command::Value::Type& valueType) {
3031
case (Value::UNSIGNED):
3132
return Value(bp::extract<unsigned>(o));
3233
case (Value::UNSIGNEDLONGINT):
33-
return Value(bp::extract<unsigned long int>(o));
34+
return Value(bp::extract<std::uint64_t>(o));
3435
case (Value::INT):
3536
return Value(bp::extract<int>(o));
3637
case (Value::LONGINT):
37-
return Value(bp::extract<long int>(o));
38+
return Value(bp::extract<std::int64_t>(o));
3839
case (Value::FLOAT):
3940
return Value(bp::extract<float>(o));
4041
case (Value::DOUBLE):

src/dynamic_graph/entity-py.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ bp::object executeCmd(bp::tuple args, bp::dict) {
8383
throw std::out_of_range("Wrong number of arguments");
8484
std::vector<Value> values;
8585
values.reserve(command.valueTypes().size());
86-
for (int i = 1; i < bp::len(args); ++i)
87-
values.push_back(convert::toValue(args[i], command.valueTypes()[i - 1]));
86+
for (bp::ssize_t i = 1; i < bp::len(args); ++i)
87+
values.push_back(convert::toValue(
88+
args[i],
89+
command
90+
.valueTypes()[static_cast<std::vector<Value>::size_type>(i - 1)]));
8891
command.setParameterValues(values);
8992
return convert::fromValue(command.execute());
9093
}

src/interpreter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ void Interpreter::runMain(void) {
247247

248248
std::string Interpreter::processStream(std::istream& stream, std::ostream& os) {
249249
char line[10000];
250-
sprintf(line, "%s", "\n");
251-
std::string command;
252250
std::streamsize maxSize = 10000;
251+
snprintf(line, static_cast<size_t>(maxSize), "%s", "\n");
252+
std::string command;
253253
#if 0
254254
while (line != std::string("")) {
255255
stream.getline(line, maxSize, '\n');

0 commit comments

Comments
 (0)