From 07798f2e23b35e0963c760a247b96518cfc34ea9 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Mon, 9 Nov 2015 18:14:57 +0000 Subject: [PATCH] More changes suggested by compiling with clang --- src/runner/pythonrunner.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 47b3881..52fe60f 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -243,7 +243,9 @@ struct QVariant_from_python_obj } else if (PyBool_Check(objPtr)) { result = (objPtr == Py_True); } else if (PyInt_Check(objPtr)) { - result = PyInt_AsLong(objPtr); + //QVariant doesn't have long. It has int or long long. Given that on m/s, + //long is 32 bits for 32- and 64- bit code... + result = static_cast(PyInt_AsLong(objPtr)); } else { PyErr_SetString(PyExc_TypeError, "type unsupported"); throw bpy::error_already_set(); @@ -267,7 +269,9 @@ struct QVariant_from_python_obj bool value = (objPtr == Py_True); constructVariant(value, data); } else if (PyInt_Check(objPtr)) { - long value = PyInt_AsLong(objPtr); + //QVariant doesn't have long. It has int or long long. Given that on m/s, + //long is 32 bits for 32- and 64- bit code... + int value = static_cast(PyInt_AsLong(objPtr)); constructVariant(value, data); } else { PyErr_SetString(PyExc_TypeError, "type unsupported");