From 33a05725be2059bb2ce79bcbd5e5572a5e5c93f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 21 Aug 2023 10:05:45 +1000 Subject: [PATCH] Cleanup: spelling in comments --- intern/cycles/kernel/closure/bsdf_microfacet.h | 2 +- .../kernel/closure/bsdf_principled_hair_huang.h | 6 +++--- source/blender/blenkernel/BKE_node_runtime.hh | 5 +++-- source/blender/blenkernel/intern/movieclip.cc | 2 +- source/blender/blenkernel/intern/studiolight.cc | 2 +- source/blender/blenloader/intern/versioning_290.cc | 4 ++-- source/blender/blenloader/intern/versioning_400.cc | 2 +- source/blender/draw/intern/draw_shader_shared.h | 2 +- source/blender/editors/curve/editcurve.cc | 12 +++++------- .../blender/editors/include/ED_keyframes_keylist.hh | 6 ++++-- source/blender/editors/render/render_preview.cc | 2 +- source/blender/editors/screen/screen_ops.cc | 4 ++-- source/blender/editors/space_node/drawnode.cc | 4 ++-- source/blender/editors/space_node/node_edit.cc | 2 +- source/blender/geometry/intern/uv_parametrizer.cc | 2 +- source/blender/gpu/GPU_shader_shared.h | 2 +- source/blender/io/collada/GeometryExporter.h | 2 +- source/blender/makesdna/DNA_view3d_types.h | 2 +- source/blender/python/intern/bpy_rna.h | 5 +++-- tools/check_source/check_spelling_c_config.py | 10 ++++++++++ 20 files changed, 45 insertions(+), 33 deletions(-) diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h b/intern/cycles/kernel/closure/bsdf_microfacet.h index a1165454088..3d3ca2b2da8 100644 --- a/intern/cycles/kernel/closure/bsdf_microfacet.h +++ b/intern/cycles/kernel/closure/bsdf_microfacet.h @@ -423,7 +423,7 @@ ccl_device_inline float bsdf_aniso_lambda(float alpha_x, float alpha_y, float3 V return bsdf_lambda_from_sqr_alpha_tan_n(sqr_alpha_tan_n); } -/* Monodirectional shadowing-masking term. */ +/* Mono-directional shadowing-masking term. */ template ccl_device_inline float bsdf_G(float alpha2, float cos_N) { return 1.0f / (1.0f + bsdf_lambda(alpha2, cos_N)); diff --git a/intern/cycles/kernel/closure/bsdf_principled_hair_huang.h b/intern/cycles/kernel/closure/bsdf_principled_hair_huang.h index 80e7bbe1be8..9dc3bdd705d 100644 --- a/intern/cycles/kernel/closure/bsdf_principled_hair_huang.h +++ b/intern/cycles/kernel/closure/bsdf_principled_hair_huang.h @@ -268,13 +268,13 @@ ccl_device_inline float3 sample_wh( return wh; } -/* Check micronormal/mesonormal direct visiblity from direction `v`. */ +/* Check micronormal/mesonormal direct visibility from direction `v`. */ ccl_device_inline bool microfacet_visible(const float3 v, const float3 m, const float3 h) { return (dot(v, h) > 0.0f && dot(v, m) > 0.0f); } -/* Check micronormal/mesonormal direct visiblity from directions `wi` and `wo`. */ +/* Check micronormal/mesonormal direct visibility from directions `wi` and `wo`. */ ccl_device_inline bool microfacet_visible(const float3 wi, const float3 wo, const float3 m, @@ -502,7 +502,7 @@ ccl_device Spectrum bsdf_hair_huang_eval_residual(KernelGlobals kg, const float rcp_norm_wh2 = 1.0f / len(wh2); wh2 *= rcp_norm_wh2; const float cos_mh2 = dot(wmt, wh2); - if (cos_mh2 >= 0.0f) { /* Microfacet visiblity from macronormal. */ + if (cos_mh2 >= 0.0f) { /* Microfacet visibility from macronormal. */ const float cos_hi2 = dot(-wt, wh2); const float cos_ho2 = dot(-wo, wh2); const float cos_mo2 = dot(-wo, wmt); diff --git a/source/blender/blenkernel/BKE_node_runtime.hh b/source/blender/blenkernel/BKE_node_runtime.hh index 66b19195d14..d429999b3af 100644 --- a/source/blender/blenkernel/BKE_node_runtime.hh +++ b/source/blender/blenkernel/BKE_node_runtime.hh @@ -253,8 +253,9 @@ class bNodeRuntime : NonCopyable, NonMovable { bNode *original = nullptr; /** - * XXX TODO - * Node totr size depends on the prvr size, which in turn is determined from preview size. + * XXX: + * TODO: `prvr` does not exist! + * Node totr size depends on the `prvr` size, which in turn is determined from preview size. * In earlier versions bNodePreview was stored directly in nodes, but since now there can be * multiple instances using different preview images it is possible that required node size * varies between instances. preview_xsize, preview_ysize defines a common reserved size for diff --git a/source/blender/blenkernel/intern/movieclip.cc b/source/blender/blenkernel/intern/movieclip.cc index 41683cdd15f..bf8073d88b0 100644 --- a/source/blender/blenkernel/intern/movieclip.cc +++ b/source/blender/blenkernel/intern/movieclip.cc @@ -2069,7 +2069,7 @@ void BKE_movieclip_free_gputexture(MovieClip *clip) MovieClip_RuntimeGPUTexture *tex = (MovieClip_RuntimeGPUTexture *)BLI_pophead( &clip->runtime.gputextures); for (int i = 0; i < TEXTARGET_COUNT; i++) { - /* free glsl image binding */ + /* Free GLSL image binding. */ if (tex->gputexture[i]) { GPU_texture_free(tex->gputexture[i]); tex->gputexture[i] = nullptr; diff --git a/source/blender/blenkernel/intern/studiolight.cc b/source/blender/blenkernel/intern/studiolight.cc index 5463e015638..dfbd80c45c9 100644 --- a/source/blender/blenkernel/intern/studiolight.cc +++ b/source/blender/blenkernel/intern/studiolight.cc @@ -1074,7 +1074,7 @@ static float blinn_specular(const float L[3], return spec_light * (1.0 - w2) + spec_env * w2; } -/* Keep in sync with the glsl shader function get_world_lighting() */ +/* Keep in sync with the GLSL shader function `get_world_lighting()`. */ static void studiolight_lights_eval(StudioLight *sl, float color[3], const float normal[3]) { float R[3], I[3] = {0.0f, 0.0f, 1.0f}, N[3] = {normal[0], normal[2], -normal[1]}; diff --git a/source/blender/blenloader/intern/versioning_290.cc b/source/blender/blenloader/intern/versioning_290.cc index e96acd57640..865452d62b0 100644 --- a/source/blender/blenloader/intern/versioning_290.cc +++ b/source/blender/blenloader/intern/versioning_290.cc @@ -778,9 +778,9 @@ static void do_versions_291_fcurve_handles_limit(FCurve *fcu) } const float factor = time_delta / total_len; - /* Current keyframe's right handle: */ + /* Current key-frame's right handle: */ madd_v2_v2v2fl(bezt->vec[2], v1, delta1, -factor); /* vec[2] = v1 - factor * delta1 */ - /* Next keyframe's left handle: */ + /* Next key-frame's left handle: */ madd_v2_v2v2fl(nextbezt->vec[0], v4, delta2, -factor); /* vec[0] = v4 - factor * delta2 */ } } diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index a386ab6401e..7f709336411 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -82,7 +82,7 @@ void do_versions_after_linking_400(FileData *fd, Main *bmain) } } - /* XXX This was added many years ago (1c19940198) in 'lib_link` code of particles as a bugfix. + /* XXX This was added many years ago (1c19940198) in 'lib_link` code of particles as a bug-fix. * But this is actually versioning. Should be safe enough here. */ LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) { if (!part->effector_weights) { diff --git a/source/blender/draw/intern/draw_shader_shared.h b/source/blender/draw/intern/draw_shader_shared.h index 4d2eaf72355..7fc3fc8fb20 100644 --- a/source/blender/draw/intern/draw_shader_shared.h +++ b/source/blender/draw/intern/draw_shader_shared.h @@ -173,7 +173,7 @@ enum eObjectInfoFlag { struct ObjectInfos { #if defined(GPU_SHADER) && !defined(DRAW_FINALIZE_SHADER) - /* TODO Rename to struct member for glsl too. */ + /* TODO Rename to struct member for GLSL too. */ float4 orco_mul_bias[2]; float4 ob_color; float4 infos; diff --git a/source/blender/editors/curve/editcurve.cc b/source/blender/editors/curve/editcurve.cc index 1e62f0f3567..14368b2ef2c 100644 --- a/source/blender/editors/curve/editcurve.cc +++ b/source/blender/editors/curve/editcurve.cc @@ -3530,13 +3530,11 @@ static void subdividenurb(Object *obedit, View3D *v3d, int number_cuts) else if (nu->pntsv == 1) { BPoint *nextbp; - /* - * All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves + /* NOTE(@nzc): All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves * are handled together with the regular NURB plane division, as it - * should be. I split it off just now, let's see if it is - * stable... nzc 30-5-'00 - */ - /* count */ + * should be. I split it off just now, let's see if it is stable. */ + + /* Count. */ a = nu->pntsu; bp = nu->bp; while (a--) { @@ -3596,7 +3594,7 @@ static void subdividenurb(Object *obedit, View3D *v3d, int number_cuts) else if (nu->type == CU_NURBS) { /* This is a very strange test ... */ /** - * Subdivide NURB surfaces - nzc 30-5-'00 - + * NOTE(@nzc): Subdivide NURB surfaces * * Subdivision of a NURB curve can be effected by adding a * control point (insertion of a knot), or by raising the diff --git a/source/blender/editors/include/ED_keyframes_keylist.hh b/source/blender/editors/include/ED_keyframes_keylist.hh index ecc1ff68245..7e727c44f2e 100644 --- a/source/blender/editors/include/ED_keyframes_keylist.hh +++ b/source/blender/editors/include/ED_keyframes_keylist.hh @@ -134,8 +134,10 @@ const ActKeyColumn *ED_keylist_find_any_between(const AnimKeylist *keylist, bool ED_keylist_is_empty(const AnimKeylist *keylist); const ListBase /* ActKeyColumn */ *ED_keylist_listbase(const AnimKeylist *keylist); bool ED_keylist_all_keys_frame_range(const AnimKeylist *keylist, Range2f *r_frame_range); -/* Return the selected keyframe's range. If none are selected, return False and - * do not affect the frame range. */ +/** + * Return the selected key-frame's range. If none are selected, return False and + * do not affect the frame range. + */ bool ED_keylist_selected_keys_frame_range(const AnimKeylist *keylist, Range2f *r_frame_range); const ActKeyColumn *ED_keylist_array(const AnimKeylist *keylist); int64_t ED_keylist_array_len(const AnimKeylist *keylist); diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc index a451ef63fe1..b1458c15560 100644 --- a/source/blender/editors/render/render_preview.cc +++ b/source/blender/editors/render/render_preview.cc @@ -115,7 +115,7 @@ struct ShaderPreview { ID *parent; MTex *slot; - /* datablocks with nodes need full copy during preview render, glsl uses it too */ + /* Data-blocks with nodes need full copy during preview render, GLSL uses it too. */ Material *matcopy; Tex *texcopy; Light *lampcopy; diff --git a/source/blender/editors/screen/screen_ops.cc b/source/blender/editors/screen/screen_ops.cc index dffce5bc921..35e078b9cef 100644 --- a/source/blender/editors/screen/screen_ops.cc +++ b/source/blender/editors/screen/screen_ops.cc @@ -899,7 +899,7 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b } } else if (az->type == AZONE_REGION_SCROLL && az->region->visible) { - /* If the region is not visible we can ignore this scoller zone. */ + /* If the region is not visible we can ignore this scroll-bar zone. */ ARegion *region = az->region; View2D *v2d = ®ion->v2d; int scroll_flag = 0; @@ -969,7 +969,7 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b ED_area_tag_redraw_no_rebuild(area); } else if (az->type == AZONE_REGION_SCROLL && az->region->visible) { - /* If the region is not visible we can ignore this scoller zone. */ + /* If the region is not visible we can ignore this scroll-bar zone. */ if (az->direction == AZ_SCROLL_VERT) { az->alpha = az->region->v2d.alpha_vert = 0; area->flag &= ~AREA_FLAG_ACTIONZONES_UPDATE; diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index 07a2b4cf972..2c428cfc9ce 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -1710,8 +1710,8 @@ void node_link_bezier_points_evaluated(const bNodeLink &link, #define LINK_WIDTH (2.5f * UI_SCALE_FAC) #define ARROW_SIZE (7 * UI_SCALE_FAC) -/* Reroute arrow shape and mute bar. These are expanded here and shrunk in the glsl code. - * See: gpu_shader_2D_nodelink_vert.glsl */ +/* Reroute arrow shape and mute bar. These are expanded here and shrunk in the GLSL code. + * See: `gpu_shader_2D_nodelink_vert.glsl`. */ static float arrow_verts[3][2] = {{-1.0f, 1.0f}, {0.0f, 0.0f}, {-1.0f, -1.0f}}; static float arrow_expand_axis[3][2] = {{0.7071f, 0.7071f}, {M_SQRT2, 0.0f}, {0.7071f, -0.7071f}}; static float mute_verts[3][2] = {{0.7071f, 1.0f}, {0.7071f, 0.0f}, {0.7071f, -1.0f}}; diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index ac90861db3b..cfaa85a9331 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -738,7 +738,7 @@ void ED_node_set_active( ED_node_tree_propagate_change(nullptr, bmain, ntree); if ((node->flag & NODE_ACTIVE_TEXTURE) && !was_active_texture) { - /* If active texture changed, free glsl materials. */ + /* If active texture changed, free GLSL materials. */ LISTBASE_FOREACH (Material *, ma, &bmain->materials) { if (ma->nodetree && ma->use_nodes && ntreeContainsTree(ma->nodetree, ntree)) { GPU_material_free(&ma->gpumaterial); diff --git a/source/blender/geometry/intern/uv_parametrizer.cc b/source/blender/geometry/intern/uv_parametrizer.cc index d35781f07e0..33e6e13c5ed 100644 --- a/source/blender/geometry/intern/uv_parametrizer.cc +++ b/source/blender/geometry/intern/uv_parametrizer.cc @@ -3854,7 +3854,7 @@ void uv_parametrizer_face_add(ParamHandle *phandle, } if (permute.size() != nverts) { const int pm = int(permute.size()); - /* Add the remaining pm-gon. */ + /* Add the remaining `pm-gon` data. */ Array vkeys_sub(pm); Array co_sub(pm); Array uv_sub(pm); diff --git a/source/blender/gpu/GPU_shader_shared.h b/source/blender/gpu/GPU_shader_shared.h index cee4d83b2a9..c26e80e5490 100644 --- a/source/blender/gpu/GPU_shader_shared.h +++ b/source/blender/gpu/GPU_shader_shared.h @@ -129,7 +129,7 @@ struct TestOutput { TestOutputRawData result; /** TestStatus. */ uint status; - /** Line error in the glsl file. */ + /** Line error in the GLSL file. */ int line; /** TestType of expect and result. */ uint type; diff --git a/source/blender/io/collada/GeometryExporter.h b/source/blender/io/collada/GeometryExporter.h index eeb197dd3e1..480c5fdca64 100644 --- a/source/blender/io/collada/GeometryExporter.h +++ b/source/blender/io/collada/GeometryExporter.h @@ -76,7 +76,7 @@ class GeometryExporter : COLLADASW::LibraryGeometries { std::string makeTexcoordSourceId(std::string &geom_id, int layer_index, bool is_single_layer); - /** Creates for texcoords. */ + /** Creates for texture-coordinates. */ void createTexcoordsSource(std::string geom_id, Mesh *me); /** Creates for normals. */ diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 35636620a02..1a172cfaf12 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -40,7 +40,7 @@ typedef struct RegionView3D { float persmat[4][4]; /** Inverse of persmat. */ float persinv[4][4]; - /** Offset/scale for camera glsl texcoords. */ + /** Offset/scale for camera GLSL texture-coordinates. */ float viewcamtexcofac[4]; /** viewmat/persmat multiplied with object matrix, while drawing and selection. */ diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 8cd8381a1c9..661c7062462 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -122,8 +122,9 @@ typedef struct BPy_StructRNA { #endif /* !USE_PYRNA_STRUCT_REFERENCE */ #ifdef PYRNA_FREE_SUPPORT - bool freeptr; /* needed in some cases if ptr.data is created on the fly, free when deallocing */ -#endif /* PYRNA_FREE_SUPPORT */ + /** Needed in some cases if ptr.data is created on the fly, free when deallocating. */ + bool freeptr; +#endif /* PYRNA_FREE_SUPPORT */ } BPy_StructRNA; typedef struct { diff --git a/tools/check_source/check_spelling_c_config.py b/tools/check_source/check_spelling_c_config.py index 50d260aa8fa..3e657fd5c79 100644 --- a/tools/check_source/check_spelling_c_config.py +++ b/tools/check_source/check_spelling_c_config.py @@ -45,6 +45,7 @@ dict_custom = { "anisotropic", "anisotropy", "atomicity", + "attenuations", "bindless", "bitwise", "blocky", @@ -148,6 +149,7 @@ dict_custom = { "imbricated", "impactful", "incrementation", + "inferencing", "initializer", "initializers", "inlining", @@ -613,6 +615,14 @@ dict_custom = { "lossless", "lossy", "luma", + "macronormal", + "macronormals", + "mesonormal", + "mesonormals", + "microfacet", + "microfacets", + "micronormal", + "micronormals", "mipmap", "mipmapped", "mipmapping",