Refactor: Core, give the IDWALK_… enum an explicit name

Give the `IDWALK_…` enum an explicit name: `LibraryForeachIDFlag`. This way
the flags are type-safe, and it's known where values come from. This is
much preferred (at least by me) to just having `int flags`.

Uses of `0` have been replaced with `IDWALK_NOP` as that has the same value
and is of the right type.

One invalid use of `IDWALK_CB_NOP` was detected by this change, and is
replaced by `IDWALK_NOP`.

This change might be incomplete; I gave the enum a name, and then fixed
the compiler errors.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131865
This commit is contained in:
Sybren A. Stüvel
2024-12-12 12:43:14 +01:00
parent 203ad8ad4b
commit 8dd1eb4e8f
8 changed files with 36 additions and 32 deletions

View File

@@ -247,7 +247,7 @@ static PyObject *bpy_user_map(PyObject * /*self*/, PyObject *args, PyObject *kwd
data_cb.id_curr = id;
BKE_library_foreach_ID_link(
nullptr, id, foreach_libblock_id_user_map_callback, &data_cb, IDWALK_CB_NOP);
nullptr, id, foreach_libblock_id_user_map_callback, &data_cb, IDWALK_NOP);
if (data_cb.py_id_curr) {
Py_DECREF(data_cb.py_id_curr);