From 844cca998435b5e37b2d9c607c24efc21929d8e0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 20 Jan 2023 15:19:32 +1100 Subject: [PATCH] Cleanup: spelling in comments --- intern/cycles/scene/light.cpp | 4 ++-- source/blender/blenkernel/BKE_nla.h | 2 +- source/blender/blenkernel/BKE_node.h | 2 +- source/blender/blenkernel/intern/DerivedMesh.cc | 5 +++-- source/blender/blenkernel/intern/dynamicpaint.c | 12 ++++++------ source/blender/blenkernel/intern/particle.cc | 3 ++- source/blender/blenkernel/intern/softbody.c | 5 +++-- source/blender/blenlib/BLI_offset_indices.hh | 2 +- source/blender/bmesh/intern/bmesh_interp.c | 4 ++-- source/blender/draw/intern/draw_manager.c | 2 +- source/blender/editors/include/ED_view3d.h | 3 ++- source/blender/editors/include/UI_interface.h | 4 ++-- source/blender/editors/mesh/editmesh_utils.c | 2 +- source/blender/editors/physics/particle_object.c | 2 +- source/blender/editors/space_file/filelist.cc | 2 +- .../transform/transform_convert_armature.c | 2 +- source/blender/editors/uvedit/uvedit_islands.cc | 15 +++++---------- source/blender/editors/uvedit/uvedit_select.c | 6 +++--- .../blender/editors/uvedit/uvedit_smart_stitch.c | 2 +- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 4 ++-- source/blender/geometry/intern/trim_curves.cc | 2 +- .../windowmanager/intern/wm_event_system.cc | 2 +- 22 files changed, 43 insertions(+), 44 deletions(-) diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp index 92649563ebd..fa710e8b250 100644 --- a/intern/cycles/scene/light.cpp +++ b/intern/cycles/scene/light.cpp @@ -836,8 +836,8 @@ void LightManager::device_update_background(Device *device, if (sun_average_radiance > 0.0f) { /* The weighting here is just a heuristic that was empirically determined. * The sun's average radiance is much higher than the map's average radiance, - * but we don't want to weight the background light too much becaused - * visibility is not accounted for anyways. */ + * but we don't want to weight the background light too much because + * visibility is not accounted for anyway. */ background_light->set_average_radiance(0.8f * map_average_radiance + 0.2f * sun_average_radiance); } diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 3d304859e1b..dd558dc197c 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -298,7 +298,7 @@ void BKE_nlastrip_recalculate_bounds(struct NlaStrip *strip); void BKE_nlastrip_recalculate_bounds_sync_action(struct NlaStrip *strip); /** - * Recalculate the Blendin and Blendout values after a strip transform update. + * Recalculate the blend-in and blend-out values after a strip transform update. */ void BKE_nlastrip_recalculate_blend(struct NlaStrip *strip); diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index d2f4c6e3b6e..915ca87621a 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -360,7 +360,7 @@ typedef struct bNodeType { ExtensionRNA rna_ext; } bNodeType; -/* nodetype->nclass, for add-menu and themes */ +/** #bNodeType.nclass (for add-menu and themes). */ #define NODE_CLASS_INPUT 0 #define NODE_CLASS_OUTPUT 1 #define NODE_CLASS_OP_COLOR 3 diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc b/source/blender/blenkernel/intern/DerivedMesh.cc index 39a68b72d2a..565009fe08f 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.cc +++ b/source/blender/blenkernel/intern/DerivedMesh.cc @@ -1220,11 +1220,12 @@ static void editbmesh_calc_modifier_final_normals(Mesh *mesh_final, } } else { - /* Same as mesh_calc_modifiers. If using loop normals, poly nors have already been computed. */ + /* Same as #mesh_calc_modifiers. + * If using loop normals, poly normals have already been computed. */ BKE_mesh_ensure_normals_for_display(mesh_final); /* Some modifiers, like data-transfer, may generate those data, we do not want to keep them, - * as they are used by display code when available (i.e. even if autosmooth is disabled). */ + * as they are used by display code when available (i.e. even if auto-smooth is disabled). */ if (CustomData_has_layer(&mesh_final->ldata, CD_NORMAL)) { CustomData_free_layers(&mesh_final->ldata, CD_NORMAL, mesh_final->totloop); } diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 705e5d56f9b..eff08db9f46 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -922,7 +922,7 @@ static void surface_freeUnusedData(DynamicPaintSurface *surface) return; } - /* free bakedata if not active or surface is baked */ + /* Free bake-data if not active or surface is baked. */ if (!(surface->flags & MOD_DPAINT_ACTIVE) || (surface->pointcache && surface->pointcache->flag & PTCACHE_BAKED)) { free_bakeData(surface->data); @@ -1071,7 +1071,7 @@ DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSettings *c BKE_modifier_path_init( surface->image_output_path, sizeof(surface->image_output_path), "cache_dynamicpaint"); - /* Using ID_BRUSH i18n context, as we have no physics/dpaint one for now... */ + /* Using ID_BRUSH i18n context, as we have no physics/dynamic-paint one for now. */ dynamicPaintSurface_setUniqueName(surface, CTX_DATA_(BLT_I18NCONTEXT_ID_BRUSH, "Surface")); surface->effector_weights = BKE_effector_add_weights(NULL); @@ -5067,7 +5067,7 @@ static void dynamic_paint_prepare_effect_cb(void *__restrict userdata, /* if global gravity is enabled, add it too */ if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) { - /* also divide by 10 to about match default grav + /* also divide by 10 to about match default gravity * with default force strength (1.0). */ madd_v3_v3fl(forc, scene->physics_settings.gravity, @@ -5139,9 +5139,9 @@ static int dynamicPaint_prepareEffectStep(struct Depsgraph *depsgraph, } /* Get number of required steps using average point distance - * so that just a few ultra close pixels won't increase substeps to max. */ + * so that just a few ultra close pixels won't increase sub-steps to max. */ - /* adjust number of required substep by fastest active effect */ + /* Adjust number of required sub-step by fastest active effect. */ if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD) { spread_speed = surface->spread_speed; } @@ -5811,7 +5811,7 @@ static void dynamic_paint_surface_pre_step_cb(void *__restrict userdata, pPoint->state = DPAINT_PAINT_WET; } - /* in case of just dryed paint, just mix it to the dry layer and mark it empty */ + /* In case of just dried paint, just mix it to the dry layer and mark it empty. */ else if (pPoint->state > 0) { float f_color[4]; blendColors(pPoint->color, pPoint->color[3], pPoint->e_color, pPoint->e_color[3], f_color); diff --git a/source/blender/blenkernel/intern/particle.cc b/source/blender/blenkernel/intern/particle.cc index 296ef405da2..99dfd7fe138 100644 --- a/source/blender/blenkernel/intern/particle.cc +++ b/source/blender/blenkernel/intern/particle.cc @@ -3513,7 +3513,8 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_re } } - /* lattices have to be calculated separately to avoid mixups between effector calculations */ + /* Lattices have to be calculated separately to avoid mix-ups between effector calculations. + */ if (psys->lattice_deform_data) { for (k = 0, ca = cache[p]; k <= segments; k++, ca++) { BKE_lattice_deform_data_eval_co( diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index b322a0a803d..83b5fd45d2f 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -2550,11 +2550,12 @@ static void softbody_swap_state(Object *ob, float *ppos, float *pvel) } #endif -/* care for bodypoints taken out of the 'ordinary' solver step +/** + * Care for body-points taken out of the 'ordinary' solver step * because they are screwed to goal by bolts * they just need to move along with the goal in time * we need to adjust them on sub frame timing in solver - * so now when frame is done .. put 'em to the position at the end of frame + * so now when frame is done .. put them to the position at the end of frame. */ static void softbody_apply_goalsnap(Object *ob) { diff --git a/source/blender/blenlib/BLI_offset_indices.hh b/source/blender/blenlib/BLI_offset_indices.hh index 9685266e687..4ae2bde3705 100644 --- a/source/blender/blenlib/BLI_offset_indices.hh +++ b/source/blender/blenlib/BLI_offset_indices.hh @@ -70,7 +70,7 @@ template class OffsetIndices { } /** - * Return a subset of the offsets desribing the specified range of source elements. + * Return a subset of the offsets describing the specified range of source elements. * This is a slice into the source ranges rather than the indexed elements described by the * offset values. */ diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index f96fc734fbc..16db91595ec 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -875,8 +875,8 @@ void BM_uv_map_ensure_select_and_pin_attrs(BMesh *bm) { const int nr_uv_layers = CustomData_number_of_layers(&bm->ldata, CD_PROP_FLOAT2); for (int l = 0; l < nr_uv_layers; l++) { - /* NOTE: you can't re-use the returnvalue of CustomData_get_layer_name() because adding layers - * can invalidate that. */ + /* NOTE: you can't re-use the return-value of #CustomData_get_layer_name() + * because adding layers can invalidate that. */ char name[MAX_CUSTOMDATA_LAYER_NAME]; BM_data_layer_ensure_named( bm, diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 43a2e89b989..0cb89d94d41 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -2246,7 +2246,7 @@ void DRW_draw_render_loop_2d_ex(struct Depsgraph *depsgraph, drw_engines_draw_scene(); - /* Fix 3D view being "laggy" on macos and win+nvidia. (See T56996, T61474) */ + /* Fix 3D view being "laggy" on MACOS and MS-Windows+NVIDIA. (See T56996, T61474) */ if (GPU_type_matches_ex(GPU_DEVICE_ANY, GPU_OS_ANY, GPU_DRIVER_ANY, GPU_BACKEND_OPENGL)) { GPU_flush(); } diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 3526db5cb35..def080b267e 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -75,7 +75,8 @@ typedef struct ViewContext { typedef struct ViewDepths { unsigned short w, h; - short x, y; /* only for temp use for sub-rects, added to region->winx/y */ + /* only for temp use for sub-rectangles, added to `region->winx/winy`. */ + short x, y; float *depths; double depth_range[2]; } ViewDepths; diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index cdc41ef2183..108f8e46966 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -394,7 +394,7 @@ typedef enum { UI_BTYPE_SEPR_LINE = 55 << 9, /** Dynamically fill available space. */ UI_BTYPE_SEPR_SPACER = 56 << 9, - /** Resize handle (resize uilist). */ + /** Resize handle (resize UI-list). */ UI_BTYPE_GRIP = 57 << 9, UI_BTYPE_DECORATOR = 58 << 9, /* An item a view (see #ui::AbstractViewItem). */ @@ -459,7 +459,7 @@ void UI_draw_safe_areas(uint pos, const float title_aspect[2], const float action_aspect[2]); -/** State for scrolldrawing. */ +/** State for scroll-drawing. */ enum { UI_SCROLL_PRESSED = 1 << 0, UI_SCROLL_ARROWS = 1 << 1, diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 764344fbd68..27a43ab93a0 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -887,7 +887,7 @@ static void bm_uv_build_islands(UvElementMap *element_map, MEM_SAFE_FREE(map); } -/* return true if `loop` has UV co-ordinates which match `luv_a` and `luv_b` */ +/** Return true if `loop` has UV co-ordinates which match `luv_a` and `luv_b`. */ static bool loop_uv_match(BMLoop *loop, const float luv_a[2], const float luv_b[2], diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 58ed94fdbb8..8c26b9caf91 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -415,7 +415,7 @@ void PARTICLE_OT_dupliob_refresh(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/************************ move up particle dupliweight operator *********************/ +/************************ move up particle dupli-weight operator *********************/ static int dupliob_move_up_exec(bContext *C, wmOperator *UNUSED(op)) { diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc index 7a982914878..57a4c5c052a 100644 --- a/source/blender/editors/space_file/filelist.cc +++ b/source/blender/editors/space_file/filelist.cc @@ -3876,7 +3876,7 @@ static void filelist_readjob_all_asset_library(FileListReadJob *job_params, filelist_readjob_main_assets_add_items(job_params, stop, do_update, progress); - /* When only doing partialy reload for main data, we're done. */ + /* When only doing partially reload for main data, we're done. */ if (job_params->only_main_data) { return; } diff --git a/source/blender/editors/transform/transform_convert_armature.c b/source/blender/editors/transform/transform_convert_armature.c index d3bebfe8c72..31d0dea3b96 100644 --- a/source/blender/editors/transform/transform_convert_armature.c +++ b/source/blender/editors/transform/transform_convert_armature.c @@ -864,7 +864,7 @@ static void createTransPose(bContext *UNUSED(C), TransInfo *t) } } - /* initialize initial auto=ik chainlen's? */ + /* Initialize initial auto=IK chain-length's? */ if (t->flag & T_AUTOIK) { transform_autoik_update(t, 0); } diff --git a/source/blender/editors/uvedit/uvedit_islands.cc b/source/blender/editors/uvedit/uvedit_islands.cc index 2d1db757fb5..612d173772e 100644 --- a/source/blender/editors/uvedit/uvedit_islands.cc +++ b/source/blender/editors/uvedit/uvedit_islands.cc @@ -336,14 +336,13 @@ static bool bm_loop_uv_shared_edge_check(const BMLoop *l_a, const BMLoop *l_b, v } /** - * returns true if `BMFace *efa` is able to be affected by a packing operation, given various - * parameters. + * Returns true if `efa` is able to be affected by a packing operation, given various parameters. * * Checks if it's (not) hidden, and optionally selected, and/or UV selected. * * Will eventually be superseded by `BM_uv_element_map_create()`. * - * Loosely based on`uvedit_is_face_affected`, but "bug-compatible" with previous code. + * Loosely based on `uvedit_is_face_affected`, but "bug-compatible" with previous code. */ static bool uvedit_is_face_affected_for_calc_uv_islands(const Scene *scene, BMFace *efa, @@ -462,8 +461,7 @@ static float pack_islands_margin_fraction(const blender::Vector &i * First, use a robust search procedure to bracket the root within a factor of 10. * Then, use a modified-secant method to converge. * - * This is a specialized solver using domain knowledge to accelerate convergence. - */ + * This is a specialized solver using domain knowledge to accelerate convergence. */ float scale_low = 0.0f; float value_low = 0.0f; @@ -570,11 +568,8 @@ static float calc_margin_from_aabb_length_sum(const blender::Vectorbounds_rect); diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c index dc68b2c6475..7595577e160 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -4399,13 +4399,13 @@ static int uv_select_overlap(bContext *C, const bool extend) copy_v2_v2(uv_verts[vert_index], luv); } - /* The winding order of the coordinates is not guaranteed, determine it automatically. */ + /* The UV coordinates winding could be positive of negative, + * determine it automatically. */ const int coords_sign = 0; BLI_polyfill_calc_arena(uv_verts, face_len, coords_sign, indices, arena); /* A beauty fill is necessary to remove degenerate triangles that may be produced from the - * above polyfill (see T103913), otherwise the overlap tests can fail. - */ + * above poly-fill (see T103913), otherwise the overlap tests can fail. */ BLI_polyfill_beautify(uv_verts, face_len, indices, arena, heap); for (int t = 0; t < tri_len; t++) { diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 7a05ffafbcb..189ba7575f5 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -949,7 +949,7 @@ static int stitch_process_data(StitchStateContainer *ssc, bool is_active_state = (state == ssc->states[ssc->active_object_index]); char stitch_midpoints = ssc->midpoints; - /* used to map uv indices to uvaverage indices for selection */ + /* Used to map UV indices to UV-average indices for selection. */ uint *uvfinal_map = NULL; /* per face preview position in preview buffer */ PreviewPosition *preview_position = NULL; diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index e5b3d8998c0..8cd4445d0ff 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -595,10 +595,10 @@ static ParamHandle *construct_param_handle_subsurfed(const Scene *scene, /* Modifier initialization data, will control what type of subdivision will happen. */ SubsurfModifierData smd = {{NULL}}; - /* holds a map to editfaces for every subsurfed MFace. + /* Holds a map to edit-faces for every subdivision-surface polygon. * These will be used to get hidden/ selected flags etc. */ BMFace **faceMap; - /* similar to the above, we need a way to map edges to their original ones */ + /* Similar to the above, we need a way to map edges to their original ones. */ BMEdge **edgeMap; const BMUVOffsets offsets = BM_uv_map_get_offsets(em->bm); diff --git a/source/blender/geometry/intern/trim_curves.cc b/source/blender/geometry/intern/trim_curves.cc index b7faf54bdc5..82b8199a168 100644 --- a/source/blender/geometry/intern/trim_curves.cc +++ b/source/blender/geometry/intern/trim_curves.cc @@ -527,7 +527,7 @@ static void sample_interval_bezier(const Span src_positions, start_point_insert.position, parameter); - /* Update startpoint handle. */ + /* Update start-point handle. */ dst_handles_l[dst_range.first()] = end_point_insert.handle_next; } else { diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index 9004bfc0e4b..bf549cd00c9 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -5591,7 +5591,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void } else if (event.keymodifier == EVT_UNKNOWNKEY) { /* This case happens with an external number-pad, and also when using 'dead keys' - * (to compose complex latin characters e.g.), it's not really clear why. + * (to compose complex Latin characters e.g.), it's not really clear why. * Since it's impossible to map a key modifier to an unknown key, * it shouldn't harm to clear it. */ event_state->keymodifier = event.keymodifier = 0;