diff options
author | Jacques Lucke <jacques@blender.org> | 2020-08-07 19:24:59 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-08-07 19:42:21 +0300 |
commit | c50e5fcc344d00b03eb4a3141b5b45944c3570fd (patch) | |
tree | f683ae1a1f38551d160a5be2ee86561d51faca26 /source/blender/blenlib/BLI_float4x4.hh | |
parent | 28b10224346a9a2e55267f98357991a841eeda5b (diff) |
Cleanup: use C++ style casts in various places
Diffstat (limited to 'source/blender/blenlib/BLI_float4x4.hh')
-rw-r--r-- | source/blender/blenlib/BLI_float4x4.hh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_float4x4.hh b/source/blender/blenlib/BLI_float4x4.hh index 85d38149bb9..0433197b22a 100644 --- a/source/blender/blenlib/BLI_float4x4.hh +++ b/source/blender/blenlib/BLI_float4x4.hh @@ -31,18 +31,18 @@ struct float4x4 { memcpy(values, matrix, sizeof(float) * 16); } - float4x4(const float matrix[4][4]) : float4x4((float *)matrix) + float4x4(const float matrix[4][4]) : float4x4(static_cast<const float *>(matrix[0])) { } operator float *() { - return (float *)this; + return &values[0][0]; } operator const float *() const { - return (const float *)this; + return &values[0][0]; } friend float4x4 operator*(const float4x4 &a, const float4x4 &b) @@ -124,8 +124,8 @@ struct float4x4 { { uint64_t h = 435109; for (int i = 0; i < 16; i++) { - float value = ((const float *)this)[i]; - h = h * 33 + (*(uint32_t *)&value); + float value = (static_cast<const float *>(values[0]))[i]; + h = h * 33 + *reinterpret_cast<const uint32_t *>(&value); } return h; } |