diff --git a/source/blender/blenlib/tests/BLI_string_test.cc b/source/blender/blenlib/tests/BLI_string_test.cc index 0884b5b2ec8..1c3859e3556 100644 --- a/source/blender/blenlib/tests/BLI_string_test.cc +++ b/source/blender/blenlib/tests/BLI_string_test.cc @@ -373,7 +373,7 @@ TEST(string, StrFormatUint64Grouped) BLI_str_format_uint64_grouped(number_str, number = 1000); EXPECT_STREQ("1,000", number_str); - BLI_str_format_uint64_grouped(number_str, number = 18446744073709551615); + BLI_str_format_uint64_grouped(number_str, number = 18446744073709551615u); EXPECT_STREQ("18,446,744,073,709,551,615", number_str); } diff --git a/source/blender/editors/object/object_edit.cc b/source/blender/editors/object/object_edit.cc index acb25e6d73c..95e0148a530 100644 --- a/source/blender/editors/object/object_edit.cc +++ b/source/blender/editors/object/object_edit.cc @@ -146,7 +146,7 @@ Object **ED_object_array_in_mode_or_selected(bContext *C, ID *id_pin = nullptr; const bool use_objects_in_mode = (ob_active != nullptr) && (ob_active->mode & (OB_MODE_EDIT | OB_MODE_POSE)); - const char space_type = area ? area->spacetype : SPACE_EMPTY; + const eSpace_Type space_type = area ? eSpace_Type(area->spacetype) : SPACE_EMPTY; Object **objects; Object *ob = nullptr; diff --git a/source/blender/python/mathutils/mathutils_bvhtree.cc b/source/blender/python/mathutils/mathutils_bvhtree.cc index 5c6d2e7ea2a..d6b96c6a860 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.cc +++ b/source/blender/python/mathutils/mathutils_bvhtree.cc @@ -1205,36 +1205,48 @@ static PyObject *C_BVHTree_FromObject(PyObject * /*cls*/, PyObject *args, PyObje /** \name Module & Type definition * \{ */ +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-function-type" +#endif + static PyMethodDef py_bvhtree_methods[] = { - {"ray_cast", (PyCFunction)py_bvhtree_ray_cast, METH_VARARGS, py_bvhtree_ray_cast_doc}, + {"ray_cast", + reinterpret_cast(py_bvhtree_ray_cast), + METH_VARARGS, + py_bvhtree_ray_cast_doc}, {"find_nearest", - (PyCFunction)py_bvhtree_find_nearest, + reinterpret_cast(py_bvhtree_find_nearest), METH_VARARGS, py_bvhtree_find_nearest_doc}, {"find_nearest_range", - (PyCFunction)py_bvhtree_find_nearest_range, + reinterpret_cast(py_bvhtree_find_nearest_range), METH_VARARGS, py_bvhtree_find_nearest_range_doc}, - {"overlap", (PyCFunction)py_bvhtree_overlap, METH_O, py_bvhtree_overlap_doc}, + {"overlap", reinterpret_cast(py_bvhtree_overlap), METH_O, py_bvhtree_overlap_doc}, /* class methods */ {"FromPolygons", - (PyCFunction)C_BVHTree_FromPolygons, + reinterpret_cast(C_BVHTree_FromPolygons), METH_VARARGS | METH_KEYWORDS | METH_CLASS, C_BVHTree_FromPolygons_doc}, #ifndef MATH_STANDALONE {"FromBMesh", - (PyCFunction)C_BVHTree_FromBMesh, + reinterpret_cast(C_BVHTree_FromBMesh), METH_VARARGS | METH_KEYWORDS | METH_CLASS, C_BVHTree_FromBMesh_doc}, {"FromObject", - (PyCFunction)C_BVHTree_FromObject, + reinterpret_cast(C_BVHTree_FromObject), METH_VARARGS | METH_KEYWORDS | METH_CLASS, C_BVHTree_FromObject_doc}, #endif {nullptr, nullptr, 0, nullptr}, }; +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + PyTypeObject PyBVHTree_Type = { PyVarObject_HEAD_INIT(nullptr, 0) /*tp_name*/ "BVHTree",