From ccea39b53892b6b5fd41c8b0dfa9fac4848485a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 12 Apr 2023 11:24:10 +1000 Subject: [PATCH] Cleanup: spelling in comments --- intern/cycles/blender/pointcloud.cpp | 2 +- intern/cycles/bvh/build.cpp | 4 +- intern/cycles/device/optix/device_impl.cpp | 6 +-- intern/cycles/kernel/types.h | 2 +- intern/ghost/intern/GHOST_SystemX11.cc | 12 ++--- source/blender/blenkernel/BKE_paint.h | 3 +- source/blender/blenkernel/BKE_pointcache.h | 30 ++++++----- source/blender/blenkernel/intern/mask.c | 2 +- .../intern/subdiv_displacement_multires.cc | 16 +++--- .../realtime_compositor/COM_operation.hh | 2 +- .../draw/engines/eevee_next/eevee_view.hh | 2 +- source/blender/editors/gpencil/gpencil_edit.c | 2 +- .../composite/nodes/node_composite_glare.cc | 53 ++++++++++--------- 13 files changed, 70 insertions(+), 66 deletions(-) diff --git a/intern/cycles/blender/pointcloud.cpp b/intern/cycles/blender/pointcloud.cpp index 8565dd0eead..f8b656ce688 100644 --- a/intern/cycles/blender/pointcloud.cpp +++ b/intern/cycles/blender/pointcloud.cpp @@ -244,7 +244,7 @@ static void export_pointcloud_motion(PointCloud *pointcloud, const int num_points = pointcloud->num_points(); /* Point cloud attributes are stored as float4 with the radius in the w element. - * This is explict now as float3 is no longer interchangeable with float4 as it + * This is explicit now as float3 is no longer interchangeable with float4 as it * is packed now. */ float4 *mP = attr_mP->data_float4() + motion_step * num_points; bool have_motion = false; diff --git a/intern/cycles/bvh/build.cpp b/intern/cycles/bvh/build.cpp index 83c54bed664..69fbb242bb6 100644 --- a/intern/cycles/bvh/build.cpp +++ b/intern/cycles/bvh/build.cpp @@ -1167,8 +1167,8 @@ BVHNode *BVHBuild::create_leaf_node(const BVHRange &range, const vector pipeline_groups; pipeline_groups.reserve(NUM_PROGRAM_GROUPS); if (kernel_features & KERNEL_FEATURE_NODE_RAYTRACE) { diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h index 2650ab753b9..1993b1f4f58 100644 --- a/intern/cycles/kernel/types.h +++ b/intern/cycles/kernel/types.h @@ -834,7 +834,7 @@ enum ShaderDataFlag { SD_NEED_VOLUME_ATTRIBUTES = (1 << 28), /* Shader has emission */ SD_HAS_EMISSION = (1 << 29), - /* Shader has raytracing */ + /* Shader has ray-tracing. */ SD_HAS_RAYTRACE = (1 << 30), /* Use back side for direct light sampling. */ SD_MIS_BACK = (1 << 31), diff --git a/intern/ghost/intern/GHOST_SystemX11.cc b/intern/ghost/intern/GHOST_SystemX11.cc index 19dfd717c04..744204004f2 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cc +++ b/intern/ghost/intern/GHOST_SystemX11.cc @@ -2157,7 +2157,7 @@ char *GHOST_SystemX11::getClipboard(bool selection) const Atom target = m_atom.UTF8_STRING; Window owner; - /* from xclip.c doOut() v0.11 */ + /* From `xclip.c` `doOut()` v0.11. */ char *sel_buf; ulong sel_len = 0; XEvent evt; @@ -2614,13 +2614,13 @@ static bool match_token(const char *haystack, const char *needle) /* Determining if an X device is a Tablet style device is an imperfect science. * We rely on common conventions around device names as well as the type reported - * by Wacom tablets. This code will likely need to be expanded for alternate tablet types + * by WACOM tablets. This code will likely need to be expanded for alternate tablet types * - * Wintab refers to any device that interacts with the tablet as a cursor, + * WINTAB refers to any device that interacts with the tablet as a cursor, * (stylus, eraser, tablet mouse, airbrush, etc) - * this is not to be confused with wacom x11 configuration "cursor" device. - * Wacoms x11 config "cursor" refers to its device slot (which we mirror with - * our gSysCursors) for puck like devices (tablet mice essentially). + * this is not to be confused with WACOM X11 configuration "cursor" device. + * WACOM tablets X11 configuration "cursor" refers to its device slot (which we mirror with + * our `gSysCursors`) for puck like devices (tablet mice essentially). */ static GHOST_TTabletMode tablet_mode_from_name(const char *name, const char *type) { diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 358537ee4fe..bd615886f38 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -524,7 +524,8 @@ typedef struct SculptAttribute { /* Sculpt usage */ SculptAttributeParams params; - /* Used to keep track of which preallocated SculptAttribute instances + /** + * Used to keep track of which pre-allocated SculptAttribute instances * inside of SculptSession.temp_attribute are used. */ bool used; diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index b9b46d3f245..a07ce3d16b2 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -119,14 +119,14 @@ typedef struct PTCacheID { unsigned int default_step; unsigned int max_step; - /* flags defined in DNA_object_force_types.h */ + /** flags defined in `DNA_object_force_types.h`. */ unsigned int data_types, info_types; - /* Copies point data to cache data. */ + /** Copies point data to cache data. */ int (*write_point)(int index, void *calldata, void **data, int cfra); - /* Copies cache data to point data. */ + /** Copies cache data to point data. */ void (*read_point)(int index, void *calldata, void **data, float cfra, const float *old_data); - /* Interpolated between previously read point data and cache data. */ + /** Interpolated between previously read point data and cache data. */ void (*interpolate_point)(int index, void *calldata, void **data, @@ -135,32 +135,34 @@ typedef struct PTCacheID { float cfra2, const float *old_data); - /* copies point data to cache data */ + /** Copies point data to cache data. */ int (*write_stream)(PTCacheFile *pf, void *calldata); - /* copies cache cata to point data */ + /** Copies cache data to point data. */ int (*read_stream)(PTCacheFile *pf, void *calldata); - /* copies custom extradata to cache data */ + /** Copies custom #PTCacheMem::extradata to cache data. */ void (*write_extra_data)(void *calldata, struct PTCacheMem *pm, int cfra); - /* copies custom extradata to cache data */ + /** Copies custom #PTCacheMem::extradata to cache data. */ void (*read_extra_data)(void *calldata, struct PTCacheMem *pm, float cfra); - /* copies custom extradata to cache data */ + /** Copies custom #PTCacheMem::extradata to cache data */ void (*interpolate_extra_data)( void *calldata, struct PTCacheMem *pm, float cfra, float cfra1, float cfra2); - /* Total number of simulated points - * (the cfra parameter is just for using same function pointer with totwrite). */ + /** + * Total number of simulated points + * (the `cfra` parameter is just for using same function pointer with `totwrite`). + */ int (*totpoint)(void *calldata, int cfra); - /* report error if number of points does not match */ + /** Report error if number of points does not match */ void (*error)(const struct ID *owner_id, void *calldata, const char *message); - /* number of points written for current cache frame */ + /** Number of points written for current cache frame. */ int (*totwrite)(void *calldata, int cfra); int (*write_header)(PTCacheFile *pf); int (*read_header)(PTCacheFile *pf); struct PointCache *cache; - /* used for setting the current cache from ptcaches list */ + /** Used for setting the current cache from `ptcaches` list. */ struct PointCache **cache_ptr; struct ListBase *ptcaches; } PTCacheID; diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index f3fbbfee227..45ab6289c14 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -139,7 +139,7 @@ static void mask_blend_read_data(BlendDataReader *reader, ID *id) BLO_read_list(reader, &mask->masklayers); LISTBASE_FOREACH (MaskLayer *, masklay, &mask->masklayers) { - /* can't use newdataadr since it's a pointer within an array */ + /* Can't use #newdataadr since it's a pointer within an array. */ MaskSplinePoint *act_point_search = NULL; BLO_read_list(reader, &masklay->splines); diff --git a/source/blender/blenkernel/intern/subdiv_displacement_multires.cc b/source/blender/blenkernel/intern/subdiv_displacement_multires.cc index 4868ed74fe0..016b9b9e171 100644 --- a/source/blender/blenkernel/intern/subdiv_displacement_multires.cc +++ b/source/blender/blenkernel/intern/subdiv_displacement_multires.cc @@ -37,13 +37,13 @@ struct MultiresDisplacementData { const MultiresModifierData *mmd; blender::OffsetIndices polys; const MDisps *mdisps; - /* Indexed by ptex face index, contains polygon/corner which corresponds + /* Indexed by PTEX face index, contains polygon/corner which corresponds * to it. * * NOTE: For quad polygon this is an index of first corner only, since - * there we only have one ptex. */ + * there we only have one PTEX. */ PolyCornerIndex *ptex_poly_corner; - /* Indexed by coarse face index, returns first ptex face index corresponding + /* Indexed by coarse face index, returns first PTEX face index corresponding * to that coarse face. */ int *face_ptex_offset; /* Sanity check, is used in debug builds. @@ -52,7 +52,7 @@ struct MultiresDisplacementData { }; /* Denotes which grid to use to average value of the displacement read from the - * grid which corresponds to the ptex face. */ + * grid which corresponds to the PTEX face. */ typedef enum eAverageWith { AVERAGE_WITH_NONE, AVERAGE_WITH_ALL, @@ -175,12 +175,12 @@ static void average_read_displacement_object(MultiresDisplacementData *data, { const PolyCornerIndex *poly_corner = &data->ptex_poly_corner[ptex_face_index]; const int num_corners = data->polys[poly_corner->poly_index].size(); - /* Get (u, v) coordinate within the other ptex face which corresponds to + /* Get (u, v) coordinate within the other PTEX face which corresponds to * the grid coordinates. */ float u, v; average_convert_grid_coord_to_ptex(num_corners, corner_index, grid_u, grid_v, &u, &v); /* Construct tangent matrix which corresponds to partial derivatives - * calculated for the other ptex face. */ + * calculated for the other PTEX face. */ float tangent_matrix[3][3]; average_construct_tangent_matrix( data->subdiv, num_corners, ptex_face_index, corner_index, u, v, tangent_matrix); @@ -208,7 +208,7 @@ static void average_get_other_ptex_and_corner(MultiresDisplacementData *data, start_ptex_face_index + *r_other_corner_index; } -/* NOTE: Grid coordinates are relatiev to the other grid already. */ +/* NOTE: Grid coordinates are relative to the other grid already. */ static void average_with_other(SubdivDisplacement *displacement, const int ptex_face_index, const int corner, @@ -380,7 +380,7 @@ static void displacement_data_init_mapping(SubdivDisplacement *displacement, con const int num_ptex_faces = count_num_ptex_faces(mesh); /* Allocate memory. */ data->ptex_poly_corner = static_cast( - MEM_malloc_arrayN(num_ptex_faces, sizeof(*data->ptex_poly_corner), "ptex poly corner")); + MEM_malloc_arrayN(num_ptex_faces, sizeof(*data->ptex_poly_corner), "PTEX poly corner")); /* Fill in offsets. */ int ptex_face_index = 0; PolyCornerIndex *ptex_poly_corner = data->ptex_poly_corner; diff --git a/source/blender/compositor/realtime_compositor/COM_operation.hh b/source/blender/compositor/realtime_compositor/COM_operation.hh index 1ca22719fbc..16c77bd1d22 100644 --- a/source/blender/compositor/realtime_compositor/COM_operation.hh +++ b/source/blender/compositor/realtime_compositor/COM_operation.hh @@ -172,7 +172,7 @@ class Operation { void release_inputs(); /* Release the results that were allocated in the execute method but are not actually needed. - * This can be the case if the execute method allocated a dummy texture for an unndeeded result, + * This can be the case if the execute method allocated a dummy texture for an unneeded result, * see the description of Result::allocate_texture() for more information. This is called after * the evaluation of the operation. */ void release_unneeded_results(); diff --git a/source/blender/draw/engines/eevee_next/eevee_view.hh b/source/blender/draw/engines/eevee_next/eevee_view.hh index ebee30f9394..df5fb5c2ed1 100644 --- a/source/blender/draw/engines/eevee_next/eevee_view.hh +++ b/source/blender/draw/engines/eevee_next/eevee_view.hh @@ -41,7 +41,7 @@ class ShadingView { /** Matrix to apply to the viewmat. */ const float4x4 &face_matrix_; - /** Raytracing persistent buffers. Only opaque and refraction can have surface tracing. */ + /** Ray-tracing persistent buffers. Only opaque and refraction can have surface tracing. */ // RaytraceBuffer rt_buffer_opaque_; // RaytraceBuffer rt_buffer_refract_; DepthOfFieldBuffer dof_buffer_; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 7035ba0e25c..f832ca337b2 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1714,7 +1714,7 @@ static int gpencil_strokes_paste_exec(bContext *C, wmOperator *op) * doesn't exist already depending on REC button status. */ - /* Multiframe paste. */ + /* Multi-frame paste. */ if (is_multiedit) { for (bGPDframe *gpf = init_gpf; gpf; gpf = gpf->next) { /* Active frame is copied later, so don't need duplicate the stroke here. */ diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.cc b/source/blender/nodes/composite/nodes/node_composite_glare.cc index 2b303957e73..e0c6213fe32 100644 --- a/source/blender/nodes/composite/nodes/node_composite_glare.cc +++ b/source/blender/nodes/composite/nodes/node_composite_glare.cc @@ -690,34 +690,34 @@ class GlareOperation : public NodeOperation { * Fog Glow Glare. * --------------- */ - /* Fog glow is computed by first progressively half-downsampling the highlights down to a certain - * size, then progressively double-upsampling the last downsampled result up to the original size - * of the highlights, adding the downsampled result of the same size in each upsampling step. - * This can be illustrated as follows: + /* Fog glow is computed by first progressively half-down-sampling the highlights down to a + * certain size, then progressively double-up-sampling the last down-sampled result up to the + * original size of the highlights, adding the down-sampled result of the same size in each + * up-sampling step. This can be illustrated as follows: * - * Highlights ---+---> Fog Glare + * Highlights ---+---> Fog Glare * | | - * Downsampled ---+---> Upsampled + * Down-sampled ---+---> Up-sampled * | | - * Downsampled ---+---> Upsampled + * Down-sampled ---+---> Up-sampled * | | - * Downsampled ---+---> Upsampled + * Down-sampled ---+---> Up-sampled * | ^ * ... | - * Downsampled ------------' + * Down-sampled ------------' * - * The smooth downsampling followed by smooth upsampling can be thought of as a cheap way to - * approximate a large radius blur, and adding the corresponding downsampled result while - * upsampling is done to counter the attenuation that happens during downsampling. + * The smooth down-sampling followed by smooth up-sampling can be thought of as a cheap way to + * approximate a large radius blur, and adding the corresponding down-sampled result while + * up-sampling is done to counter the attenuation that happens during down-sampling. * - * Smaller downsampled results contribute to larger glare size, so controlling the size can be - * done by stopping downsampling down to a certain size, where the maximum possible size is - * achieved when downsampling happens down to the smallest size of 2. */ + * Smaller down-sampled results contribute to larger glare size, so controlling the size can be + * done by stopping down-sampling down to a certain size, where the maximum possible size is + * achieved when down-sampling happens down to the smallest size of 2. */ Result execute_fog_glow(Result &highlights_result) { - /* The maximum possible glare size is achieved when we downsampled down to the smallest size of - * 2, which would result in a downsampling chain length of the binary logarithm of the smaller - * dimension of the size of the highlights. + /* The maximum possible glare size is achieved when we down-sampled down to the smallest size + * of 2, which would result in a down-sampling chain length of the binary logarithm of the + * smaller dimension of the size of the highlights. * * However, as users might want a smaller glare size, we reduce the chain length by the halving * count supplied by the user. */ @@ -729,7 +729,7 @@ class GlareOperation : public NodeOperation { Array downsample_chain = compute_fog_glow_downsample_chain(highlights_result, chain_length); - /* Notice that for a chain length of n, we need (n - 1) upsampling passes. */ + /* Notice that for a chain length of n, we need (n - 1) up-sampling passes. */ const IndexRange upsample_passes_range(chain_length - 1); GPUShader *shader = shader_manager().get("compositor_glare_fog_glow_upsample"); GPU_shader_bind(shader); @@ -754,11 +754,12 @@ class GlareOperation : public NodeOperation { return downsample_chain[0]; } - /* Progressively downsample the given result into a result with half the size for the given chain - * length, returning an array containing the chain of downsampled results. The first result of - * the chain is the given result itself for easier handling. The chain length is expected not - * to exceed the binary logarithm of the smaller dimension of the given result, because that - * would result in downsampling passes that produce useless textures with just one pixel. */ + /* Progressively down-sample the given result into a result with half the size for the given + * chain length, returning an array containing the chain of down-sampled results. The first + * result of the chain is the given result itself for easier handling. The chain length is + * expected not to exceed the binary logarithm of the smaller dimension of the given result, + * because that would result in down-sampling passes that produce useless textures with just + * one pixel. */ Array compute_fog_glow_downsample_chain(Result &highlights_result, int chain_length) { const Result downsampled_result = Result::Temporary(ResultType::Color, texture_pool()); @@ -772,9 +773,9 @@ class GlareOperation : public NodeOperation { GPUShader *shader; for (const int i : downsample_passes_range) { - /* For the first downsample pass, we use a special "Karis" downsample pass that applies a + /* For the first down-sample pass, we use a special "Karis" down-sample pass that applies a * form of local tone mapping to reduce the contributions of fireflies, see the shader for - * more information. Later passes use a simple average downsampling filter because fireflies + * more information. Later passes use a simple average down-sampling filter because fireflies * doesn't service the first pass. */ if (i == downsample_passes_range.first()) { shader = shader_manager().get("compositor_glare_fog_glow_downsample_karis_average");