Cleanup: spelling in comments (make check_spelling_*)

This commit is contained in:
Campbell Barton
2025-03-13 13:41:17 +11:00
parent 9dbd20b369
commit 6ef7dae8ef
30 changed files with 55 additions and 52 deletions

View File

@@ -74,8 +74,8 @@ SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
# For now, ignore add-ons and internal sub-classes of `bpy.types.PropertyGroup`.
#
# Besides disabling this line, the main change will be to add a
# 'toctree' to 'write_rst_index' which contains the generated RST files.
# This 'toctree' can be generated automatically.
# `toctree` to `write_rst_index` which contains the generated RST files.
# This `toctree` can be generated automatically.
#
# See: D6261 for reference.
USE_ONLY_BUILTIN_RNA_TYPES = True

View File

@@ -909,7 +909,7 @@ enum AttributeStandard {
};
enum AttributeFlag {
ATTR_SUBDIVIDE_SMOOTH_FVAR = (1 << 0), /* This attribute is face-varying and requirs smooth
ATTR_SUBDIVIDE_SMOOTH_FVAR = (1 << 0), /* This attribute is face-varying and requires smooth
* subdivision (typically UV map). */
};

View File

@@ -53,7 +53,7 @@ bool SubdAttributeInterpolation::support_interp_attribute(const Attribute &attr)
return false;
}
break;
/* Ptex coordinates will be computed by subdivision. */
/* PTex coordinates will be computed by subdivision. */
case ATTR_STD_PTEX_FACE_ID:
case ATTR_STD_PTEX_UV:
return false;

View File

