From 393d4a6e1482a85e9c9c7da7ed07edcd329bd1c4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 26 May 2023 12:39:28 +1000 Subject: [PATCH] Cleanup: duplicate words in comments Also use doxygen-comments in files where this is already the convention. --- build_files/utils/make_update.py | 2 +- .../cycles/kernel/integrator/surface_shader.h | 6 ++-- .../blender/blenkernel/intern/lib_override.cc | 2 +- source/blender/blenkernel/intern/pbvh.cc | 2 +- source/blender/blenlib/intern/path_util.c | 4 +-- .../blender/blenlib/tests/BLI_string_test.cc | 2 +- .../draw/engines/eevee/eevee_materials.c | 2 +- .../editors/interface/interface_handlers.cc | 2 +- source/blender/imbuf/IMB_imbuf.h | 30 ++++++++++++------- source/blender/makesdna/DNA_object_types.h | 4 +-- .../blender/makesrna/intern/rna_collection.c | 2 +- 11 files changed, 33 insertions(+), 25 deletions(-) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index 0992b9ed482..6c3fcc3d54b 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -374,7 +374,7 @@ def external_script_add_origin_if_needed(args: argparse.Namespace, # - Rename remote "upstream" to "origin", which takes care of changing the names of # remotes the local branches are tracking. # - # - Change the URL to the "origin", which so was was still pointing to upstream. + # - Change the URL to the "origin", which was still pointing to upstream. # # - Re-introduce the "upstream" remote, with the same URL as it had prior to rename. diff --git a/intern/cycles/kernel/integrator/surface_shader.h b/intern/cycles/kernel/integrator/surface_shader.h index 63030c67fbe..a840a70ee61 100644 --- a/intern/cycles/kernel/integrator/surface_shader.h +++ b/intern/cycles/kernel/integrator/surface_shader.h @@ -95,9 +95,9 @@ ccl_device_inline void surface_shader_prepare_guiding(KernelGlobals kg, bssrdf_sampling_fraction /= bsdf_bssrdf_sampling_sum; } - /* Init guiding */ - /* The the roughness because the function returns alpha.x * alpha.y. In addition alpha is squared - * again */ + /* Initial guiding */ + /* The roughness because the function returns `alpha.x * alpha.y`. + * In addition alpha is squared again. */ float avg_roughness = surface_shader_average_sample_weight_squared_roughness(sd); avg_roughness = safe_sqrtf(avg_roughness); if (!fully_opaque || avg_roughness < guiding_roughness_threshold || diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc index 2fcfe7278f1..60b74ba0aab 100644 --- a/source/blender/blenkernel/intern/lib_override.cc +++ b/source/blender/blenkernel/intern/lib_override.cc @@ -2495,7 +2495,7 @@ static void lib_override_resync_tagging_finalize_recurse(Main *bmain, } else if (!is_in_partial_resync_hierarchy) { /* This ID is not tagged for resync, and is part of a loop where none of the other IDs are - * tagged for resync, nothing else to to. */ + * tagged for resync, nothing else to do. */ return; } /* This ID is not yet tagged for resync, but is part of a loop which is (partially) tagged diff --git a/source/blender/blenkernel/intern/pbvh.cc b/source/blender/blenkernel/intern/pbvh.cc index e7f8ecd1cf2..46508e5ae65 100644 --- a/source/blender/blenkernel/intern/pbvh.cc +++ b/source/blender/blenkernel/intern/pbvh.cc @@ -1418,7 +1418,7 @@ static void pbvh_faces_update_normals(PBVH *pbvh, Span nodes) }); }, [&]() { - /* Update all normals connected to affected faces faces, even if not explicitly tagged. */ + /* Update all normals connected to affected faces, even if not explicitly tagged. */ verts_to_update.reserve(polys_to_update.size()); for (const int poly : polys_to_update) { verts_to_update.add_multiple(corner_verts.slice(polys[poly])); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index de3aae7d8d1..7228a1a7d22 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -655,7 +655,7 @@ void BLI_path_normalize_unc_16(wchar_t *path_16) void BLI_path_rel(char path[FILE_MAX], const char *basepath) { BLI_string_debug_size_after_nil(path, FILE_MAX); - /* A `basepath` starting with `//` will be be made relative multiple times. */ + /* A `basepath` starting with `//` will be made relative multiple times. */ BLI_assert_msg(!BLI_path_is_rel(basepath), "The 'basepath' cannot start with '//'!"); const char *lslash; @@ -1095,7 +1095,7 @@ void BLI_path_to_display_name(char *display_name, int display_name_maxncpy, cons bool BLI_path_abs(char path[FILE_MAX], const char *basepath) { BLI_string_debug_size_after_nil(path, FILE_MAX); - /* A `basepath` starting with `//` will be be made absolute multiple times. */ + /* A `basepath` starting with `//` will be made absolute multiple times. */ BLI_assert_msg(!BLI_path_is_rel(basepath), "The 'basepath' cannot start with '//'!"); const bool wasrelative = BLI_path_is_rel(path); diff --git a/source/blender/blenlib/tests/BLI_string_test.cc b/source/blender/blenlib/tests/BLI_string_test.cc index e39e7e5a406..029ae9cdaf0 100644 --- a/source/blender/blenlib/tests/BLI_string_test.cc +++ b/source/blender/blenlib/tests/BLI_string_test.cc @@ -90,7 +90,7 @@ TEST(string, StrCopyUTF8_TruncateEncoding) TEST(string, StrCopyUTF8_TerminateEncodingEarly) { /* A UTF8 sequence that has a null byte before the sequence ends. - * Ensure the the UTF8 sequence does not step over the null byte. */ + * Ensure the UTF8 sequence does not step over the null byte. */ #define STRNCPY_UTF8_TERMINATE_EARLY(byte_size, ...) \ { \ char src[] = {__VA_ARGS__, 0}; \ diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 81283a52fd8..c4d7a88aa94 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -1213,7 +1213,7 @@ void EEVEE_material_transparent_output_init(EEVEE_Data *vedata) {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(txl->transparent_accum)}); { - /* This pass Accumulate 1 sample of the transparent pass into the the transparent + /* This pass Accumulate 1 sample of the transparent pass into the transparent * accumulation buffer. */ DRW_PASS_CREATE(psl->transparent_accum_ps, DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ADD_FULL); DRWShadingGroup *grp = DRW_shgroup_create(EEVEE_shaders_renderpasses_accumulate_sh_get(), diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc index 9afb5efb0b4..a7648b61bd8 100644 --- a/source/blender/editors/interface/interface_handlers.cc +++ b/source/blender/editors/interface/interface_handlers.cc @@ -3632,7 +3632,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa } /** - * Return the jump type used for for cursor motion & back-space/delete actions. + * Return the jump type used for cursor motion & back-space/delete actions. */ static eStrCursorJumpType ui_textedit_jump_type_from_event(const wmEvent *event) { diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 20014a35391..227dcaadb4d 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -149,10 +149,12 @@ struct ImBuf *IMB_allocFromBuffer(const uint8_t *byte_buffer, unsigned int h, unsigned int channels); -/* Assign the content of the corresponding buffer using an implicitly shareable data pointer. +/** + * Assign the content of the corresponding buffer using an implicitly shareable data pointer. * - * NOTE: Does not modify the the topology (width, height, number of channels) or the mipmaps in any - * way. */ + * \note Does not modify the topology (width, height, number of channels) + * or the mipmaps in any way. + */ void IMB_assign_shared_byte_buffer(struct ImBuf *ibuf, uint8_t *buffer_data, const ImplicitSharingInfoHandle *implicit_sharing); @@ -163,24 +165,30 @@ void IMB_assign_shared_float_z_buffer(struct ImBuf *ibuf, float *buffer_data, const ImplicitSharingInfoHandle *implicit_sharing); -/* Assign the content of the corresponding buffer with the given data and ownership. +/** + * Assign the content of the corresponding buffer with the given data and ownership. * The current content of the buffer is released corresponding to its ownership configuration. * - * NOTE: Does not modify the the topology (width, height, number of channels) or the mipmaps in any - * way. */ + * \note Does not modify the topology (width, height, number of channels) + * or the mipmaps in any way. + */ void IMB_assign_byte_buffer(struct ImBuf *ibuf, uint8_t *buffer_data, ImBufOwnership ownership); void IMB_assign_float_buffer(struct ImBuf *ibuf, float *buffer_data, ImBufOwnership ownership); void IMB_assign_z_buffer(struct ImBuf *ibuf, int *buffer_data, ImBufOwnership ownership); void IMB_assign_float_z_buffer(struct ImBuf *ibuf, float *buffer_data, ImBufOwnership ownership); -/* Make corresponding buffers available for modification. - * Is achieved by ensuring that the given ImBuf is the only owner of the underlying buffer data. */ +/** + * Make corresponding buffers available for modification. + * Is achieved by ensuring that the given ImBuf is the only owner of the underlying buffer data. + */ void IMB_make_writable_byte_buffer(struct ImBuf *ibuf); void IMB_make_writable_float_buffer(struct ImBuf *ibuf); -/* Steal the buffer data pointer: the ImBuf is no longer an owner of this data. - * NOTE: If the ImBuf does not own the data the behavior is undefined. - * NOTE: Stealing encoded buffer resets the encoded size. */ +/** + * Steal the buffer data pointer: the ImBuf is no longer an owner of this data. + * \note If the ImBuf does not own the data the behavior is undefined. + * \note Stealing encoded buffer resets the encoded size. + */ uint8_t *IMB_steal_byte_buffer(struct ImBuf *ibuf); float *IMB_steal_float_buffer(struct ImBuf *ibuf); uint8_t *IMB_steal_encoded_buffer(struct ImBuf *ibuf); diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index c730ca046c4..5645bc29036 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -279,8 +279,8 @@ typedef struct LightLinkingRuntime { /* For blocker objects: the index of the light set from which this object casts shadow from. * - *If there is no shadow shadow in the scene or the blocker is not linked to any emitter this is - *assigned zero. */ + * If there is no shadow in the scene or the blocker is not linked to any emitter this is + * assigned zero. */ uint8_t blocker_shadow_set; uint8_t _pad[6]; diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c index 203dcf75e83..722f898f766 100644 --- a/source/blender/makesrna/intern/rna_collection.c +++ b/source/blender/makesrna/intern/rna_collection.c @@ -449,7 +449,7 @@ static void rna_CollectionLightLinking_update(Main *bmain, Scene *UNUSED(scene), { /* The light linking collection comes from the collection. It does not have shading component, * but is collected to objects via hierarchy component. Tagging its hierarchy for update will - * lead the the objects which use the collection to update its shading. */ + * lead the objects which use the collection to update its shading. */ DEG_id_tag_update(ptr->owner_id, ID_RECALC_HIERARCHY); /* Tag relations for update so that an updated state of light sets is calculated. */