From 776dbe942cd016ef642137ae1160435c928e4fbe Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 22 Jun 2025 11:34:32 +0000 Subject: [PATCH] Cleanup: spelling (make check_spelling_*) --- intern/cycles/kernel/closure/bsdf.h | 8 ++++---- source/blender/blenkernel/BKE_lib_id.hh | 6 ++++-- .../intern/builder/deg_builder_relations_drivers.cc | 2 +- source/blender/draw/intern/draw_handle.hh | 3 +-- source/blender/editors/space_view3d/view3d_draw.cc | 6 +++--- source/blender/editors/transform/transform_convert.cc | 4 ++-- source/blender/makesdna/DNA_sequence_types.h | 5 ++++- source/blender/makesrna/intern/rna_object_api.cc | 4 ++-- tools/check_source/check_spelling_config.py | 1 + 9 files changed, 22 insertions(+), 17 deletions(-) diff --git a/intern/cycles/kernel/closure/bsdf.h b/intern/cycles/kernel/closure/bsdf.h index ea88fc8b1c9..fde489b4ff8 100644 --- a/intern/cycles/kernel/closure/bsdf.h +++ b/intern/cycles/kernel/closure/bsdf.h @@ -83,11 +83,11 @@ ccl_device_inline float bump_shadowing_term(const ccl_private ShaderData *sd, * However, when using bump/normal mapping, this can lead to light leaking not just * "around" the shadow terminator, but to the rear side of supposedly opaque geometry. * In order to detect this case, we can ensure that the direction is also valid w.r.t. - * the smoothed (but non-bump-mapped) normal sd->N (or Ns for short below). + * the smoothed (but non-bump-mapped) normal `sd->N` (or `Ns` for short below). * - * dot(Ns, I) * dot(Ns, N) tells us if I and N are on the same side of the smoothed geometry. - * If incoming(I) and normal(N) are on the same side we reject refractions, dot(N, I) < 0. - * If they are on different sides we reject reflections, dot(N, I) > 0. */ + * `dot(Ns, I) * dot(Ns, N)` tells us if I and N are on the same side of the smoothed geometry. + * If incoming(I) and normal(N) are on the same side we reject refractions, `dot(N, I) < 0`. + * If they are on different sides we reject reflections, `dot(N, I) > 0`. */ const float cosNsI = dot(sd->N, I); const float cosNsN = dot(sd->N, sc->N); const float cosNI = dot(sc->N, I); diff --git a/source/blender/blenkernel/BKE_lib_id.hh b/source/blender/blenkernel/BKE_lib_id.hh index 0fe6e22cec8..194f0413407 100644 --- a/source/blender/blenkernel/BKE_lib_id.hh +++ b/source/blender/blenkernel/BKE_lib_id.hh @@ -788,8 +788,10 @@ void BKE_main_lib_objects_recalc_all(Main *bmain); */ void BKE_main_id_repair_duplicate_names_listbase(Main *bmain, ListBase *lb); -#define MAX_ID_FULL_NAME (256 + 256 + 3 + 1) /* 256 is MAX_ID_NAME - 2 */ -#define MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) /* Adds 'keycode' two letters at beginning. */ +/** 256 is MAX_ID_NAME - 2 */ +#define MAX_ID_FULL_NAME (256 + 256 + 3 + 1) +/** Adds 'key-code' two letters at beginning. */ +#define MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) /** * Generate full name of the data-block (without ID code, but with library if any). * diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc index 95f6e3da410..88f2497bc6c 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc @@ -257,7 +257,7 @@ bool data_path_maybe_shared(const ID &id, const StringRef data_path) return !is_thread_safe; } - /* Allow concurrent writes to shapekey values. #140706 shows that this + /* Allow concurrent writes to shape-key values. #140706 shows that this * shouldn't be a problem in practice. */ if (GS(id.name) == ID_KE) { const bool is_thread_safe = data_path.startswith("key_blocks[") && diff --git a/source/blender/draw/intern/draw_handle.hh b/source/blender/draw/intern/draw_handle.hh index 4ee89f25863..11e5ba6eec9 100644 --- a/source/blender/draw/intern/draw_handle.hh +++ b/source/blender/draw/intern/draw_handle.hh @@ -156,8 +156,7 @@ class ObjectRef { int recalc_flags(uint64_t last_update) const { - /* TODO: There should also be a way to get the the min last_update for all objects in the - * range. */ + /* TODO: There should also be a way to get the min last_update for all objects in the range. */ auto get_flags = [&](const ObjectRuntimeHandle &runtime) { int flags = 0; SET_FLAG_FROM_TEST(flags, runtime.last_update_transform > last_update, ID_RECALC_TRANSFORM); diff --git a/source/blender/editors/space_view3d/view3d_draw.cc b/source/blender/editors/space_view3d/view3d_draw.cc index 8b70d7571e6..ac56cbda470 100644 --- a/source/blender/editors/space_view3d/view3d_draw.cc +++ b/source/blender/editors/space_view3d/view3d_draw.cc @@ -1369,7 +1369,7 @@ static void draw_selected_name( * - 1 collection name `(MAX_ID_NAME - 2 + 3)`. * - 1 object name `(MAX_ID_NAME - 2)`. * - 1 object data name `(MAX_ID_NAME - 2)`. - * - 2 non-ID data names (bones, shapekeys...) `(MAX_NAME * 2)`. + * - 2 non-ID data names (bones, shape-keys...) `(MAX_NAME * 2)`. * - 2 BREAD_CRUMB_SEPARATOR(s) `(6)`. * - 1 SHAPE_KEY_PINNED marker and a trailing '\0' `(9+1)` - translated, so give some room! * - 1 marker name `(MAX_NAME + 3)`. @@ -1481,8 +1481,8 @@ static void draw_selected_name( BLI_assert(i < int(ARRAY_SIZE(info_array))); char info[MAX_ID_NAME * 4]; - /* It's expected there will be enough room for the whole string in the the buffer. If not, - * increase it. */ + /* It's expected there will be enough room for the whole string in the buffer. + * If not, increase it. */ BLI_assert(BLI_string_len_array(info_array, i) < sizeof(info)); BLI_string_join_array(info, sizeof(info), info_array, i); diff --git a/source/blender/editors/transform/transform_convert.cc b/source/blender/editors/transform/transform_convert.cc index 603e4ab41f1..8e3a4acd8ce 100644 --- a/source/blender/editors/transform/transform_convert.cc +++ b/source/blender/editors/transform/transform_convert.cc @@ -129,8 +129,8 @@ static void sort_trans_data_dist_container(const TransInfo *t, TransDataContaine return tc->data[a].rdist < tc->data[b].rdist; }; - /* The "sort by distance" is often preceeded by "calculate distance", which is - * often preceeded by "sort selected first". */ + /* The "sort by distance" is often preceded by "calculate distance", which is + * often preceded by "sort selected first". */ MEM_SAFE_FREE(tc->sorted_index_map); make_sorted_index_map(tc, compare); diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 8eb942d5786..129e2d91d35 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -447,7 +447,10 @@ typedef struct GaussianBlurVars { typedef struct TextVars { char *text_ptr; - /* Text length in bytes, not including terminating zero (i.e. strlen of text). */ + /** + * Text length in bytes, not including terminating zero + * (The `strlen` of text). + */ int text_len_bytes; char _pad2[4]; diff --git a/source/blender/makesrna/intern/rna_object_api.cc b/source/blender/makesrna/intern/rna_object_api.cc index 6944ad446d0..3347c18e73e 100644 --- a/source/blender/makesrna/intern/rna_object_api.cc +++ b/source/blender/makesrna/intern/rna_object_api.cc @@ -1095,14 +1095,14 @@ void RNA_api_object(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new key-block"); /* optional */ RNA_def_boolean(func, "from_mix", true, "", "Create new shape from existing mix of shapes"); - parm = RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock"); + parm = RNA_def_pointer(func, "key", "ShapeKey", "", "New shape key-block"); RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_RNAPTR); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "shape_key_remove", "rna_Object_shape_key_remove"); RNA_def_function_ui_description(func, "Remove a Shape Key from this object"); RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS); - parm = RNA_def_pointer(func, "key", "ShapeKey", "", "Keyblock to be removed"); + parm = RNA_def_pointer(func, "key", "ShapeKey", "", "Key-block to be removed"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0)); diff --git a/tools/check_source/check_spelling_config.py b/tools/check_source/check_spelling_config.py index 3da9fdd38ed..5ea025f1d65 100644 --- a/tools/check_source/check_spelling_config.py +++ b/tools/check_source/check_spelling_config.py @@ -341,6 +341,7 @@ dict_custom = { "redistributions", "registerable", "reimplement", + "reimplementation", "reimplemented", "reimplementing", "reimport",