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:
authorNicholas Bishop <nicholasbishop@gmail.com>2010-10-19 04:45:37 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2010-10-19 04:45:37 +0400
commita377a7edf67869722c585086ac6ab1f295cbff87 (patch)
tree1736de08fe9174761607dce5d54a16af25eba049 /source/blender/python/generic/mathutils_matrix.c
parent08232350d5797302e3638e69ec78657d853976aa (diff)
parentb743454ce1c361e6161da8ae5f840c2befe3a081 (diff)
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r32300:32571soc-2010-nicolasbishop
Diffstat (limited to 'source/blender/python/generic/mathutils_matrix.c')
-rw-r--r--source/blender/python/generic/mathutils_matrix.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/python/generic/mathutils_matrix.c b/source/blender/python/generic/mathutils_matrix.c
index 3b8c7d3122a..9476e8127b6 100644
--- a/source/blender/python/generic/mathutils_matrix.c
+++ b/source/blender/python/generic/mathutils_matrix.c
@@ -108,7 +108,7 @@ Mathutils_Callback mathutils_matrix_vector_cb = {
//----------------------------------mathutils.Matrix() -----------------
//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc.
//create a new matrix type
-static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *Matrix_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
{
PyObject *argObject, *m, *s;
MatrixObject *mat;
@@ -117,6 +117,11 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
float scalar;
+ if(kwds && PyDict_Size(kwds)) {
+ PyErr_SetString(PyExc_TypeError, "mathutils.Matrix(): takes no keyword args");
+ return NULL;
+ }
+
argSize = PyTuple_GET_SIZE(args);
if(argSize > MATRIX_MAX_DIM) { //bad arg nums
PyErr_SetString(PyExc_AttributeError, "mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n");
@@ -1142,7 +1147,7 @@ static char Matrix_copy_doc[] =
" :return: an instance of itself\n"
" :rtype: :class:`Matrix`\n";
-PyObject *Matrix_copy(MatrixObject * self)
+PyObject *Matrix_copy(MatrixObject *self)
{
if(!BaseMath_ReadCallback(self))
return NULL;
@@ -1680,17 +1685,17 @@ static PyNumberMethods Matrix_NumMethods = {
0, /* nb_index */
};
-static PyObject *Matrix_getRowSize( MatrixObject * self, void *type )
+static PyObject *Matrix_getRowSize(MatrixObject *self, void *UNUSED(closure))
{
return PyLong_FromLong((long) self->rowSize);
}
-static PyObject *Matrix_getColSize( MatrixObject * self, void *type )
+static PyObject *Matrix_getColSize(MatrixObject *self, void *UNUSED(closure))
{
return PyLong_FromLong((long) self->colSize);
}
-static PyObject *Matrix_getMedianScale( MatrixObject * self, void *type )
+static PyObject *Matrix_getMedianScale(MatrixObject *self, void *UNUSED(closure))
{
float mat[3][3];
@@ -1710,7 +1715,7 @@ static PyObject *Matrix_getMedianScale( MatrixObject * self, void *type )
return PyFloat_FromDouble(mat3_to_scale(mat));
}
-static PyObject *Matrix_getIsNegative( MatrixObject * self, void *type )
+static PyObject *Matrix_getIsNegative(MatrixObject *self, void *UNUSED(closure))
{
if(!BaseMath_ReadCallback(self))
return NULL;