python3.9.patch 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
  2. index 19fc05e66ea..5e10baa43ac 100644
  3. --- a/source/blender/python/mathutils/mathutils_Matrix.c
  4. +++ b/source/blender/python/mathutils/mathutils_Matrix.c
  5. @@ -43,7 +43,8 @@ static PyObject *Matrix_copy_notest(MatrixObject *self, const float *matrix);
  6. static PyObject *Matrix_copy(MatrixObject *self);
  7. static PyObject *Matrix_deepcopy(MatrixObject *self, PyObject *args);
  8. static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *value);
  9. -static PyObject *matrix__apply_to_copy(PyNoArgsFunction matrix_func, MatrixObject *self);
  10. +static PyObject *matrix__apply_to_copy(PyObject *(*matrix_func)(MatrixObject *),
  11. + MatrixObject *self);
  12. static PyObject *MatrixAccess_CreatePyObject(MatrixObject *matrix, const eMatrixAccess_t type);
  13. static int matrix_row_vector_check(MatrixObject *mat, VectorObject *vec, int row)
  14. @@ -380,14 +381,15 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
  15. return NULL;
  16. }
  17. -static PyObject *matrix__apply_to_copy(PyNoArgsFunction matrix_func, MatrixObject *self)
  18. +static PyObject *matrix__apply_to_copy(PyObject *(*matrix_func)(MatrixObject *),
  19. + MatrixObject *self)
  20. {
  21. PyObject *ret = Matrix_copy(self);
  22. if (ret) {
  23. - PyObject *ret_dummy = matrix_func(ret);
  24. + PyObject *ret_dummy = matrix_func((MatrixObject *)ret);
  25. if (ret_dummy) {
  26. Py_DECREF(ret_dummy);
  27. - return (PyObject *)ret;
  28. + return ret;
  29. }
  30. else { /* error */
  31. Py_DECREF(ret);
  32. @@ -1593,7 +1595,7 @@ PyDoc_STRVAR(Matrix_adjugated_doc,
  33. );
  34. static PyObject *Matrix_adjugated(MatrixObject *self)
  35. {
  36. - return matrix__apply_to_copy((PyNoArgsFunction)Matrix_adjugate, self);
  37. + return matrix__apply_to_copy(Matrix_adjugate, self);
  38. }
  39. PyDoc_STRVAR(Matrix_rotate_doc,
  40. @@ -1799,7 +1801,7 @@ PyDoc_STRVAR(Matrix_transposed_doc,
  41. );
  42. static PyObject *Matrix_transposed(MatrixObject *self)
  43. {
  44. - return matrix__apply_to_copy((PyNoArgsFunction)Matrix_transpose, self);
  45. + return matrix__apply_to_copy(Matrix_transpose, self);
  46. }
  47. /*---------------------------matrix.normalize() ------------------*/
  48. @@ -1846,7 +1848,7 @@ PyDoc_STRVAR(Matrix_normalized_doc,
  49. );
  50. static PyObject *Matrix_normalized(MatrixObject *self)
  51. {
  52. - return matrix__apply_to_copy((PyNoArgsFunction)Matrix_normalize, self);
  53. + return matrix__apply_to_copy(Matrix_normalize, self);
  54. }
  55. /*---------------------------matrix.zero() -----------------------*/
  56. diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
  57. index 7255c0028d7..89c448d6413 100644
  58. --- a/source/blender/python/mathutils/mathutils_Quaternion.c
  59. +++ b/source/blender/python/mathutils/mathutils_Quaternion.c
  60. @@ -35,7 +35,8 @@
  61. #define QUAT_SIZE 4
  62. -static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObject *self);
  63. +static PyObject *quat__apply_to_copy(PyObject *(*quat_func)(QuaternionObject *),
  64. + QuaternionObject *self);
  65. static void quat__axis_angle_sanitize(float axis[3], float *angle);
  66. static PyObject *Quaternion_copy(QuaternionObject *self);
  67. static PyObject *Quaternion_deepcopy(QuaternionObject *self, PyObject *args);
  68. @@ -376,7 +377,7 @@ PyDoc_STRVAR(Quaternion_normalized_doc,
  69. );
  70. static PyObject *Quaternion_normalized(QuaternionObject *self)
  71. {
  72. - return quat__apply_to_copy((PyNoArgsFunction)Quaternion_normalize, self);
  73. + return quat__apply_to_copy(Quaternion_normalize, self);
  74. }
  75. PyDoc_STRVAR(Quaternion_invert_doc,
  76. @@ -404,7 +405,7 @@ PyDoc_STRVAR(Quaternion_inverted_doc,
  77. );
  78. static PyObject *Quaternion_inverted(QuaternionObject *self)
  79. {
  80. - return quat__apply_to_copy((PyNoArgsFunction)Quaternion_invert, self);
  81. + return quat__apply_to_copy(Quaternion_invert, self);
  82. }
  83. PyDoc_STRVAR(Quaternion_identity_doc,
  84. @@ -468,7 +469,7 @@ PyDoc_STRVAR(Quaternion_conjugated_doc,
  85. );
  86. static PyObject *Quaternion_conjugated(QuaternionObject *self)
  87. {
  88. - return quat__apply_to_copy((PyNoArgsFunction)Quaternion_conjugate, self);
  89. + return quat__apply_to_copy(Quaternion_conjugate, self);
  90. }
  91. PyDoc_STRVAR(Quaternion_copy_doc,
  92. @@ -1143,10 +1144,11 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw
  93. return Quaternion_CreatePyObject(quat, type);
  94. }
  95. -static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObject *self)
  96. +static PyObject *quat__apply_to_copy(PyObject *(*quat_func)(QuaternionObject *),
  97. + QuaternionObject *self)
  98. {
  99. PyObject *ret = Quaternion_copy(self);
  100. - PyObject *ret_dummy = quat_func(ret);
  101. + PyObject *ret_dummy = quat_func((QuaternionObject *)ret);
  102. if (ret_dummy) {
  103. Py_DECREF(ret_dummy);
  104. return ret;
  105. diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
  106. index b3bba79280d..626eaa6505f 100644
  107. --- a/source/blender/python/mathutils/mathutils_Vector.c
  108. +++ b/source/blender/python/mathutils/mathutils_Vector.c
  109. @@ -94,10 +94,10 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
  110. return Vector_CreatePyObject_alloc(vec, size, type);
  111. }
  112. -static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *self)
  113. +static PyObject *vec__apply_to_copy(PyObject *(*vec_func)(VectorObject *), VectorObject *self)
  114. {
  115. PyObject *ret = Vector_copy(self);
  116. - PyObject *ret_dummy = vec_func(ret);
  117. + PyObject *ret_dummy = vec_func((VectorObject *)ret);
  118. if (ret_dummy) {
  119. Py_DECREF(ret_dummy);
  120. return (PyObject *)ret;
  121. @@ -380,7 +380,7 @@ PyDoc_STRVAR(Vector_normalized_doc,
  122. );
  123. static PyObject *Vector_normalized(VectorObject *self)
  124. {
  125. - return vec__apply_to_copy((PyNoArgsFunction)Vector_normalize, self);
  126. + return vec__apply_to_copy(Vector_normalize, self);
  127. }
  128. PyDoc_STRVAR(Vector_resize_doc,