Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r--source/gameengine/Expressions/ListValue.cpp15
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp6
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h44
-rw-r--r--source/gameengine/Expressions/Value.cpp12
4 files changed, 5 insertions, 72 deletions
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp
index 38b00dcc8fb..5f45cdc48a2 100644
--- a/source/gameengine/Expressions/ListValue.cpp
+++ b/source/gameengine/Expressions/ListValue.cpp
@@ -242,15 +242,10 @@ static PySequenceMethods listvalue_as_sequence = {
listvalue_buffer_concat, /*sq_concat*/
NULL, /*sq_repeat*/
listvalue_buffer_item, /*sq_item*/
-#if (PY_VERSION_HEX >= 0x03000000) // TODO, slicing in py3?
- NULL,
- NULL,
- NULL,
-#else
- listvalue_buffer_slice, /*sq_slice*/
+// TODO, slicing in py3
+ NULL, // listvalue_buffer_slice, /*sq_slice*/
NULL, /*sq_ass_item*/
NULL, /*sq_ass_slice*/
-#endif
(objobjproc)listvalue_buffer_contains, /* sq_contains */
};
@@ -266,13 +261,7 @@ static PyMappingMethods instance_as_mapping = {
PyTypeObject CListValue::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"CListValue", /*tp_name*/
sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 04454f8232a..5be703f0fa4 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -57,13 +57,7 @@
PyTypeObject PyObjectPlus::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /*ob_size*/
-#endif
"PyObjectPlus", /*tp_name*/
sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/
0, /*tp_itemsize*/
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index a18df9d36a9..d68aa9f0410 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -51,44 +51,6 @@ extern "C" {
}
#endif
-extern "C" {
-#include "../../blender/python/intern/bpy_compat.h"
-}
-
-
-/*
- Py_RETURN_NONE
- Python 2.4 macro.
- defined here until we switch to 2.4
- also in api2_2x/gen_utils.h
-*/
-#ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
-#endif
-#ifndef Py_RETURN_FALSE
-#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
-#endif
-#ifndef Py_RETURN_TRUE
-#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
-#endif
-
-/* for pre Py 2.5 */
-#if PY_VERSION_HEX < 0x02050000
-typedef int Py_ssize_t;
-typedef Py_ssize_t (*lenfunc)(PyObject *);
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-#define PY_METHODCHAR char *
-#else
-/* Py 2.5 and later */
-#define intargfunc ssizeargfunc
-#define intintargfunc ssizessizeargfunc
-#define PY_METHODCHAR const char *
-#endif
-
-#include "descrobject.h"
-
-
static inline void Py_Fatal(const char *M) {
fprintf(stderr, "%s\n", M);
exit(-1);
@@ -230,13 +192,13 @@ typedef struct {
* Method table macro (with doc)
*/
#define KX_PYMETHODTABLE(class_name, method_name) \
- {#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS, (PY_METHODCHAR)class_name::method_name##_doc}
+ {#method_name , (PyCFunction) class_name::sPy##method_name, METH_VARARGS, (const char *)class_name::method_name##_doc}
#define KX_PYMETHODTABLE_O(class_name, method_name) \
- {#method_name , (PyCFunction) class_name::sPy##method_name, METH_O, (PY_METHODCHAR)class_name::method_name##_doc}
+ {#method_name , (PyCFunction) class_name::sPy##method_name, METH_O, (const char *)class_name::method_name##_doc}
#define KX_PYMETHODTABLE_NOARGS(class_name, method_name) \
- {#method_name , (PyCFunction) class_name::sPy##method_name, METH_NOARGS, (PY_METHODCHAR)class_name::method_name##_doc}
+ {#method_name , (PyCFunction) class_name::sPy##method_name, METH_NOARGS, (const char *)class_name::method_name##_doc}
/**
* Function implementation macro
diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp
index 2759b68b62e..04bcc3a5561 100644
--- a/source/gameengine/Expressions/Value.cpp
+++ b/source/gameengine/Expressions/Value.cpp
@@ -36,13 +36,7 @@ double CValue::m_sZeroVec[3] = {0.0,0.0,0.0};
#ifndef NO_EXP_PYTHON_EMBEDDING
PyTypeObject CValue::Type = {
-#if (PY_VERSION_HEX >= 0x02060000)
PyVarObject_HEAD_INIT(NULL, 0)
-#else
- /* python 2.5 and below */
- PyObject_HEAD_INIT( NULL ) /* required py macro */
- 0, /* ob_size */
-#endif
"CValue",
sizeof(PyObjectPlus_Proxy),
0,
@@ -594,12 +588,6 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
{
vallie = new CFloatValue( (float)PyFloat_AsDouble(pyobj) );
} else
-#if PY_VERSION_HEX < 0x03000000
- if (PyInt_Check(pyobj))
- {
- vallie = new CIntValue( (cInt)PyInt_AS_LONG(pyobj) );
- } else
-#endif
if (PyLong_Check(pyobj))
{
vallie = new CIntValue( (cInt)PyLong_AsLongLong(pyobj) );