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:
authorJorge Bernal <jbernalmartinez@gmail.com>2015-02-18 21:52:54 +0300
committerJorge Bernal <jbernalmartinez@gmail.com>2015-02-18 21:52:54 +0300
commit9bd2a7c0a8fff43d9193184ca6920b4aaed5f6c1 (patch)
treeb0a92f3402cac6ae32686f3e4776082f1a79a4cd /source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
parent839a6b22d6c3750b0c8a98ccdb50d57e475ec754 (diff)
BGE: Fix T41570: Blender crash when physics createConstraint
Move physicsid type to unsigned long long to avoid crashes on Windows 8.1 64bits. Other systems also modified to put them inline with this solution. Reviewers: dfelinto, brita_, moguri, juicyfruit, campbellbarton Reviewed By: juicyfruit, campbellbarton Subscribers: juicyfruit Differential Revision: https://developer.blender.org/D1122
Diffstat (limited to 'source/gameengine/Ketsji/KX_PyConstraintBinding.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PyConstraintBinding.cpp45
1 files changed, 9 insertions, 36 deletions
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
index 1b69eab8e28..51ae5ca9586 100644
--- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
+++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
@@ -495,11 +495,7 @@ static PyObject *gPyCreateConstraint(PyObject *self,
PyObject *kwds)
{
/* FIXME - physicsid is a long being cast to a pointer, should at least use PyCapsule */
-#if defined(_WIN64)
- __int64 physicsid=0,physicsid2 = 0;
-#else
- long physicsid=0,physicsid2 = 0;
-#endif
+ unsigned long long physicsid = 0, physicsid2 = 0;
int constrainttype=0, extrainfo=0;
int len = PyTuple_Size(args);
int success = 1;
@@ -508,51 +504,28 @@ static PyObject *gPyCreateConstraint(PyObject *self,
float pivotX=1,pivotY=1,pivotZ=1,axisX=0,axisY=0,axisZ=1;
if (len == 3)
{
-#if defined(_WIN64)
- success = PyArg_ParseTuple(args,"LLi",&physicsid,&physicsid2,&constrainttype);
-#else
- success = PyArg_ParseTuple(args,"lli",&physicsid,&physicsid2,&constrainttype);
-#endif
+ success = PyArg_ParseTuple(args, "KKi", &physicsid, &physicsid2, &constrainttype);
}
else if (len == 6)
{
-#if defined(_WIN64)
- success = PyArg_ParseTuple(args,"LLifff",&physicsid,&physicsid2,&constrainttype,
- &pivotX,&pivotY,&pivotZ);
-#else
- success = PyArg_ParseTuple(args,"llifff",&physicsid,&physicsid2,&constrainttype,
- &pivotX,&pivotY,&pivotZ);
-#endif
+ success = PyArg_ParseTuple(args, "KKifff", &physicsid, &physicsid2, &constrainttype,
+ &pivotX, &pivotY, &pivotZ);
}
else if (len == 9)
{
-#if defined(_WIN64)
- success = PyArg_ParseTuple(args,"LLiffffff",&physicsid,&physicsid2,&constrainttype,
- &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ);
-#else
- success = PyArg_ParseTuple(args,"lliffffff",&physicsid,&physicsid2,&constrainttype,
- &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ);
-#endif
+ success = PyArg_ParseTuple(args, "KKiffffff", &physicsid, &physicsid2, &constrainttype,
+ &pivotX, &pivotY, &pivotZ, &axisX, &axisY, &axisZ);
}
else if (len == 10)
{
-#if defined(_WIN64)
- success = PyArg_ParseTuple(args,"LLiffffffi",&physicsid,&physicsid2,&constrainttype,
- &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag);
-#else
- success = PyArg_ParseTuple(args,"lliffffffi",&physicsid,&physicsid2,&constrainttype,
- &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag);
-#endif
+ success = PyArg_ParseTuple(args, "KKiffffffi", &physicsid, &physicsid2, &constrainttype,
+ &pivotX, &pivotY, &pivotZ, &axisX, &axisY, &axisZ, &flag);
}
/* XXX extrainfo seems to be nothing implemented. right now it works as a pivot with [X,0,0] */
else if (len == 4)
{
-#if defined(_WIN64)
- success = PyArg_ParseTuple(args,"LLii",&physicsid,&physicsid2,&constrainttype,&extrainfo);
-#else
- success = PyArg_ParseTuple(args,"llii",&physicsid,&physicsid2,&constrainttype,&extrainfo);
-#endif
+ success = PyArg_ParseTuple(args,"KKii", &physicsid, &physicsid2, &constrainttype, &extrainfo);
pivotX=extrainfo;
}