diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/python/mathutils/mathutils_Matrix.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Matrix.h')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.h b/source/blender/python/mathutils/mathutils_Matrix.h index 0f47472c8fd..3b42e22a787 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.h +++ b/source/blender/python/mathutils/mathutils_Matrix.h @@ -18,7 +18,6 @@ * \ingroup pymathutils */ - #ifndef __MATHUTILS_MATRIX_H__ #define __MATHUTILS_MATRIX_H__ @@ -33,23 +32,25 @@ extern PyTypeObject matrix_access_Type; /* matrix[row][col] == MATRIX_ITEM_INDEX(matrix, row, col) */ #ifdef DEBUG -# define MATRIX_ITEM_ASSERT(_mat, _row, _col) (BLI_assert(_row < (_mat)->num_row && _col < (_mat)->num_col)) +# define MATRIX_ITEM_ASSERT(_mat, _row, _col) \ + (BLI_assert(_row < (_mat)->num_row && _col < (_mat)->num_col)) #else # define MATRIX_ITEM_ASSERT(_mat, _row, _col) (void)0 #endif #define MATRIX_ITEM_INDEX_NUMROW(_totrow, _row, _col) (((_totrow) * (_col)) + (_row)) -#define MATRIX_ITEM_INDEX(_mat, _row, _col) (MATRIX_ITEM_ASSERT(_mat, _row, _col),(((_mat)->num_row * (_col)) + (_row))) -#define MATRIX_ITEM_PTR( _mat, _row, _col) ((_mat)->matrix + MATRIX_ITEM_INDEX(_mat, _row, _col)) -#define MATRIX_ITEM( _mat, _row, _col) ((_mat)->matrix [MATRIX_ITEM_INDEX(_mat, _row, _col)]) +#define MATRIX_ITEM_INDEX(_mat, _row, _col) \ + (MATRIX_ITEM_ASSERT(_mat, _row, _col), (((_mat)->num_row * (_col)) + (_row))) +#define MATRIX_ITEM_PTR(_mat, _row, _col) ((_mat)->matrix + MATRIX_ITEM_INDEX(_mat, _row, _col)) +#define MATRIX_ITEM(_mat, _row, _col) ((_mat)->matrix[MATRIX_ITEM_INDEX(_mat, _row, _col)]) #define MATRIX_COL_INDEX(_mat, _col) (MATRIX_ITEM_INDEX(_mat, 0, _col)) -#define MATRIX_COL_PTR( _mat, _col) ((_mat)->matrix + MATRIX_COL_INDEX(_mat, _col)) +#define MATRIX_COL_PTR(_mat, _col) ((_mat)->matrix + MATRIX_COL_INDEX(_mat, _col)) typedef struct { - BASE_MATH_MEMBERS(matrix); - unsigned short num_col; - unsigned short num_row; + BASE_MATH_MEMBERS(matrix); + unsigned short num_col; + unsigned short num_row; } MatrixObject; /* struct data contains a pointer to the actual data that the @@ -58,21 +59,20 @@ typedef struct { * blender (stored in blend_data). This is an either/or struct not both */ /* prototypes */ -PyObject *Matrix_CreatePyObject( - const float *mat, - const unsigned short num_col, const unsigned short num_row, - PyTypeObject *base_type - ) ATTR_WARN_UNUSED_RESULT; -PyObject *Matrix_CreatePyObject_wrap( - float *mat, - const unsigned short num_col, const unsigned short num_row, - PyTypeObject *base_type - ) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); -PyObject *Matrix_CreatePyObject_cb( - PyObject *user, - const unsigned short num_col, const unsigned short num_row, - unsigned char cb_type, unsigned char cb_subtype - ) ATTR_WARN_UNUSED_RESULT; +PyObject *Matrix_CreatePyObject(const float *mat, + const unsigned short num_col, + const unsigned short num_row, + PyTypeObject *base_type) ATTR_WARN_UNUSED_RESULT; +PyObject *Matrix_CreatePyObject_wrap(float *mat, + const unsigned short num_col, + const unsigned short num_row, + PyTypeObject *base_type) ATTR_WARN_UNUSED_RESULT + ATTR_NONNULL(1); +PyObject *Matrix_CreatePyObject_cb(PyObject *user, + const unsigned short num_col, + const unsigned short num_row, + unsigned char cb_type, + unsigned char cb_subtype) ATTR_WARN_UNUSED_RESULT; /* PyArg_ParseTuple's "O&" formatting helpers. */ int Matrix_ParseAny(PyObject *o, void *p); |