Cleanup: spelling in comments

This commit is contained in:
Campbell Barton
2023-02-03 12:41:01 +11:00
parent 27e2b32a06
commit 266d8de687
19 changed files with 43 additions and 38 deletions

View File

@@ -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);

View File

@@ -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,

View File

@@ -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;

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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 \

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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;

View File

@@ -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 *

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)));
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}