From 6cde5fd0d21811abfe12a637804ce9e3fb1f48f7 Mon Sep 17 00:00:00 2001 From: Antonio El Khoury <aelkhour@laas.fr> Date: Tue, 16 Oct 2012 13:23:44 +0200 Subject: [PATCH] Fix compilation on Ubuntu 10.04 (32 bits). --- src/convert-dg-to-py.cc | 4 ++-- src/entity-py.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/convert-dg-to-py.cc b/src/convert-dg-to-py.cc index 249e6a7..542b670 100644 --- a/src/convert-dg-to-py.cc +++ b/src/convert-dg-to-py.cc @@ -132,7 +132,7 @@ namespace dynamicgraph { } size = PyTuple_Size(pyObject); v.resize(size); - for (unsigned int i=0; i<size; i++) { + for (Py_ssize_t i=0; i<size; i++) { PyObject* pyDouble = PyTuple_GetItem(pyObject, i); if (PyFloat_Check(pyDouble)) v(i) = PyFloat_AsDouble(pyDouble); @@ -165,7 +165,7 @@ namespace dynamicgraph { m.resize((unsigned int)nRows, (unsigned int)nCols); fillMatrixRow(m, 0, row); - for (unsigned int iRow=1; iRow<nRows; iRow++) { + for (Py_ssize_t iRow=1; iRow<nRows; iRow++) { row = PyTuple_GetItem(pyObject, iRow); if (!PyTuple_Check(row)) { throw ExceptionPython(ExceptionPython::MATRIX_PARSING, diff --git a/src/entity-py.cc b/src/entity-py.cc index 616b312..9e25e70 100644 --- a/src/entity-py.cc +++ b/src/entity-py.cc @@ -218,7 +218,7 @@ namespace dynamicgraph { } std::vector<Value> valueVector; - for (unsigned int iParam=0; iParam<size; iParam++) { + for (Py_ssize_t iParam=0; iParam<size; iParam++) { PyObject* PyValue = PyTuple_GetItem(argTuple, iParam); Value::Type valueType = typeVector[iParam]; try { -- GitLab