From 08f4f1f41e52888b3eda0f63449c77f47fcbbc22 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Jul 2023 09:40:32 +1000 Subject: [PATCH] Cleanup: spelling in comments, capitalize tags --- intern/ghost/intern/GHOST_ContextCGL.mm | 5 +++-- source/blender/blenkernel/intern/customdata.cc | 7 +++---- source/blender/blenkernel/intern/key.cc | 2 +- source/blender/blenkernel/intern/screen.cc | 2 +- .../eevee/shaders/volumetric_scatter_frag.glsl | 2 +- source/blender/editors/curve/editcurve.cc | 2 +- .../gizmo_library/gizmo_types/arrow3d_gizmo.cc | 2 +- .../editors/gpencil_legacy/annotate_draw.cc | 7 +++---- .../grease_pencil/intern/grease_pencil_edit.cc | 18 +++++++++--------- .../intern/grease_pencil_layers.cc | 4 ++-- .../editors/space_outliner/outliner_select.cc | 4 ++-- source/blender/gpu/GPU_state.h | 2 +- source/blender/imbuf/intern/anim_movie.cc | 10 +++++----- .../wavefront_obj/importer/obj_import_mesh.cc | 2 +- source/blender/render/RE_engine.h | 12 ++++++++---- tools/check_source/check_spelling_c_config.py | 3 +++ 16 files changed, 45 insertions(+), 39 deletions(-) diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm index a13bf7e3f28..dba4d46ca8b 100644 --- a/intern/ghost/intern/GHOST_ContextCGL.mm +++ b/intern/ghost/intern/GHOST_ContextCGL.mm @@ -206,8 +206,9 @@ void GHOST_ContextCGL::metalInit() @autoreleasepool { id device = m_metalLayer.device; - /* Create a command queue for blit/present operation. Note: All context should share a single - * command queue to ensure correct ordering of work submitted from multiple contexts. */ + /* Create a command queue for blit/present operation. + * NOTE: All context should share a single command queue + * to ensure correct ordering of work submitted from multiple contexts. */ if (s_sharedMetalCommandQueue == nil) { s_sharedMetalCommandQueue = (MTLCommandQueue *)[device newCommandQueueWithMaxCommandBufferCount:GHOST_ContextCGL::max_command_buffer_count]; diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index 7ed7988b687..6e1ddcaefc3 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -4285,11 +4285,10 @@ void CustomData_blend_write_prepare(CustomData &data, data.totlayer = layers_to_write.size(); data.maxlayer = data.totlayer; - /* Note: data->layers may be null, this happens when adding - * a legacy MPoly struct to a mesh with no other face attributes. + /* NOTE: `data->layers` may be null, this happens when adding + * a legacy #MPoly struct to a mesh with no other face attributes. * This leaves us with no unique ID for DNA to identify the old - * data with when loading the file. - */ + * data with when loading the file. */ if (!data.layers && layers_to_write.size() > 0) { /* We just need an address that's unique. */ data.layers = reinterpret_cast(&data.layers); diff --git a/source/blender/blenkernel/intern/key.cc b/source/blender/blenkernel/intern/key.cc index 047a6df942d..d23e807d198 100644 --- a/source/blender/blenkernel/intern/key.cc +++ b/source/blender/blenkernel/intern/key.cc @@ -2617,7 +2617,7 @@ bool *BKE_keyblock_get_dependent_keys(const Key *key, const int index) marked[index] = true; /* Iterative breadth-first search through the key list. This method minimizes - * the number of scans through the list and is failsafe vs reference cycles. */ + * the number of scans through the list and is fail-safe vs reference cycles. */ bool updated, found = false; int i; diff --git a/source/blender/blenkernel/intern/screen.cc b/source/blender/blenkernel/intern/screen.cc index a0f66a6be82..5aaede93d8f 100644 --- a/source/blender/blenkernel/intern/screen.cc +++ b/source/blender/blenkernel/intern/screen.cc @@ -125,7 +125,7 @@ void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area if (sbuts->pinid == nullptr) { sbuts->flag &= ~SB_PIN_CONTEXT; } - /* Note: Restoring path pointers is complicated, if not impossible, because this contains + /* NOTE: Restoring path pointers is complicated, if not impossible, because this contains * data pointers too, not just ID ones. See #40046. */ MEM_SAFE_FREE(sbuts->path); } diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl index 6b95a6e4c67..bf3de9543e1 100644 --- a/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl @@ -51,7 +51,7 @@ void main() #endif /* Temporal supersampling */ - /* Note : this uses the cell non-jittered position (texel center). */ + /* NOTE: this uses the cell non-jittered position (texel center). */ vec3 curr_ndc = volume_to_ndc(vec3(gl_FragCoord.xy, float(volumetric_geom_iface.slice) + 0.5) * volInvTexSize.xyz); vec3 wpos = get_world_space_from_depth(curr_ndc.xy, curr_ndc.z); diff --git a/source/blender/editors/curve/editcurve.cc b/source/blender/editors/curve/editcurve.cc index 11f3ee56bd6..29fea482ec6 100644 --- a/source/blender/editors/curve/editcurve.cc +++ b/source/blender/editors/curve/editcurve.cc @@ -658,7 +658,7 @@ static void calc_shapeKeys(Object *obedit, ListBase *newnurbs) LISTBASE_FOREACH (Nurb *, nu, &editnurb->nurbs) { if (nu->bezt) { - /* Three vects to store handles and one for tilt. */ + /* Three vectors to store handles and one for tilt. */ totvec += nu->pntsu * 4; } else { diff --git a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.cc index ae78c28da37..8c7fbc03300 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.cc @@ -336,7 +336,7 @@ static int gizmo_arrow_modal(bContext *C, float offset[3]; float facdir = 1.0f; - /* (src, dst) */ + /* A pair: (source, destination). */ struct { blender::float2 mval; float ray_origin[3], ray_direction[3]; diff --git a/source/blender/editors/gpencil_legacy/annotate_draw.cc b/source/blender/editors/gpencil_legacy/annotate_draw.cc index 00edab07118..b28e2a6a875 100644 --- a/source/blender/editors/gpencil_legacy/annotate_draw.cc +++ b/source/blender/editors/gpencil_legacy/annotate_draw.cc @@ -705,12 +705,11 @@ static void annotation_draw_data_layers( */ if (ED_gpencil_session_active() && (gpl->flag & GP_LAYER_ACTIVE) && (gpf->flag & GP_FRAME_PAINT)) { - /* Buffer stroke needs to be drawn with a different linestyle + /* Buffer stroke needs to be drawn with a different line-style * to help differentiate them from normal strokes. * - * It should also be noted that sbuffer contains temporary point types - * i.e. tGPspoints NOT bGPDspoints - */ + * It should also be noted that #bGPdata_Runtime::sbuffer contains temporary point types + * i.e. #tGPspoints NOT #bGPDspoints. */ annotation_draw_stroke_buffer(gpd, lthick, dflag, ink); } } diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc index 14dfb0fa520..c29fe026602 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc @@ -105,24 +105,24 @@ static void gaussian_blur_1D(const Span src, { /* 1D Gaussian-like smoothing function. * - * Note : This is the algorithm used by BKE_gpencil_stroke_smooth_point (legacy), - * but generalized and written in C++. + * NOTE: This is the algorithm used by #BKE_gpencil_stroke_smooth_point (legacy), + * but generalized and written in C++. * * This function uses a binomial kernel, which is the discrete version of gaussian blur. * The weight for a value at the relative index is: - * w = nCr(n, j + n/2) / 2^n = (n/1 * (n-1)/2 * ... * (n-j-n/2)/(j+n/2)) / 2^n + * `w = nCr(n, j + n/2) / 2^n = (n/1 * (n-1)/2 * ... * (n-j-n/2)/(j+n/2)) / 2^n`. * All weights together sum up to 1. * This is equivalent to doing multiple iterations of averaging neighbors, - * where n = iterations * 2 and -n/2 <= j <= n/2 + * where: `n = iterations * 2 and -n/2 <= j <= n/2`. * - * Now the problem is that nCr(n, j + n/2) is very hard to compute for n > 500, since even - * double precision isn't sufficient. A very good robust approximation for n > 20 is - * nCr(n, j + n/2) / 2^n = sqrt(2/(pi*n)) * exp(-2*j*j/n) + * Now the problem is that `nCr(n, j + n/2)` is very hard to compute for `n > 500`, since even + * double precision isn't sufficient. A very good robust approximation for `n > 20` is: + * `nCr(n, j + n/2) / 2^n = sqrt(2/(pi*n)) * exp(-2*j*j/n)`. * * `keep_shape` is a new option to stop the points from severely deforming. * It uses different partially negative weights. - * w = 2 * (nCr(n, j + n/2) / 2^n) - (nCr(3*n, j + n) / 2^(3*n)) - * ~ 2 * sqrt(2/(pi*n)) * exp(-2*j*j/n) - sqrt(2/(pi*3*n)) * exp(-2*j*j/(3*n)) + * `w = 2 * (nCr(n, j + n/2) / 2^n) - (nCr(3*n, j + n) / 2^(3*n))` + * ` ~ 2 * sqrt(2/(pi*n)) * exp(-2*j*j/n) - sqrt(2/(pi*3*n)) * exp(-2*j*j/(3*n))` * All weights still sum up to 1. * Note that these weights only work because the averaging is done in relative coordinates. */ diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc index d8b53d18d48..25da7edde40 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc @@ -137,13 +137,13 @@ static int grease_pencil_layer_reorder_exec(bContext *C, wmOperator *op) switch (reorder_location) { case LAYER_REORDER_ABOVE: { - /* Note: The layers are stored from bottom to top, so inserting above (visually), means + /* NOTE: The layers are stored from bottom to top, so inserting above (visually), means * inserting the link after the target. */ target_layer->parent_group().add_layer_after(active_layer, &target_layer->as_node()); break; } case LAYER_REORDER_BELOW: { - /* Note: The layers are stored from bottom to top, so inserting below (visually), means + /* NOTE: The layers are stored from bottom to top, so inserting below (visually), means * inserting the link before the target. */ target_layer->parent_group().add_layer_before(active_layer, &target_layer->as_node()); break; diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index 4bc503dc3e1..262065e05a2 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -400,7 +400,7 @@ static void tree_element_material_activate(bContext *C, { /* we search for the object parent */ Object *ob = (Object *)outliner_search_back(te, ID_OB); - /* Note : ob->matbits can be nullptr when a local object points to a library mesh. */ + /* NOTE: `ob->matbits` can be nullptr when a local object points to a library mesh. */ BKE_view_layer_synced_ensure(scene, view_layer); if (ob == nullptr || ob != BKE_view_layer_active_object_get(view_layer) || ob->matbits == nullptr) { @@ -1040,7 +1040,7 @@ static eOLDrawState tree_element_active_material_get(const Scene *scene, { /* we search for the object parent */ const Object *ob = (const Object *)outliner_search_back((TreeElement *)te, ID_OB); - /* Note : ob->matbits can be nullptr when a local object points to a library mesh. */ + /* NOTE: `ob->matbits` can be nullptr when a local object points to a library mesh. */ BKE_view_layer_synced_ensure(scene, view_layer); if (ob == nullptr || ob != BKE_view_layer_active_object_get(view_layer) || ob->matbits == nullptr) { diff --git a/source/blender/gpu/GPU_state.h b/source/blender/gpu/GPU_state.h index f269d0b3b51..8f60b2c875f 100644 --- a/source/blender/gpu/GPU_state.h +++ b/source/blender/gpu/GPU_state.h @@ -96,7 +96,7 @@ typedef enum eGPUBlend { /** Order independent transparency. * NOTE: Cannot be used as is. Needs special setup (frame-buffer, shader ...). */ GPU_BLEND_OIT, - /** Special blend to add color under and multiply dst color by src alpha. */ + /** Special blend to add color under and multiply DST color by SRC alpha. */ GPU_BLEND_BACKGROUND, /** Custom blend parameters using dual source blending : SRC0 + SRC1 * DST * NOTE: Can only be used with _ONE_ Draw Buffer and shader needs to be specialized. */ diff --git a/source/blender/imbuf/intern/anim_movie.cc b/source/blender/imbuf/intern/anim_movie.cc index d6a5d7036fe..bd14fedf0ca 100644 --- a/source/blender/imbuf/intern/anim_movie.cc +++ b/source/blender/imbuf/intern/anim_movie.cc @@ -1058,12 +1058,12 @@ static int ffmpeg_seek_by_byte(AVFormatContext *pFormatCtx) static int64_t ffmpeg_get_seek_pts(anim *anim, int64_t pts_to_search) { - /* FFmpeg seeks internally using DTS values instead of PTS. In some files DTS and PTS values are - * offset and sometimes ffmpeg fails to take this into account when seeking. + /* FFMPEG seeks internally using DTS values instead of PTS. In some files DTS and PTS values are + * offset and sometimes FFMPEG fails to take this into account when seeking. * Therefore we need to seek backwards a certain offset to make sure the frame we want is in - * front of us. It is not possible to determine the exact needed offset, this value is determined - * experimentally. Note: Too big offset can impact performance. Current 3 frame offset has no - * measurable impact. + * front of us. It is not possible to determine the exact needed offset, + * this value is determined experimentally. + * NOTE: Too big offset can impact performance. Current 3 frame offset has no measurable impact. */ int64_t seek_pts = pts_to_search - (ffmpeg_steps_per_frame_get(anim) * 3); diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc index ab5b7cdb3f7..7dcc52ea28b 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc @@ -221,7 +221,7 @@ void MeshFromGeometry::create_polys_loops(Mesh *mesh, bool use_vertex_groups) /* Setup vertex group data, if needed. */ if (!dverts.is_empty()) { const int group_index = curr_face.vertex_group_index; - /* Note: face might not belong to any group */ + /* NOTE: face might not belong to any group. */ if (group_index >= 0 || 1) { MDeformWeight *dw = BKE_defvert_ensure_index(&dverts[corner_verts[tot_loop_idx]], group_index); diff --git a/source/blender/render/RE_engine.h b/source/blender/render/RE_engine.h index ad25e297c44..dde2aa93163 100644 --- a/source/blender/render/RE_engine.h +++ b/source/blender/render/RE_engine.h @@ -245,19 +245,23 @@ bool RE_engine_use_persistent_data(struct RenderEngine *engine); struct RenderEngine *RE_engine_get(const struct Render *re); struct RenderEngine *RE_view_engine_get(const struct ViewRender *view_render); -/* Acquire render engine for drawing via its `draw()` callback. +/** + * Acquire render engine for drawing via its `draw()` callback. * * If drawing is not possible false is returned. If drawing is possible then the engine is * "acquired" so that it can not be freed by the render pipeline. * * Drawing is possible if the engine has the `draw()` callback and it is in its `render()` - * callback. */ + * callback. + */ bool RE_engine_draw_acquire(struct Render *re); void RE_engine_draw_release(struct Render *re); -/* GPU context for engine to create and update GPU resources in its own thread, +/** + * GPU context for engine to create and update GPU resources in its own thread, * without blocking the main thread. Used by Cycles' display driver to create - * display textures. */ + * display textures. + */ bool RE_engine_gpu_context_create(struct RenderEngine *engine); void RE_engine_gpu_context_destroy(struct RenderEngine *engine); diff --git a/tools/check_source/check_spelling_c_config.py b/tools/check_source/check_spelling_c_config.py index 1cf5a0717e6..54ef32949fd 100644 --- a/tools/check_source/check_spelling_c_config.py +++ b/tools/check_source/check_spelling_c_config.py @@ -33,6 +33,7 @@ dict_custom = { # Correct spelling, update the dictionary, here: # https://github.com/en-wl/wordlist "accessor", + "accumulatively", "additively", "adjoint", "adjugate", @@ -317,6 +318,8 @@ dict_custom = { "suboptimally", "subrange", "subtractive", + "subtype", + "subtypes", "superset", "symmetrizable", "symmetrize",