@@ -474,7 +474,7 @@ void DiagSplit::split_ngon(const Mesh::SubdFace &face,
void DiagSplit::split_patches(const Patch *patches, const size_t patches_byte_stride)
{
/* Keep base mesh vertices, create new triangels. */
/* Keep base mesh vertices, create new triangles. */
num_verts = params.mesh->get_num_subd_base_verts();
num_triangles = 0;

View File

@@ -60,9 +60,9 @@ bool GHOST_NDOFManagerUnix::available()
return available_;
}
/*
* Workaround for a problem where we don't enter the 'GHOST_kFinished' state,
* this causes any proceeding event to have a very high 'dt' (time delta),
/**
* Workaround for a problem where we don't enter the #GHOST_kFinished state,
* this causes any proceeding event to have a very high `dt` (time delta),
* many seconds for eg, causing the view to jump.
*
* this workaround expects continuous events, if we miss a motion event,

View File

@@ -337,7 +337,7 @@ def ensure_ext(filepath, ext, *, case_sensitive=False):
:arg filepath: The file path.
:type filepath: str
:arg ext: The extension to check for, can be a compound extension. Should
start with a dot, such as '.blend' or '.tar.gz'.
start with a dot, such as ``.blend`` or ``.tar.gz``.
:type ext: str
:arg case_sensitive: Check for matching case when comparing extensions.
:type case_sensitive: bool

View File

@@ -43,11 +43,11 @@ struct GPUVertBufRaw;
#define MAKE_DVAR_TAG(a, b, c, d) \
((uint32_t(a) << 24u) | (uint32_t(b) << 16u) | (uint32_t(c) << 8u) | (uint32_t(d)))
#define BLF_VARIATION_AXIS_WEIGHT MAKE_DVAR_TAG('w', 'g', 'h', 't') /* 'wght' weight axis. */
#define BLF_VARIATION_AXIS_SLANT MAKE_DVAR_TAG('s', 'l', 'n', 't') /* 'slnt' slant axis. */
#define BLF_VARIATION_AXIS_WIDTH MAKE_DVAR_TAG('w', 'd', 't', 'h') /* 'wdth' width axis. */
#define BLF_VARIATION_AXIS_SPACING MAKE_DVAR_TAG('s', 'p', 'a', 'c') /* 'spac' spacing axis. */
#define BLF_VARIATION_AXIS_OPTSIZE MAKE_DVAR_TAG('o', 'p', 's', 'z') /* 'opsz' optical size. */
#define BLF_VARIATION_AXIS_WEIGHT MAKE_DVAR_TAG('w', 'g', 'h', 't') /* `wght` weight axis. */
#define BLF_VARIATION_AXIS_SLANT MAKE_DVAR_TAG('s', 'l', 'n', 't') /* `slnt` slant axis. */
#define BLF_VARIATION_AXIS_WIDTH MAKE_DVAR_TAG('w', 'd', 't', 'h') /* `wdth` width axis. */
#define BLF_VARIATION_AXIS_SPACING MAKE_DVAR_TAG('s', 'p', 'a', 'c') /* `spac` spacing axis. */
#define BLF_VARIATION_AXIS_OPTSIZE MAKE_DVAR_TAG('o', 'p', 's', 'z') /* `opsz` optical size. */
/* -------------------------------------------------------------------- */
/** \name Sub-Pixel Offset & Utilities

View File

@@ -239,7 +239,7 @@ BlendfileLinkAppendContextItem *BKE_blendfile_link_append_context_item_add(
* \note #BKE_blendfile_link_append_context_library_add should never be called on the same
*`lapp_context` after this function.
*
* \param id_types_filter: A set of `FILTER_ID` bitflags, the types of IDs to add to the items
* \param id_types_filter: A set of `FILTER_ID` bit-flags, the types of IDs to add to the items
* list.
* \param library_index: The index of the library to look into, in given `lapp_context`.
*

View File

@@ -269,18 +269,18 @@ int *BKE_mesh_calc_smoothgroups(int edges_num,
* not neighbors. Values of each group are always powers of two.
*
* By default, only groups that share a same sharp edge are considered neighbors, and therefore
* prevented to use the same bitflag value.
* prevented to use the same bit-flag value.
*
* If #use_boundary_vertices_for_bitflags is set to `true`, then groups are also considered
* neighbors (and therefore cannot have the same bitflag value) if they share a single vertex, even
* if they have no common edge. This behavior seems to be required by some DCCs to recompute
* neighbors (and therefore cannot have the same bit-flag value) if they share a single vertex,
* even if they have no common edge. This behavior seems to be required by some DCCs to recompute
* correct normals, see e.g. #104434. It will however make it much more likely to run out of
* available bits with certain types of topology (e.g. large fans of sharp faces).
*
* \param sharp_edges: Optional (possibly empty) span.
* \param sharp_faces: Optional (possibly empty) span.
* \param r_totgroup: The total number of groups, 1 or more.
* \return Face aligned array of group bitflags values (i.e. always powers of 2), starting at 1 (0
* \return Face aligned array of group bit-flags values (i.e. always powers of 2), starting at 1 (0
* being used as 'invalid' flag). Note that it's the callers's responsibility to MEM_freeN the
* returned array.
*/

View File

@@ -1255,7 +1255,7 @@ static ChannelDriver *idriver_to_cdriver(IpoDriver *idriver)
/* allocate memory for new driver */
cdriver = static_cast<ChannelDriver *>(MEM_callocN(sizeof(ChannelDriver), "ChannelDriver"));
/* if 'pydriver', just copy data across */
/* If `pydriver`, just copy data across. */
if (idriver->type == IPO_DRIVER_TYPE_PYTHON) {
/* PyDriver only requires the expression to be copied */
/* FIXME: expression will be useless due to API changes, but at least not totally lost */

View File

@@ -486,7 +486,7 @@ static void face_edge_loop_islands_calc_bitflags_exclude_at_boundary(
const int face_group_id_overflowed,
int &r_bit_face_group_mask)
{
/* Find neighbour faces (either from a boundary edge, or a boundary vertex) that already have a
/* Find neighbor faces (either from a boundary edge, or a boundary vertex) that already have a
* group assigned, and exclude these groups' bits from the available set of groups bits that can
* be assigned to the currently processed group. */
for (const int face_idx : faces_from_item) {
@@ -497,14 +497,15 @@ static void face_edge_loop_islands_calc_bitflags_exclude_at_boundary(
}
}
/* ABOUT #use_boundary_vertices_for_bitflags:
/**
* ABOUT #use_boundary_vertices_for_bitflags:
*
* Also exclude bits used in other groups sharing the same boundary vertex, i.e. if one edge
* around the vertex of the current corner is a boundary edge.
*
* NOTE: The reason for this requirement is not very clear. Bitflags groups are only handled here
* NOTE: The reason for this requirement is not very clear. Bit-flags groups are only handled here
* for I/O purposes, Blender itself does not have this feature. Main external apps heavily
* relying on these bitflags groups for their smooth shading computation seem to generate invalid
* relying on these bit-flags groups for their smooth shading computation seem to generate invalid
* results when two different groups share the same bits, and are connected by a vertex only
* (i.e. have no edge in common). See #104434.
*
@@ -641,9 +642,9 @@ static void face_edge_loop_islands_calc(const int totedge,
* first face's corner, then when processing the other face's corner in the same
* group.
* - Isolated boundary edges (i.e. boundary edges only connected to faces of the
* same group) cannot be represented by bitflags groups, at least not with
* same group) cannot be represented by bit-flags groups, at least not with
* current algorithm (they cannot define more than one group).
* - Inverions of winding (aka flipped faces) always generate boundary edges in
* - Inversions of winding (aka flipped faces) always generate boundary edges in
* current use-case (smooth groups), i.e. two faces with opposed winding cannot
* belong to the same group. */
const int vert = corner_verts[loop];

View File

@@ -723,8 +723,8 @@ static float nlastrip_get_frame_actionclip(NlaStrip *strip, float cframe, short
return strip->actstart;
}
/* - the 'fmod(..., actlength * scale)' is needed to get the repeats working
* - the '/ scale' is needed to ensure that scaling influences the timing within the repeat
/* - The `fmod(..., actlength * scale)` is needed to get the repeats working.
* - The `/ scale` is needed to ensure that scaling influences the timing within the repeat.
*/
return strip->actend - fmodf(cframe - strip->start, actlength * scale) / scale;
}

View File

@@ -42,7 +42,7 @@ void _BLI_assert_print_backtrace()
void _BLI_assert_abort()
{
/* Wrap to remove 'noreturn' attribute since this suppresses missing return statements,
/* Wrap to remove `noreturn` attribute since this suppresses missing return statements,
* allowing changes to debug builds to accidentally to break release builds.
*
* For example `BLI_assert_unreachable();` at the end of a function that returns a value,

View File

@@ -31,9 +31,9 @@ size_t BLI_timecode_string_from_time(char *str,
char neg[2] = {'\0'};
size_t rlen;
/* get cframes */
/* Get frames. */
if (time < 0) {
/* Correction for negative cframes. */
/* Correction for negative frames. */
neg[0] = '-';
time = -time;
}

View File

@@ -621,7 +621,7 @@ void do_versions_after_setup(Main *new_bmain,
BlendFileReadReport *reports)
{
/* WARNING: The code below may add IDs. These IDs _will_ be (by definition) conforming to current
* code's version already, and _must not_ be 'versionned' again.
* code's version already, and _must not_ be *versioned* again.
*
* This means that when adding code here, _extreme_ care must be taken that it will not badly
* affect these 'modern' IDs potentially added by already existing processing.

View File

@@ -98,7 +98,7 @@ bool BM_custom_loop_normals_to_vector_layer(BMesh *bm);
void BM_custom_loop_normals_from_vector_layer(BMesh *bm, bool add_sharp_edges);
/**
* Define sharp edges as needed to mimic 'autosmooth' from angle threshold.
* Define sharp edges as needed to mimic auto-smooth from angle threshold.
*
* Used when defining an empty custom loop normals data layer,
* to keep same shading as with auto-smooth!

View File

@@ -58,10 +58,10 @@ struct BMWalker {
#define BMW_MASK_NOP 0
/**
* \brief Init Walker
* \brief Initialize Walker
*
* Allocates and returns a new mesh walker of a given type.
* The elements visited are filtered by the bitmask 'searchmask'.
* The elements visited are filtered by the bit-mask `searchmask`.
*/
void BMW_init(struct BMWalker *walker,
BMesh *bm,

View File

@@ -129,7 +129,7 @@ static GPUContext *blender_gpu_context = nullptr;
static TicketMutex *system_gpu_context_mutex = nullptr;
/**
* The usage of GPUShader objects is currently not thread safe. Since they are shared resources
* between render engine instances, we cannot allow pass submissions in a concurent manner.
* between render engine instances, we cannot allow pass submissions in a concurrent manner.
*/
static TicketMutex *submission_mutex = nullptr;

View File

@@ -1392,7 +1392,7 @@ void view2d_scrollers_calc(View2D *v2d, const rcti *mask_custom, View2DScrollers
vert = v2d->vert;
hor = v2d->hor;
/* Pad scrollbar drawing away from region edges. */
/* Pad scroll-bar drawing away from region edges. */
const int edge_pad = int(0.1f * U.widget_unit);
if (scroll & V2D_SCROLL_BOTTOM) {
hor.ymin += edge_pad;

View File

@@ -1271,7 +1271,7 @@ bool ED_mesh_pick_face_vert(
}
}
/* map 'dm -> mesh' r_index if possible */
/* Map the `dm` to `mesh`, setting the `r_index` if possible. */
if (v_idx_best != ORIGINDEX_NONE) {
const int *index_mv_to_orig = (const int *)CustomData_get_layer(&mesh_eval->vert_data,
CD_ORIGINDEX);

View File

@@ -84,7 +84,7 @@ static SpaceLink *action_create(const ScrArea *area, const Scene *scene)
region->regiontype = RGN_TYPE_CHANNELS;
region->alignment = RGN_ALIGN_LEFT;
/* only need to set scroll settings, as this will use 'listview' v2d configuration */
/* Only need to set scroll settings, as this will use `listview` v2d configuration. */
region->v2d.scroll = V2D_SCROLL_BOTTOM;
region->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;

View File

@@ -149,8 +149,10 @@ class Context {
}
protected:
/* Derived classes should call this from the destructor, as freeing textures and framebuffers may
* need the derived context to be valid. */
/**
* Derived classes should call this from the destructor,
* as freeing textures and frame-buffers may need the derived context to be valid.
*/
void free_resources();
};

View File

@@ -118,8 +118,8 @@ float safe_mod(float a, float b)
}
/**
* A version of mod that behaves similar to C++ std::modf, and is safe such that it returns 0 when
* b is also 0.
* A version of mod that behaves similar to C++ `std::modf`, and is safe such that it returns 0
* when b is also 0.
*/
float compatible_mod(float a, float b)
{

View File

@@ -47,8 +47,8 @@ vec3 safe_mod(vec3 a, float b);
vec4 safe_mod(vec4 a, float b);
/**
* A version of mod that behaves similar to C++ std::modf, and is safe such that it returns 0 when
* b is also 0.
* A version of mod that behaves similar to C++ `std::modf`, and is safe such that it returns 0
* when b is also 0.
*/
vec2 compatible_mod(vec2 a, vec2 b);
vec3 compatible_mod(vec3 a, vec3 b);

View File

@@ -46,7 +46,7 @@ void fixup_line_continuations(char *p, char *end)
if (backslash == end) {
break;
}
/* Skip over possible whitespace right after it. */
/* Skip over possible white-space right after it. */
p = backslash + 1;
while (p < end && is_whitespace(*p) && *p != '\n') {
++p;

View File

@@ -48,7 +48,7 @@
#define SDNA_MAX_FILENAME_LENGTH 255
/* The include file below is automatically generated from the `SRC_DNA_INC`
* variable in 'source/blender/CMakeLists.txt'. */
* variable in `source/blender/CMakeLists.txt`. */
static const char *includefiles[] = {
#include "dna_includes_as_strings.h"
/* Empty string to indicate end of include files. */

View File

@@ -5,7 +5,7 @@
/** \file
* \ingroup pygen
*
* This file defines the 'bgl' module, used for drawing text in OpenGL.
* This file defines the `bgl` module, used for drawing text in OpenGL.
*/
/* Future-proof, See https://docs.python.org/3/c-api/arg.html#strings-and-buffers */

View File

@@ -198,7 +198,7 @@ int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error
/**
* helper function that returns a Python `__hash__`.
*
* \note consistent with the equivalent tuple of floats (CPython's 'tuplehash')
* \note consistent with the equivalent tuple of floats (CPython's `tuplehash`)
*/
Py_hash_t mathutils_array_hash(const float *array, size_t array_len);

View File

@@ -454,7 +454,7 @@ void wm_gizmo_calculate_scale(wmGizmo *gz, const bContext *C)
if ((gz->parent_gzgroup->type->flag & WM_GIZMOGROUPTYPE_SCALE) == 0) {
scale *= U.gizmo_size;
if (rv3d) {
/* 'ED_view3d_pixel_size' includes 'U.pixelsize', remove it. */
/* #ED_view3d_pixel_size includes #U.pixelsize, remove it. */
float matrix_world[4][4];
if (gz->type->matrix_basis_get) {
float matrix_basis[4][4];

View File

@@ -4324,8 +4324,8 @@ static void save_file_overwrite_confirm(bContext *C, void *arg_block, void *arg_
{
wmWindow *win = CTX_wm_window(C);
/* Re-use operator properties as defined for the initial 'save' operator, which triggered this
* 'forward compat' popup. */
/* Re-use operator properties as defined for the initial "Save" operator,
* which triggered this "Forward Compatibility" popup. */
wmGenericCallback *callback = WM_generic_callback_steal(
static_cast<wmGenericCallback *>(arg_data));