diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 11:33:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 13:17:08 +0300 |
commit | f68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch) | |
tree | 2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/python/gpu | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/python/gpu')
-rw-r--r-- | source/blender/python/gpu/gpu_py_shader_create_info.cc | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/source/blender/python/gpu/gpu_py_shader_create_info.cc b/source/blender/python/gpu/gpu_py_shader_create_info.cc index f191e6cc71c..7bd0bf4aedf 100644 --- a/source/blender/python/gpu/gpu_py_shader_create_info.cc +++ b/source/blender/python/gpu/gpu_py_shader_create_info.cc @@ -59,21 +59,21 @@ static const struct PyC_FlagSet pygpu_qualifiers[] = { " - ``IVEC4``\n" \ " - ``BOOL``\n" const struct PyC_StringEnumItems pygpu_attrtype_items[] = { - {(int)Type::FLOAT, "FLOAT"}, - {(int)Type::VEC2, "VEC2"}, - {(int)Type::VEC3, "VEC3"}, - {(int)Type::VEC4, "VEC4"}, - {(int)Type::MAT3, "MAT3"}, - {(int)Type::MAT4, "MAT4"}, - {(int)Type::UINT, "UINT"}, - {(int)Type::UVEC2, "UVEC2"}, - {(int)Type::UVEC3, "UVEC3"}, - {(int)Type::UVEC4, "UVEC4"}, - {(int)Type::INT, "INT"}, - {(int)Type::IVEC2, "IVEC2"}, - {(int)Type::IVEC3, "IVEC3"}, - {(int)Type::IVEC4, "IVEC4"}, - {(int)Type::BOOL, "BOOL"}, + {int(Type::FLOAT), "FLOAT"}, + {int(Type::VEC2), "VEC2"}, + {int(Type::VEC3), "VEC3"}, + {int(Type::VEC4), "VEC4"}, + {int(Type::MAT3), "MAT3"}, + {int(Type::MAT4), "MAT4"}, + {int(Type::UINT), "UINT"}, + {int(Type::UVEC2), "UVEC2"}, + {int(Type::UVEC3), "UVEC3"}, + {int(Type::UVEC4), "UVEC4"}, + {int(Type::INT), "INT"}, + {int(Type::IVEC2), "IVEC2"}, + {int(Type::IVEC3), "IVEC3"}, + {int(Type::IVEC4), "IVEC4"}, + {int(Type::BOOL), "BOOL"}, {0, nullptr}, }; @@ -111,45 +111,45 @@ const struct PyC_StringEnumItems pygpu_attrtype_items[] = { " - ``DEPTH_CUBE``\n" \ " - ``DEPTH_CUBE_ARRAY``\n" static const struct PyC_StringEnumItems pygpu_imagetype_items[] = { - {(int)ImageType::FLOAT_BUFFER, "FLOAT_BUFFER"}, - {(int)ImageType::FLOAT_1D, "FLOAT_1D"}, - {(int)ImageType::FLOAT_1D_ARRAY, "FLOAT_1D_ARRAY"}, - {(int)ImageType::FLOAT_2D, "FLOAT_2D"}, - {(int)ImageType::FLOAT_2D_ARRAY, "FLOAT"}, - {(int)ImageType::FLOAT_3D, "FLOAT_2D_ARRAY"}, - {(int)ImageType::FLOAT_CUBE, "FLOAT_CUBE"}, - {(int)ImageType::FLOAT_CUBE_ARRAY, "FLOAT_CUBE_ARRAY"}, - {(int)ImageType::INT_BUFFER, "INT_BUFFER"}, - {(int)ImageType::INT_1D, "INT_1D"}, - {(int)ImageType::INT_1D_ARRAY, "INT_1D_ARRAY"}, - {(int)ImageType::INT_2D, "INT_2D"}, - {(int)ImageType::INT_2D_ARRAY, "INT_2D_ARRAY"}, - {(int)ImageType::INT_3D, "INT_3D"}, - {(int)ImageType::INT_CUBE, "INT_CUBE"}, - {(int)ImageType::INT_CUBE_ARRAY, "INT_CUBE_ARRAY"}, - {(int)ImageType::UINT_BUFFER, "UINT_BUFFER"}, - {(int)ImageType::UINT_1D, "UINT_1D"}, - {(int)ImageType::UINT_1D_ARRAY, "UINT_1D_ARRAY"}, - {(int)ImageType::UINT_2D, "UINT_2D"}, - {(int)ImageType::UINT_2D_ARRAY, "UINT_2D_ARRAY"}, - {(int)ImageType::UINT_3D, "UINT_3D"}, - {(int)ImageType::UINT_CUBE, "UINT_CUBE"}, - {(int)ImageType::UINT_CUBE_ARRAY, "UINT_CUBE_ARRAY"}, - {(int)ImageType::SHADOW_2D, "SHADOW_2D"}, - {(int)ImageType::SHADOW_2D_ARRAY, "SHADOW_2D_ARRAY"}, - {(int)ImageType::SHADOW_CUBE, "SHADOW_CUBE"}, - {(int)ImageType::SHADOW_CUBE_ARRAY, "SHADOW_CUBE_ARRAY"}, - {(int)ImageType::DEPTH_2D, "DEPTH_2D"}, - {(int)ImageType::DEPTH_2D_ARRAY, "DEPTH_2D_ARRAY"}, - {(int)ImageType::DEPTH_CUBE, "DEPTH_CUBE"}, - {(int)ImageType::DEPTH_CUBE_ARRAY, "DEPTH_CUBE_ARRAY"}, + {int(ImageType::FLOAT_BUFFER), "FLOAT_BUFFER"}, + {int(ImageType::FLOAT_1D), "FLOAT_1D"}, + {int(ImageType::FLOAT_1D_ARRAY), "FLOAT_1D_ARRAY"}, + {int(ImageType::FLOAT_2D), "FLOAT_2D"}, + {int(ImageType::FLOAT_2D_ARRAY), "FLOAT"}, + {int(ImageType::FLOAT_3D), "FLOAT_2D_ARRAY"}, + {int(ImageType::FLOAT_CUBE), "FLOAT_CUBE"}, + {int(ImageType::FLOAT_CUBE_ARRAY), "FLOAT_CUBE_ARRAY"}, + {int(ImageType::INT_BUFFER), "INT_BUFFER"}, + {int(ImageType::INT_1D), "INT_1D"}, + {int(ImageType::INT_1D_ARRAY), "INT_1D_ARRAY"}, + {int(ImageType::INT_2D), "INT_2D"}, + {int(ImageType::INT_2D_ARRAY), "INT_2D_ARRAY"}, + {int(ImageType::INT_3D), "INT_3D"}, + {int(ImageType::INT_CUBE), "INT_CUBE"}, + {int(ImageType::INT_CUBE_ARRAY), "INT_CUBE_ARRAY"}, + {int(ImageType::UINT_BUFFER), "UINT_BUFFER"}, + {int(ImageType::UINT_1D), "UINT_1D"}, + {int(ImageType::UINT_1D_ARRAY), "UINT_1D_ARRAY"}, + {int(ImageType::UINT_2D), "UINT_2D"}, + {int(ImageType::UINT_2D_ARRAY), "UINT_2D_ARRAY"}, + {int(ImageType::UINT_3D), "UINT_3D"}, + {int(ImageType::UINT_CUBE), "UINT_CUBE"}, + {int(ImageType::UINT_CUBE_ARRAY), "UINT_CUBE_ARRAY"}, + {int(ImageType::SHADOW_2D), "SHADOW_2D"}, + {int(ImageType::SHADOW_2D_ARRAY), "SHADOW_2D_ARRAY"}, + {int(ImageType::SHADOW_CUBE), "SHADOW_CUBE"}, + {int(ImageType::SHADOW_CUBE_ARRAY), "SHADOW_CUBE_ARRAY"}, + {int(ImageType::DEPTH_2D), "DEPTH_2D"}, + {int(ImageType::DEPTH_2D_ARRAY), "DEPTH_2D_ARRAY"}, + {int(ImageType::DEPTH_CUBE), "DEPTH_CUBE"}, + {int(ImageType::DEPTH_CUBE_ARRAY), "DEPTH_CUBE_ARRAY"}, {0, nullptr}, }; static const struct PyC_StringEnumItems pygpu_dualblend_items[] = { - {(int)DualBlend::NONE, "NONE"}, - {(int)DualBlend::SRC_0, "SRC_0"}, - {(int)DualBlend::SRC_1, "SRC_1"}, + {int(DualBlend::NONE), "NONE"}, + {int(DualBlend::SRC_0), "SRC_0"}, + {int(DualBlend::SRC_1), "SRC_1"}, {0, nullptr}, }; @@ -479,7 +479,7 @@ static PyObject *pygpu_shader_info_fragment_out(BPyGPUShaderCreateInfo *self, int slot; struct PyC_StringEnum pygpu_type = {pygpu_attrtype_items}; const char *name; - struct PyC_StringEnum blend_type = {pygpu_dualblend_items, (int)DualBlend::NONE}; + struct PyC_StringEnum blend_type = {pygpu_dualblend_items, int(DualBlend::NONE)}; static const char *_keywords[] = {"slot", "type", "name", "blend", nullptr}; static _PyArg_Parser _parser = { |