From 266d8de6876cd1f2ae4624aedaacee93024e33f4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Feb 2023 12:41:01 +1100 Subject: [PATCH] Cleanup: spelling in comments --- intern/cycles/device/oneapi/device_impl.cpp | 2 +- .../blenkernel/intern/anim_visualization.c | 2 +- .../blender/blenkernel/intern/customdata.cc | 4 +-- source/blender/blenkernel/intern/main_idmap.c | 2 +- .../blender/blenkernel/intern/writeffmpeg.c | 26 +++++++++---------- source/blender/blenlib/intern/BLI_heap.c | 2 +- source/blender/blenlib/intern/mesh_boolean.cc | 2 +- .../blender/blenlib/intern/mesh_intersect.cc | 4 +-- .../bmesh/intern/bmesh_polygon_edgenet.h | 2 +- source/blender/bmesh/tools/bmesh_bevel.c | 5 +++- .../blender/bmesh/tools/bmesh_region_match.c | 2 +- .../blender/editors/object/object_vgroup.cc | 2 +- .../blender/gpu/intern/gpu_immediate_util.c | 4 +-- source/blender/modifiers/intern/MOD_skin.c | 2 +- source/blender/windowmanager/WM_types.h | 6 ++--- .../gizmo/intern/wm_gizmo_group_type.c | 5 ++-- .../gizmo/intern/wm_gizmo_type.c | 3 ++- source/blender/windowmanager/intern/wm_draw.c | 4 +-- .../windowmanager/intern/wm_operator_type.c | 2 +- 19 files changed, 43 insertions(+), 38 deletions(-) diff --git a/intern/cycles/device/oneapi/device_impl.cpp b/intern/cycles/device/oneapi/device_impl.cpp index 1915ffc862c..0aec8268bd5 100644 --- a/intern/cycles/device/oneapi/device_impl.cpp +++ b/intern/cycles/device/oneapi/device_impl.cpp @@ -377,7 +377,7 @@ void OneapiDevice::tex_alloc(device_texture &mem) generic_alloc(mem); generic_copy_to(mem); - /* Resize if needed. Also, in case of resize - allocate in advance for future allocs. */ + /* Resize if needed. Also, in case of resize - allocate in advance for future allocations. */ const uint slot = mem.slot; if (slot >= texture_info_.size()) { texture_info_.resize(slot + 128); diff --git a/source/blender/blenkernel/intern/anim_visualization.c b/source/blender/blenkernel/intern/anim_visualization.c index 799845cbce8..31335931704 100644 --- a/source/blender/blenkernel/intern/anim_visualization.c +++ b/source/blender/blenkernel/intern/anim_visualization.c @@ -128,7 +128,7 @@ bMotionPath *animviz_verify_motionpaths(ReportList *reports, dst = &ob->mpath; } - /* avoid 0 size allocs */ + /* Avoid 0 size allocations. */ if (avs->path_sf >= avs->path_ef) { BKE_reportf(reports, RPT_ERROR, diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index 227c1ee1bee..b71a705eecb 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -237,8 +237,8 @@ static void layerInterp_mdeformvert(const void **sources, const int count, void *dest) { - /* a single linked list of MDeformWeight's - * use this to avoid double allocs (which LinkNode would do) */ + /* A single linked list of #MDeformWeight's. + * use this to avoid double allocations (which #LinkNode would do). */ struct MDeformWeight_Link { struct MDeformWeight_Link *next; MDeformWeight dw; diff --git a/source/blender/blenkernel/intern/main_idmap.c b/source/blender/blenkernel/intern/main_idmap.c index 24c1da782fe..b280c962a39 100644 --- a/source/blender/blenkernel/intern/main_idmap.c +++ b/source/blender/blenkernel/intern/main_idmap.c @@ -57,7 +57,7 @@ struct IDNameLib_Map { struct GSet *valid_id_pointers; int idmap_types; - /* For storage of keys for the TypeMap ghash, avoids many single allocs. */ + /* For storage of keys for the #TypeMap #GHash, avoids many single allocations. */ BLI_mempool *type_maps_keys_pool; }; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index afb9f530d8e..be8f985ec56 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -469,18 +469,18 @@ static AVRational calc_time_base(uint den, double num, int codec_id) static const AVCodec *get_av1_encoder( FFMpegContext *context, RenderData *rd, AVDictionary **opts, int rectx, int recty) { - /* There are three possible encoders for AV1: libaom-av1, librav1e, and libsvtav1. librav1e tends - * to give the best compression quality while libsvtav1 tends to be the fastest encoder. One of - * each will be picked based on the preset setting, and if a particular encoder is not available, - * then use the default returned by FFMpeg. */ + /* There are three possible encoders for AV1: `libaom-av1`, librav1e, and `libsvtav1`. librav1e + * tends to give the best compression quality while `libsvtav1` tends to be the fastest encoder. + * One of each will be picked based on the preset setting, and if a particular encoder is not + * available, then use the default returned by FFMpeg. */ const AVCodec *codec = NULL; switch (context->ffmpeg_preset) { case FFM_PRESET_BEST: - /* libaom-av1 may produce better VMAF-scoring videos in serveral cases, but there are cases - * where using a different encoder is desireable, such as in T103849. */ + /* `libaom-av1` may produce better VMAF-scoring videos in several cases, but there are cases + * where using a different encoder is desirable, such as in T103849. */ codec = avcodec_find_encoder_by_name("librav1e"); if (!codec) { - /* Fallback to libaom-av1 if librav1e is not found. */ + /* Fallback to `libaom-av1` if librav1e is not found. */ codec = avcodec_find_encoder_by_name("libaom-av1"); } break; @@ -525,8 +525,8 @@ static const AVCodec *get_av1_encoder( break; } if (context->ffmpeg_crf >= 0) { - /* librav1e does not use -crf, but uses -qp in the range of 0-255. Calculates the roughly - * equivalent float, and truncates it to an integer. */ + /* librav1e does not use `-crf`, but uses `-qp` in the range of 0-255. + * Calculates the roughly equivalent float, and truncates it to an integer. */ unsigned int qp_value = ((float)context->ffmpeg_crf) * 255.0F / 51.0F; if (qp_value > 255) { qp_value = 255; @@ -540,7 +540,7 @@ static const AVCodec *get_av1_encoder( } else if (STREQ(codec->name, "libsvtav1")) { /* Set preset value based on ffmpeg_preset. - * Must check context->ffmpeg_preset again in case this encoder was selected due to the + * Must check `context->ffmpeg_preset` again in case this encoder was selected due to the * absence of another. */ switch (context->ffmpeg_preset) { case FFM_PRESET_REALTIME: @@ -555,13 +555,13 @@ static const AVCodec *get_av1_encoder( break; } if (context->ffmpeg_crf >= 0) { - /* libsvtav1 does not support crf until FFmpeg builds since 2022-02-24, use qp as fallback. - */ + /* `libsvtav1` does not support `crf` until FFmpeg builds since 2022-02-24, + * use `qp` as fallback. */ ffmpeg_dict_set_int(opts, "qp", context->ffmpeg_crf); } } else if (STREQ(codec->name, "libaom-av1")) { - /* Speed up libaom-av1 encoding by enabling multithreading and setting tiles. */ + /* Speed up libaom-av1 encoding by enabling multi-threading and setting tiles. */ ffmpeg_dict_set_int(opts, "row-mt", 1); const char *tiles_string = NULL; bool tiles_string_is_dynamic = false; diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 0bc50f62232..6ca881e5ab2 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -34,7 +34,7 @@ struct HeapNode_Chunk { * Number of nodes to include per #HeapNode_Chunk when no reserved size is passed, * or we allocate past the reserved number. * - * \note Optimize number for 64kb allocs. + * \note Optimize number for 64kb allocations. * \note keep type in sync with nodes_num in heap_node_alloc_chunk. */ #define HEAP_CHUNK_DEFAULT_NUM \ diff --git a/source/blender/blenlib/intern/mesh_boolean.cc b/source/blender/blenlib/intern/mesh_boolean.cc index 354f241a292..9de75de5ffa 100644 --- a/source/blender/blenlib/intern/mesh_boolean.cc +++ b/source/blender/blenlib/intern/mesh_boolean.cc @@ -1746,7 +1746,7 @@ static int find_containing_cell(const Vert *v, * (Adapted from #closest_on_tri_to_point_v3()). * The arguments ab, ac, ..., r are used as temporaries * in this routine. Passing them in from the caller can - * avoid many allocs and frees of temporary mpq3 values + * avoid many allocations and frees of temporary mpq3 values * and the mpq_class values within them. */ static mpq_class closest_on_tri_to_point(const mpq3 &p, diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index d4d86e678c5..7b82ee4e6cd 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -1147,7 +1147,7 @@ static int filter_plane_side(const double3 &p, * This works because the ratio of the projections of ab and ac onto n is the same as * the ratio along the line ab of the intersection point to the whole of ab. * The ab, ac, and dotbuf arguments are used as a temporaries; declaring them - * in the caller can avoid many allocs and frees of mpq3 and mpq_class structures. + * in the caller can avoid many allocations and frees of mpq3 and mpq_class structures. */ static inline mpq3 tti_interp( const mpq3 &a, const mpq3 &b, const mpq3 &c, const mpq3 &n, mpq3 &ab, mpq3 &ac, mpq3 &dotbuf) @@ -1167,7 +1167,7 @@ static inline mpq3 tti_interp( * order. This is the same as -oriented(a, b, c, a + ad), but uses fewer arithmetic operations. * TODO: change arguments to `const Vert *` and use floating filters. * The ba, ca, n, and dotbuf arguments are used as temporaries; declaring them - * in the caller can avoid many allocs and frees of mpq3 and mpq_class structures. + * in the caller can avoid many allocations and frees of mpq3 and mpq_class structures. */ static inline int tti_above(const mpq3 &a, const mpq3 &b, diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.h b/source/blender/bmesh/intern/bmesh_polygon_edgenet.h index 43da40d60af..e06760dbfad 100644 --- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.h +++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.h @@ -30,7 +30,7 @@ bool BM_face_split_edgenet(BMesh *bm, * * \param use_partial_connect: Support for handling islands connected by only a single edge, * \note that this is quite slow so avoid using where possible. - * \param mem_arena: Avoids many small allocs & should be cleared after each use. + * \param mem_arena: Avoids many small allocations & should be cleared after each use. * take care since \a edge_net_new is stored in \a r_edge_net_new. */ bool BM_face_split_edgenet_connect_islands(BMesh *bm, diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index 4215ec2b25b..36222ffa1f0 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -307,7 +307,10 @@ typedef struct BevelParams { GHash *vert_hash; /** Records new faces: key BMFace*, value one of {VERT/EDGE/RECON}_POLY. */ GHash *face_hash; - /** Use for all allocs while bevel runs. NOTE: If we need to free we can switch to mempool. */ + /** + * Use for all allocations while bevel runs. + * \note If we need to free we can switch to `BLI_mempool`. + */ MemArena *mem_arena; /** Profile vertex location and spacings. */ ProfileSpacing pro_spacing; diff --git a/source/blender/bmesh/tools/bmesh_region_match.c b/source/blender/bmesh/tools/bmesh_region_match.c index 8e971aeddb0..fe16c098c21 100644 --- a/source/blender/bmesh/tools/bmesh_region_match.c +++ b/source/blender/bmesh/tools/bmesh_region_match.c @@ -363,7 +363,7 @@ static UUID_Int bm_uuidwalk_calc_face_uuid(UUIDWalk *uuidwalk, BMFace *f) static void bm_uuidwalk_rehash_reserve(UUIDWalk *uuidwalk, uint rehash_store_len_new) { if (UNLIKELY(rehash_store_len_new > uuidwalk->cache.rehash_store_len)) { - /* avoid re-allocs */ + /* Avoid re-allocations. */ rehash_store_len_new *= 2; uuidwalk->cache.rehash_store = MEM_reallocN(uuidwalk->cache.rehash_store, rehash_store_len_new * diff --git a/source/blender/editors/object/object_vgroup.cc b/source/blender/editors/object/object_vgroup.cc index 0bb2a075e95..78a55aab5e9 100644 --- a/source/blender/editors/object/object_vgroup.cc +++ b/source/blender/editors/object/object_vgroup.cc @@ -1150,7 +1150,7 @@ static void vgroup_duplicate(Object *ob) MDeformVert *dv = dvert_array[i]; dw_org = BKE_defvert_find_index(dv, idg); if (dw_org) { - /* BKE_defvert_ensure_index re-allocs org so need to store the weight first */ + /* #BKE_defvert_ensure_index re-allocates org so need to store the weight first. */ const float weight = dw_org->weight; dw_cpy = BKE_defvert_ensure_index(dv, icdg); dw_cpy->weight = weight; diff --git a/source/blender/gpu/intern/gpu_immediate_util.c b/source/blender/gpu/intern/gpu_immediate_util.c index 1e4316619b1..b25fd04091a 100644 --- a/source/blender/gpu/intern/gpu_immediate_util.c +++ b/source/blender/gpu/intern/gpu_immediate_util.c @@ -355,9 +355,9 @@ static void imm_draw_circle_3D(GPUPrimType prim_type, if (i) { immVertex3f(pos, x + xr, y + yr, 0.0f); } - /* cos[(n + 1)a] = 2cos(a)cos(na) - cos[(n - 1)a]. */ + /* `cos[(n + 1)a] = 2cos(a)cos(na) - cos[(n - 1)a]`. */ const float xnext = alpha * xr - xprev; - /* sin[(n + 1)a] = 2cos(a)sin(na) - sin[(n - 1)a]. */ + /* `sin[(n + 1)a] = 2cos(a)sin(na) - sin[(n - 1)a]`. */ const float ynext = alpha * yr - yprev; xprev = xr; yprev = yr; diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index fa348dcb15e..e3fbd072f36 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -1370,7 +1370,7 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f } else if (split_face->len > 4) { /* Maintain a dynamic vert array containing the split_face's - * vertices, avoids frequent allocs in collapse_face_corners() */ + * vertices, avoids frequent allocations in #collapse_face_corners(). */ if (BLI_array_len(vert_buf) < split_face->len) { BLI_array_grow_items(vert_buf, (split_face->len - BLI_array_len(vert_buf))); } diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index e49441ed42a..b23b5c67b1f 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -588,13 +588,13 @@ typedef struct wmGesture { /** * customdata * - for border is a #rcti. - * - for circle is recti, (xmin, ymin) is center, xmax radius. + * - for circle is #rcti, (xmin, ymin) is center, xmax radius. * - for lasso is short array. - * - for straight line is a recti: (xmin,ymin) is start, (xmax, ymax) is end. + * - for straight line is a #rcti: (xmin, ymin) is start, (xmax, ymax) is end. */ void *customdata; - /** Free pointer to use for operator allocs (if set, its freed on exit). */ + /** Free pointer to use for operator allocations (if set, its freed on exit). */ wmGenericUserData user_data; } wmGesture; diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c index d5333c62f64..b3dfbe45b2f 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c @@ -125,11 +125,12 @@ wmGizmoGroupTypeRef *WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_typ } /** - * Free but don't remove from ghash. + * Free but don't remove from #GHash. */ static void gizmogrouptype_free(wmGizmoGroupType *gzgt) { - if (gzgt->rna_ext.srna) { /* python gizmo group, allocs own string */ + /* Python gizmo group, allocates it's own string. */ + if (gzgt->rna_ext.srna) { MEM_freeN((void *)gzgt->idname); } diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c index 7c9398732f7..f364fb7bff6 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c @@ -106,7 +106,8 @@ void WM_gizmotype_append_ptr(void (*gtfunc)(struct wmGizmoType *, void *), void void WM_gizmotype_free_ptr(wmGizmoType *gzt) { - if (gzt->rna_ext.srna) { /* python gizmo, allocs own string */ + /* Python gizmo, allocates it's own string. */ + if (gzt->rna_ext.srna) { MEM_freeN((void *)gzt->idname); } diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 15826af32fa..241c476faea 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -824,12 +824,12 @@ void wm_draw_region_blend(ARegion *region, int view, bool blend) alpha = 1.0f; } - /* Not the same layout as rectf/recti. */ + /* Not the same layout as #rctf/#rcti. */ const float rectt[4] = {rect_tex.xmin, rect_tex.ymin, rect_tex.xmax, rect_tex.ymax}; const float rectg[4] = {rect_geo.xmin, rect_geo.ymin, rect_geo.xmax, rect_geo.ymax}; if (blend) { - /* Regions drawn offscreen have premultiplied alpha. */ + /* Regions drawn off-screen have pre-multiplied alpha. */ GPU_blend(GPU_BLEND_ALPHA_PREMULT); } diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c index 7b3f32a2d92..d7a01419450 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.c +++ b/source/blender/windowmanager/intern/wm_operator_type.c @@ -187,7 +187,7 @@ static void operatortype_ghash_free_cb(wmOperatorType *ot) } if (ot->rna_ext.srna) { - /* python operator, allocs own string */ + /* A Python operator, allocates it's own string. */ MEM_freeN((void *)ot->idname); }