From 311fa9768d9a48d58a5c3a8f6c94ce6caad0d101 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 12 Aug 2023 16:29:51 +1000 Subject: [PATCH] Cleanup: spelling in comments --- intern/ghost/intern/GHOST_ContextCGL.mm | 7 ++++--- intern/ghost/intern/GHOST_WindowCocoa.mm | 5 +++-- intern/guardedalloc/intern/mallocn_guarded_impl.c | 2 +- intern/guardedalloc/intern/mallocn_intern.h | 2 +- source/blender/blenkernel/intern/lib_override.cc | 2 +- .../editors/animation/keyframes_general.cc | 9 +++++---- .../editors/gpencil_legacy/editaction_gpencil.cc | 2 +- .../blender/editors/space_action/action_edit.cc | 2 +- .../editors/space_node/node_shader_preview.cc | 6 ++---- .../editors/transform/transform_convert_action.cc | 15 +++++++++------ source/blender/io/usd/intern/usd_writer_mesh.cc | 2 +- source/blender/makesrna/RNA_types.hh | 2 +- .../intern/rna_access_compare_override.cc | 2 +- source/blender/makesrna/intern/rna_rna.cc | 2 +- 14 files changed, 32 insertions(+), 28 deletions(-) diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm index 671038f6684..589a129a9cf 100644 --- a/intern/ghost/intern/GHOST_ContextCGL.mm +++ b/intern/ghost/intern/GHOST_ContextCGL.mm @@ -89,10 +89,11 @@ GHOST_ContextCGL::GHOST_ContextCGL(bool stereoVisual, m_metalLayer.allowsNextDrawableTimeout = NO; /* Enable EDR support. This is done by: - * 1. Using a floating point render target, so that values ouside 0..1 can be used + * 1. Using a floating point render target, so that values outside 0..1 can be used * 2. Informing the OS that we are EDR aware, and intend to use values outside 0..1 * 3. Setting the extended sRGB color space so that the OS knows how to interpret the - * values. */ + * values. + */ m_metalLayer.wantsExtendedDynamicRangeContent = YES; m_metalLayer.pixelFormat = METAL_FRAMEBUFFERPIXEL_FORMAT_EDR; const CFStringRef name = kCGColorSpaceExtendedSRGB; @@ -257,7 +258,7 @@ void GHOST_ContextCGL::metalInit() texture2d t [[texture(0)]]) { /* Final blit should ensure alpha is 1.0. This resolves - * rendering artifacts for blitting of final backbuffer. */ + * rendering artifacts for blitting of final back-buffer. */ float4 out_tex = t.sample(s, v.texCoord); out_tex.a = 1.0; return out_tex; diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 608181987c9..9d829a67a2e 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -349,10 +349,11 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa, if (type == GHOST_kDrawingContextTypeMetal) { /* Enable EDR support. This is done by: - * 1. Using a floating point render target, so that values ouside 0..1 can be used + * 1. Using a floating point render target, so that values outside 0..1 can be used * 2. Informing the OS that we are EDR aware, and intend to use values outside 0..1 * 3. Setting the extended sRGB color space so that the OS knows how to interpret the - * values. */ + * values. + */ m_metalLayer.wantsExtendedDynamicRangeContent = YES; m_metalLayer.pixelFormat = MTLPixelFormatRGBA16Float; const CFStringRef name = kCGColorSpaceExtendedSRGB; diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c index 76f32ad1eb6..526686a579d 100644 --- a/intern/guardedalloc/intern/mallocn_guarded_impl.c +++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c @@ -40,7 +40,7 @@ //#define DEBUG_MEMCOUNTER /* Only for debugging: - * Defining DEBUG_BACKTRACE will display a backtrace from where memory block was allocated and + * Defining DEBUG_BACKTRACE will display a back-trace from where memory block was allocated and * print this trace for all unfreed blocks. This will only work for ASAN enabled builds. This * option will be on by default for MSVC as it currently does not have LSAN which would normally * report these leaks, off by default on all other platforms because it would report the leaks diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h index 6ed97f6d264..df3149c3eaf 100644 --- a/intern/guardedalloc/intern/mallocn_intern.h +++ b/intern/guardedalloc/intern/mallocn_intern.h @@ -121,7 +121,7 @@ void memory_usage_peak_reset(void); /** * Clear the listbase of allocated memory blocks. * - * WARNING: This will make the whole guardedalloc system fully inconsistent. It is only intented to + * WARNING: This will make the whole guardedalloc system fully inconsistent. It is only indented to * be called in one place: the destructor of the #MemLeakPrinter class, which is only * instantiated once as a static variable by #MEM_init_memleak_detection, and therefore destructed * once at program exit. diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc index 59087d2861f..7ff3f61af59 100644 --- a/source/blender/blenkernel/intern/lib_override.cc +++ b/source/blender/blenkernel/intern/lib_override.cc @@ -3800,7 +3800,7 @@ static IDOverrideLibraryPropertyOperation *liboverride_opop_find_name_lib_iterat } } - /* No exact match found, keep cheking the rest of the list of operations. */ + /* No exact match found, keep checking the rest of the list of operations. */ } return nullptr; diff --git a/source/blender/editors/animation/keyframes_general.cc b/source/blender/editors/animation/keyframes_general.cc index a2b2eb87d43..8c6bc02111a 100644 --- a/source/blender/editors/animation/keyframes_general.cc +++ b/source/blender/editors/animation/keyframes_general.cc @@ -706,10 +706,11 @@ void blend_offset_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const floa static float s_curve(float x, float slope, float width, float height, float xshift, float yshift) { - /* Formula for 'S' curve we use for the "ease" sliders. The shift values move the curve verticaly - * or horizontaly. The range of the curve used is from 0 to 1 on "x" and "y" so we can scale it - * (width and height) and move it (xshift and y yshift) to crop the part of the curve we need. - * Slope determins how curvy the shape is. */ + /* Formula for 'S' curve we use for the "ease" sliders. + * The shift values move the curve vertically or horizontally. + * The range of the curve used is from 0 to 1 on "x" and "y" + * so we can scale it (width and height) and move it (`xshift` and y `yshift`) + * to crop the part of the curve we need. Slope determines how curvy the shape is. */ float y = height * pow((x - xshift), slope) / (pow((x - xshift), slope) + pow((width - (x - xshift)), slope)) + yshift; diff --git a/source/blender/editors/gpencil_legacy/editaction_gpencil.cc b/source/blender/editors/gpencil_legacy/editaction_gpencil.cc index c3cffd9245c..7d809f97f96 100644 --- a/source/blender/editors/gpencil_legacy/editaction_gpencil.cc +++ b/source/blender/editors/gpencil_legacy/editaction_gpencil.cc @@ -109,7 +109,7 @@ bool ED_gpencil_layer_frame_select_check(const bGPDlayer *gpl) return false; } -/* helper function - select gp-frame based on SELECT_* mode */ +/* Helper function: select GP-frame based on SELECT_* mode. */ static void gpencil_frame_select(bGPDframe *gpf, short select_mode) { if (gpf == nullptr) { diff --git a/source/blender/editors/space_action/action_edit.cc b/source/blender/editors/space_action/action_edit.cc index fa6ea93f2bf..f24e2ca8f41 100644 --- a/source/blender/editors/space_action/action_edit.cc +++ b/source/blender/editors/space_action/action_edit.cc @@ -178,7 +178,7 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const if (ale->datatype == ALE_GPFRAME) { bGPDlayer *gpl = static_cast(ale->data); - /* Find gp-frame which is less than or equal to current-frame. */ + /* Find GP-frame which is less than or equal to current-frame. */ LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { if (!onlySel || (gpf->flag & GP_FRAME_SELECT)) { const float framenum = float(gpf->framenum); diff --git a/source/blender/editors/space_node/node_shader_preview.cc b/source/blender/editors/space_node/node_shader_preview.cc index 1b3c330c8ba..fdc41b7c471 100644 --- a/source/blender/editors/space_node/node_shader_preview.cc +++ b/source/blender/editors/space_node/node_shader_preview.cc @@ -462,10 +462,8 @@ static void connect_nodes_to_aovs(const Span treepath, bNodeSocket *aov_socket = nodeFindSocket(aov_node, SOCK_IN, "Color"); if (socket_preview->in_out == SOCK_IN) { if (socket_preview->link == nullptr) { - /** - * Copy the custom value of the socket directly to the AOV node. - * If the socket does not support custom values, it will justl render black. - */ + /* Copy the custom value of the socket directly to the AOV node. + * If the socket does not support custom values, it will just render black. */ float vec[4] = {0., 0., 0., 1.}; PointerRNA ptr; switch (socket_preview->type) { diff --git a/source/blender/editors/transform/transform_convert_action.cc b/source/blender/editors/transform/transform_convert_action.cc index ed1b4df61e9..f233dfb4bd3 100644 --- a/source/blender/editors/transform/transform_convert_action.cc +++ b/source/blender/editors/transform/transform_convert_action.cc @@ -37,17 +37,20 @@ #include "transform_convert.hh" -/* helper struct for gp-frame transforms */ +/** Helper struct for GP-frame transforms. */ struct tGPFtransdata { union { - float val; /* where transdata writes transform */ - float loc[3]; /* #td->val and #td->loc share the same pointer. */ + /** Where `transdata` writes transform. */ + float val; + /** #td->val and #td->loc share the same pointer. */ + float loc[3]; }; - int *sdata; /* pointer to gpf->framenum */ + /** Pointer to `gpf->framenum` */ + int *sdata; }; /* -------------------------------------------------------------------- */ -/** \name Grease Pencil Transfrom helpers +/** \name Grease Pencil Transform helpers * \{ */ static bool grease_pencil_layer_initialize_trans_data(blender::bke::greasepencil::Layer &layer) @@ -60,7 +63,7 @@ static bool grease_pencil_layer_initialize_trans_data(blender::bke::greasepencil } /* Make a copy of the current frames in the layer. This map will be changed during the - * transformation, and we need to be able to reset it if the operation is cancelled. */ + * transformation, and we need to be able to reset it if the operation is canceled. */ trans_data.frames_copy = layer.frames(); trans_data.frames_duration.clear(); trans_data.frames_destination.clear(); diff --git a/source/blender/io/usd/intern/usd_writer_mesh.cc b/source/blender/io/usd/intern/usd_writer_mesh.cc index ed4aaf3bfe5..ba42939f50f 100644 --- a/source/blender/io/usd/intern/usd_writer_mesh.cc +++ b/source/blender/io/usd/intern/usd_writer_mesh.cc @@ -292,7 +292,7 @@ void USDGenericMeshWriter::write_uv_data(const Mesh *mesh, const blender::StringRef active_ref(active_set_name); - /* Because primvars don't have a notion of "active" for data like + /* Because prim-vars don't have a notion of "active" for data like * UVs, but a specific UV set may be considered "active" by target * applications, the [ ---- ] is to name the active set "st". */ const std::string name = active_set_name && (active_ref == attribute_id.name()) ? diff --git a/source/blender/makesrna/RNA_types.hh b/source/blender/makesrna/RNA_types.hh index ceaedd6d134..316ea629005 100644 --- a/source/blender/makesrna/RNA_types.hh +++ b/source/blender/makesrna/RNA_types.hh @@ -346,7 +346,7 @@ typedef enum PropertyOverrideFlag { /** * Only use indices to compare items in the property, never names (collections only). * - * Useful when nameprop of the items is generated from other data + * Useful when #StructRNA::nameproperty of the items is generated from other data * (e.g. name of material slots is actually name of assigned material). */ PROPOVERRIDE_NO_PROP_NAME = (1 << 11), diff --git a/source/blender/makesrna/intern/rna_access_compare_override.cc b/source/blender/makesrna/intern/rna_access_compare_override.cc index 0f5bc03c735..45c199b9bd5 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.cc +++ b/source/blender/makesrna/intern/rna_access_compare_override.cc @@ -1017,7 +1017,7 @@ static bool rna_property_override_collection_subitem_name_id_match( if (do_id_pointer) { if (*item_id != static_cast(ptr_item_name->data)) { /* If the ID pointer does not match, then there is no match, no need to check the - * name iteself. */ + * name itself. */ return is_match; } } diff --git a/source/blender/makesrna/intern/rna_rna.cc b/source/blender/makesrna/intern/rna_rna.cc index daf7bfe962f..75c5f572e9a 100644 --- a/source/blender/makesrna/intern/rna_rna.cc +++ b/source/blender/makesrna/intern/rna_rna.cc @@ -1369,7 +1369,7 @@ static void rna_property_override_diff_propptr_validate_diffing( ptrdiff_ctx.rna_itemname_b = rna_itemname_b; } - /* Note: This will always assign nullptr to these libpointers in case `do_id_lib` is false, + /* Note: This will always assign nullptr to these lib-pointers in case `do_id_lib` is false, * which ensures that they will not affect the result of `ptrdiff_ctx.is_valid_for_diffing` in * the last check below. */ ID *rna_itemid_a = (do_id_pointer && propptr_a->data) ? static_cast(propptr_a->data) :