From be9104f7aa0a44b344bd951cc1ad86d7ad8135b1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 18 Feb 2023 14:27:02 +1100 Subject: [PATCH] Cleanup: spelling, capitalize tags, use C-style comments & clarification --- intern/cycles/kernel/integrator/state_template.h | 2 +- intern/cycles/scene/light.cpp | 2 +- source/blender/blenkernel/intern/nla_test.cc | 14 +++++++------- source/blender/blenkernel/intern/screen.c | 2 +- .../shaders/overlay_edit_mesh_vert_no_geom.glsl | 4 ++-- .../blender/editors/mesh/editmesh_mask_extract.cc | 2 +- .../geometry/intern/mesh_merge_by_distance.cc | 2 +- .../intern/lineart/lineart_cpu.cc | 2 +- .../blender/gpu/intern/gpu_shader_create_info.cc | 2 +- source/blender/gpu/metal/mtl_immediate.mm | 2 +- source/blender/python/mathutils/mathutils_kdtree.c | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/intern/cycles/kernel/integrator/state_template.h b/intern/cycles/kernel/integrator/state_template.h index 0fc7ed655d3..e60f2fa4c31 100644 --- a/intern/cycles/kernel/integrator/state_template.h +++ b/intern/cycles/kernel/integrator/state_template.h @@ -122,7 +122,7 @@ KERNEL_STRUCT_MEMBER(guiding, bool, use_surface_guiding, KERNEL_FEATURE_PATH_GUI KERNEL_STRUCT_MEMBER(guiding, float, sample_surface_guiding_rand, KERNEL_FEATURE_PATH_GUIDING) /* The probability to use surface guiding (i.e., diffuse sampling prob * guiding prob)*/ KERNEL_STRUCT_MEMBER(guiding, float, surface_guiding_sampling_prob, KERNEL_FEATURE_PATH_GUIDING) -/* Probability of sampling a BSSRDF closure instead of a BSDF closure*/ +/* Probability of sampling a BSSRDF closure instead of a BSDF closure. */ KERNEL_STRUCT_MEMBER(guiding, float, bssrdf_sampling_prob, KERNEL_FEATURE_PATH_GUIDING) /* If volume guiding is enabled */ KERNEL_STRUCT_MEMBER(guiding, bool, use_volume_guiding, KERNEL_FEATURE_PATH_GUIDING) diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp index 3c5698b4218..2b9e356e0de 100644 --- a/intern/cycles/scene/light.cpp +++ b/intern/cycles/scene/light.cpp @@ -1177,7 +1177,7 @@ void LightManager::device_update(Device *device, void LightManager::device_free(Device *, DeviceScene *dscene, const bool free_background) { - /* to-do: check if the light tree member variables need to be wrapped in a conditional too*/ + /* TODO: check if the light tree member variables need to be wrapped in a conditional too. */ dscene->light_tree_nodes.free(); dscene->light_tree_emitters.free(); dscene->light_to_tree.free(); diff --git a/source/blender/blenkernel/intern/nla_test.cc b/source/blender/blenkernel/intern/nla_test.cc index 401d846eb11..0520a3b270e 100644 --- a/source/blender/blenkernel/intern/nla_test.cc +++ b/source/blender/blenkernel/intern/nla_test.cc @@ -77,17 +77,17 @@ TEST(nla_track, BKE_nlatrack_remove_strip) strip2.start = 11; strip2.end = 20; - // Add NLA strips to the NLATrack. + /* Add NLA strips to the NLATrack. */ BKE_nlastrips_add_strip(&strips, &strip1); BKE_nlastrips_add_strip(&strips, &strip2); track.strips = strips; - // ensure we have 2 strips in the track. + /* Ensure we have 2 strips in the track. */ EXPECT_EQ(2, BLI_listbase_count(&track.strips)); BKE_nlatrack_remove_strip(&track, &strip2); EXPECT_EQ(1, BLI_listbase_count(&track.strips)); - // ensure the correct strip was removed. + /* Ensure the correct strip was removed. */ EXPECT_EQ(-1, BLI_findindex(&track.strips, &strip2)); } @@ -97,20 +97,20 @@ TEST(nla_track, BKE_nlatrack_remove_and_free) NlaTrack *track1; NlaTrack *track2; - // Add NLA tracks to the Animation Data. + /* Add NLA tracks to the Animation Data. */ track1 = BKE_nlatrack_add(&adt, NULL, false); track2 = BKE_nlatrack_add(&adt, track1, false); - // ensure we have 2 tracks in the track. + /* Ensure we have 2 tracks in the track. */ EXPECT_EQ(2, BLI_listbase_count(&adt.nla_tracks)); BKE_nlatrack_remove_and_free(&adt.nla_tracks, track2, false); EXPECT_EQ(1, BLI_listbase_count(&adt.nla_tracks)); - // ensure the correct track was removed. + /* Ensure the correct track was removed. */ EXPECT_EQ(-1, BLI_findindex(&adt.nla_tracks, track2)); - // free the rest of the tracks, and ensure they are removed. + /* Free the rest of the tracks, and ensure they are removed. */ BKE_nlatrack_remove_and_free(&adt.nla_tracks, track1, false); EXPECT_EQ(0, BLI_listbase_count(&adt.nla_tracks)); EXPECT_EQ(-1, BLI_findindex(&adt.nla_tracks, track1)); diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index fabcd6278b4..0f3eccb5bd0 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -956,7 +956,7 @@ ScrArea *BKE_screen_area_map_find_area_xy(const ScrAreaMap *areamap, const int xy[2]) { LISTBASE_FOREACH (ScrArea *, area, &areamap->areabase) { - /* Test area's outer screen verts, not inner totrct. */ + /* Test area's outer screen verts, not inner `area->totrct`. */ if (xy[0] >= area->v1->vec.x && xy[0] <= area->v4->vec.x && xy[1] >= area->v1->vec.y && xy[1] <= area->v2->vec.y) { if (ELEM(spacetype, SPACE_TYPE_ANY, area->spacetype)) { diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl index 504b6ea2f44..33217603b95 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_vert_no_geom.glsl @@ -59,9 +59,9 @@ void main() * IF PrimType == LineList: base_vertex_id = quad_id*2 * IF PrimType == LineStrip: base_vertex_id = quad_id * - * Note: This is currently used as LineList. + * NOTE: This is currently used as LineList. * - * Note: Primitive Restart Will not work with this setup as-is. We should avoid using + * NOTE: Primitive Restart Will not work with this setup as-is. We should avoid using * input primitive types which use restart indices. */ int base_vertex_id = quad_id * 2; diff --git a/source/blender/editors/mesh/editmesh_mask_extract.cc b/source/blender/editors/mesh/editmesh_mask_extract.cc index 83580b32884..8dc08f233e9 100644 --- a/source/blender/editors/mesh/editmesh_mask_extract.cc +++ b/source/blender/editors/mesh/editmesh_mask_extract.cc @@ -285,7 +285,7 @@ static int paint_mask_extract_exec(bContext *C, wmOperator *op) params.add_solidify = RNA_boolean_get(op->ptr, "add_solidify"); /* Push an undo step prior to extraction. - * Note: A second push happens after the operator due to + * NOTE: A second push happens after the operator due to * the OPTYPE_UNDO flag; having an initial undo step here * is just needed to preserve the active object pointer. * diff --git a/source/blender/geometry/intern/mesh_merge_by_distance.cc b/source/blender/geometry/intern/mesh_merge_by_distance.cc index fbd06791bd8..445fc79f320 100644 --- a/source/blender/geometry/intern/mesh_merge_by_distance.cc +++ b/source/blender/geometry/intern/mesh_merge_by_distance.cc @@ -1499,7 +1499,7 @@ static Mesh *create_merged_mesh(const Mesh &mesh, const int totedge = mesh.totedge; /* Reuse the same buffer as #vert_dest_map. - * Note: the caller must be made aware of it changes. */ + * NOTE: the caller must be made aware of it changes. */ MutableSpan vert_group_map = vert_dest_map; WeldMesh weld_mesh; diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc index 1624544a5ce..4cd2ae880ef 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc @@ -1895,7 +1895,7 @@ static void lineart_sort_adjacent_items(LineartAdjacentEdge *ai, int length) ai, ai + length, [](const LineartAdjacentEdge &p1, const LineartAdjacentEdge &p2) { int a = p1.v1 - p2.v1; int b = p1.v2 - p2.v2; - /* parallel_sort() requires cmp() to return true when the first element needs to appear + /* `parallel_sort()` requires `cmp()` to return true when the first element needs to appear * before the second element in the sorted array, false otherwise (strict weak ordering), * see https://en.cppreference.com/w/cpp/named_req/Compare. */ if (a < 0) { diff --git a/source/blender/gpu/intern/gpu_shader_create_info.cc b/source/blender/gpu/intern/gpu_shader_create_info.cc index 0e3057ee8c1..c99716fbc4d 100644 --- a/source/blender/gpu/intern/gpu_shader_create_info.cc +++ b/source/blender/gpu/intern/gpu_shader_create_info.cc @@ -346,7 +346,7 @@ void gpu_shader_create_info_init() overlay_motion_path_line_clipped = overlay_motion_path_line_clipped_no_geom; /* Workbench shadows. - * Note: Updates additional-info used by workbench shadow permutations. + * NOTE: Updates additional-info used by workbench shadow permutations. * Must be prepared prior to permutation preparation. */ workbench_shadow_manifold = workbench_shadow_manifold_no_geom; workbench_shadow_no_manifold = workbench_shadow_no_manifold_no_geom; diff --git a/source/blender/gpu/metal/mtl_immediate.mm b/source/blender/gpu/metal/mtl_immediate.mm index 985b962cc99..25a12aac523 100644 --- a/source/blender/gpu/metal/mtl_immediate.mm +++ b/source/blender/gpu/metal/mtl_immediate.mm @@ -339,7 +339,7 @@ void MTLImmediate::end() } break; case GPU_PRIM_LINE_LOOP: { /* Patch final vertex of line loop to close. Rendered using LineStrip. - * Note: vertex_len represents original length, however, allocated Metal + * NOTE: vertex_len represents original length, however, allocated Metal * buffer contains space for one extra vertex when LineLoop is used. */ uchar *buffer_data = reinterpret_cast(current_allocation_.data); memcpy(buffer_data + (vertex_len)*vertex_format.stride, diff --git a/source/blender/python/mathutils/mathutils_kdtree.c b/source/blender/python/mathutils/mathutils_kdtree.c index ace8ccdeb2a..190a3768286 100644 --- a/source/blender/python/mathutils/mathutils_kdtree.c +++ b/source/blender/python/mathutils/mathutils_kdtree.c @@ -394,7 +394,7 @@ PyTypeObject PyKDTree_Type = { /*tp_setattro*/ NULL, /*tp_as_buffer*/ NULL, /*tp_flags*/ Py_TPFLAGS_DEFAULT, - /*Documentation string*/ py_KDtree_doc, + /*tp_doc*/ py_KDtree_doc, /*tp_traverse*/ NULL, /*tp_clear*/ NULL, /*tp_richcompare*/ NULL,