Cleanup: spelling in comments

This commit is contained in:
Campbell Barton
2023-07-15 15:45:06 +10:00
parent cf95198491
commit 3889baab4f
32 changed files with 76 additions and 62 deletions

View File

@@ -120,7 +120,7 @@ MetalDevice::MetalDevice(const DeviceInfo &info, Stats &stats, Profiler &profile
}
if (device_vendor == METAL_GPU_APPLE) {
/* Set kernel_specialization_level based on user prefs. */
/* Set kernel_specialization_level based on user preferences. */
switch (info.kernel_optimization_level) {
case KERNEL_OPTIMIZATION_LEVEL_OFF:
kernel_specialization_level = PSO_GENERIC;

View File

@@ -48,7 +48,7 @@ ccl_device_inline bool point_light_sample(const ccl_global KernelLight *klight,
if (r_sq == 0) {
/* Use intensity instead of radiance for point light. */
ls->eval_fac /= sqr(ls->t);
/* `ls->Ng` is not well-defined for point light, so use the incoming direction instead. */
/* `ls->Ng` is not well-defined for point light, so use the incoming direction instead. */
ls->Ng = -ls->D;
}
else {

View File

@@ -458,7 +458,7 @@ void LightTree::recursive_build(const Child child,
if (should_split(emitters, start, middle, end, node->measure, node->light_link, split_dim)) {
if (split_dim != -1) {
/* Partition the emitters between start and end based on the centroids. */
/* Partition the emitters between start and end based on the centroids. */
std::nth_element(emitters + start,
emitters + middle,
emitters + end,

View File

@@ -465,8 +465,8 @@ GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(int32_t x, int32_t y)
GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys &keys) const
{
/* `GetAsyncKeyState` returns the current interrupt-level state of the hardware, which is needed
* when passing key states to a newly-activated window - #40059. Alterative `GetKeyState` only
* returns the state as processed by the thread's message queue. */
* when passing key states to a newly-activated window - #40059. Alternative `GetKeyState` only
* returns the state as processed by the thread's message queue. */
bool down = HIBYTE(::GetAsyncKeyState(VK_LSHIFT)) != 0;
keys.set(GHOST_kModifierKeyLeftShift, down);
down = HIBYTE(::GetAsyncKeyState(VK_RSHIFT)) != 0;

View File

@@ -1139,7 +1139,7 @@ static void frame_handle_commit(libdecor_frame * /*frame*/, void *data)
# endif
}
/* NOTE: cannot be `const` because of the LIBDECOR API. */
/* NOTE: cannot be `const` because of the LIBDECOR API. */
static libdecor_frame_interface libdecor_frame_iface = {
frame_handle_configure,
frame_handle_close,

View File

@@ -160,7 +160,7 @@ enum {
G_FLAG_USERPREF_NO_SAVE_ON_EXIT = (1 << 4),
G_FLAG_SCRIPT_AUTOEXEC = (1 << 13),
/** When this flag is set ignore the prefs #USER_SCRIPT_AUTOEXEC_DISABLE. */
/** When this flag is set ignore the preferences #USER_SCRIPT_AUTOEXEC_DISABLE. */
G_FLAG_SCRIPT_OVERRIDE_PREF = (1 << 14),
G_FLAG_SCRIPT_AUTOEXEC_FAIL = (1 << 15),
G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET = (1 << 16),

View File

@@ -1307,7 +1307,7 @@ bool BKE_blendfile_userdef_write_all(ReportList *reports)
if (use_template_userpref) {
if ((cfgdir = BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, U.app_template))) {
/* Also save app-template prefs */
/* Also save app-template preferences. */
BLI_path_join(filepath, sizeof(filepath), cfgdir, BLENDER_USERPREF_FILE);
printf("Writing userprefs app-template: \"%s\" ", filepath);

View File

@@ -4414,10 +4414,10 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
do_versions_rename_id(bmain, ID_BR, "Draw Weight", "Weight Draw");
}
/* fcm->name was never used to store modifier name so it has always been an empty string. Now
* this property supports name editing. So assign value to name variable of Fmodifier otherwise
* modifier interface would show an empty name field. Also ensure uniqueness when opening old
* files. */
/* `fcm->name` was never used to store modifier name so it has always been an empty string.
* Now this property supports name editing. So assign value to name variable of F-modifier
* otherwise modifier interface would show an empty name field.
* Also ensure uniqueness when opening old files. */
if (!MAIN_VERSION_ATLEAST(bmain, 306, 7)) {
LISTBASE_FOREACH (bAction *, act, &bmain->actions) {
LISTBASE_FOREACH (FCurve *, fcu, &act->curves) {

View File

@@ -353,7 +353,7 @@ void Instance::render_read_result(RenderLayer *render_layer, const char *view_na
if (result) {
BLI_mutex_lock(&render->update_render_passes_mutex);
/* WORKAROUND: We use texture read to avoid using a framebuffer to get the render result.
/* WORKAROUND: We use texture read to avoid using a frame-buffer to get the render result.
* However, on some implementation, we need a buffer with a few extra bytes for the read to
* happen correctly (see GLTexture::read()). So we need a custom memory allocation. */
/* Avoid memcpy(), replace the pointer directly. */
@@ -376,7 +376,7 @@ void Instance::render_read_result(RenderLayer *render_layer, const char *view_na
if (result) {
BLI_mutex_lock(&render->update_render_passes_mutex);
/* WORKAROUND: We use texture read to avoid using a framebuffer to get the render result.
/* WORKAROUND: We use texture read to avoid using a frame-buffer to get the render result.
* However, on some implementation, we need a buffer with a few extra bytes for the read to
* happen correctly (see GLTexture::read()). So we need a custom memory allocation. */
/* Avoid memcpy(), replace the pointer directly. */

View File

@@ -106,9 +106,9 @@ class ReflectionProbeModule {
int3 dispatch_probe_pack_ = int3(0);
/**
* Texture containing a cubemap where the probe should be rendering to.
* Texture containing a cube-map where the probe should be rendering to.
*
* NOTE: TextureFromPool doesn't support cubemaps.
* NOTE: TextureFromPool doesn't support cube-maps.
*/
Texture cubemap_tx_ = {"Probe.Cubemap"};
int reflection_probe_index_ = 0;

View File

@@ -2639,7 +2639,7 @@ static int animchannels_clean_empty_exec(bContext *C, wmOperator * /*op*/)
action_empty = true;
}
else {
/* TODO: check for keyframe + fmodifier data on these too */
/* TODO: check for keyframe + F-modifier data on these too. */
}
/* 2) No NLA Tracks and/or NLA Strips */

View File

@@ -90,7 +90,7 @@ IndexMask end_points(const bke::CurvesGeometry &curves,
* Return a mask of random points or curves.
*
* \param random_seed: The seed for the \a RandomNumberGenerator.
* \param probability: Determins how likely a point/curve will be chosen. If set to 0.0, nothing
* \param probability: Determines how likely a point/curve will be chosen. If set to 0.0, nothing
* will be in the mask, if set to 1.0 everything will be in the mask.
*/
IndexMask random_mask(const bke::CurvesGeometry &curves,

View File

@@ -6759,8 +6759,7 @@ void uiTemplateNodeSocket(uiLayout *layout, bContext * /*C*/, float color[4])
/* XXX using explicit socket colors is not quite ideal.
* Eventually it should be possible to use theme colors for this purpose,
* but this requires a better design for extendable color palettes in user prefs.
*/
* but this requires a better design for extendable color palettes in user preferences. */
uiBut *but = uiDefBut(
block, UI_BTYPE_NODE_SOCKET, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, nullptr, 0, 0, 0, 0, "");
rgba_float_to_uchar(but->col, color);

View File

@@ -691,7 +691,7 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
printf("%s: set screen\n", __func__);
}
screen->do_refresh = false;
/* prevent multiwin errors */
/* Prevent multi-window errors. */
screen->winid = win->winid;
screen->context = reinterpret_cast<void *>(ed_screen_context);

View File

@@ -176,7 +176,9 @@ static MDeformVert *defweight_prev_init(MDeformVert *dvert_prev,
return dv_prev;
}
/* vpaint has 'vpaint_blend' */
/**
* VPaint has 'vpaint_blend'
*/
static float wpaint_blend(const VPaint *wp,
float weight,
const float alpha,

View File

@@ -1288,7 +1288,7 @@ ID *buttons_context_id_path(const bContext *C)
for (int i = path->len - 1; i >= 0; i--) {
PointerRNA *ptr = &path->ptr[i];
/* Pin particle settings instead of system, since only settings are an idblock. */
/* Pin particle settings instead of system, since only settings are an ID-block. */
if (sbuts->mainb == BCONTEXT_PARTICLE && sbuts->flag & SB_PIN_CONTEXT) {
if (ptr->type == &RNA_ParticleSystem && ptr->data) {
ParticleSystem *psys = static_cast<ParticleSystem *>(ptr->data);

View File

@@ -328,7 +328,8 @@ static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event)
is_relative = false;
}
/* Annoying exception!, if we're dealing with the user prefs, default relative to be off. */
/* Annoying exception!, if we're dealing with the user preferences,
* default relative to be off. */
RNA_property_boolean_set(op->ptr, prop_relpath, is_relative);
}
}

View File

@@ -2387,7 +2387,7 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator * /*op*/, const wmEv
/* if we are not editing, we are done */
if (edit_idx == -1) {
/* Do not invalidate timer if filerename is still pending,
/* Do not invalidate timer if file-rename is still pending,
* we might still be building the filelist and yet have to find edited entry. */
if (params->rename_flag == 0) {
file_params_smoothscroll_timer_clear(wm, win, sfile);

View File

@@ -712,7 +712,7 @@ void ED_fileselect_params_to_userdef(SpaceFile *sfile,
sfile_udata_new->temp_win_sizey = temp_win_size[1];
}
/* Tag prefs as dirty if something has changed. */
/* Tag preferences as dirty if something has changed. */
if (memcmp(sfile_udata_new, &sfile_udata_old, sizeof(sfile_udata_old)) != 0) {
U.runtime.is_dirty = true;
}

View File

@@ -1140,7 +1140,7 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn
* by sampling it at various small-intervals over the visible region
*/
if (adt) {
/** We have to do this mapping dance since the keyframes were remapped but the Fmodifier
/* We have to do this mapping dance since the keyframes were remapped but the F-modifier
* evaluations are not.
*
* So we undo the keyframe remapping and instead remap the evaluation time when drawing the

View File

@@ -227,7 +227,7 @@ void GRAPH_OT_previewrange_set(wmOperatorType *ot)
/* API callbacks */
ot->exec = graphkeys_previewrange_exec;
/* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier. */
/* XXX: unchecked poll to get F-samples working too, but makes modifier damage trickier. */
ot->poll = ED_operator_graphedit_active;
/* Flags */
@@ -307,7 +307,7 @@ void GRAPH_OT_view_all(wmOperatorType *ot)
/* API callbacks */
ot->exec = graphkeys_viewall_exec;
/* XXX: Unchecked poll to get fsamples working too, but makes modifier damage trickier... */
/* XXX: Unchecked poll to get F-samples working too, but makes modifier damage trickier. */
ot->poll = ED_operator_graphedit_active;
/* Flags */

View File

@@ -1901,7 +1901,7 @@ static ImageSaveData *image_save_as_init(bContext *C, wmOperator *op)
RNA_boolean_set(op->ptr, "save_as_render", isd->opts.save_as_render);
}
/* Show multiview save options only if image has multiviews. */
/* Show multi-view save options only if image has multi-views. */
PropertyRNA *prop;
prop = RNA_struct_find_property(op->ptr, "show_multiview");
RNA_property_boolean_set(op->ptr, prop, BKE_image_is_multiview(image));

View File

@@ -208,7 +208,7 @@ void sequencer_preview_add_sound(const bContext *C, Sequence *seq)
return;
}
}
else { /* There's no existig preview job. */
else { /* There's no existing preview job. */
pj = MEM_cnew<PreviewJob>("preview rebuild job");
pj->mutex = BLI_mutex_alloc();

View File

@@ -62,26 +62,32 @@ struct View3DCameraControl {
/* -------------------------------------------------------------------- */
/* initial values */
/* root most parent */
/** Root most parent. */
Object *root_parent;
/* backup values */
float dist_backup;
/* backup the views distance since we use a zero dist for fly mode */
float ofs_backup[3];
/* backup the views offset in case the user cancels flying in non camera mode */
/* Backup values. */
/* backup the views quat in case the user cancels flying in non camera mode. */
/** Backup the views distance since we use a zero dist for fly mode. */
float dist_backup;
/** Backup the views offset in case the user cancels flying in non camera mode. */
float ofs_backup[3];
/** Backup the views quaternion in case the user cancels flying in non camera mode. */
float rot_backup[4];
/* remember if we're ortho or not, only used for restoring the view if it was a ortho view */
/**
* Remember if we're orthographic or not,
* only used for restoring the view if it was a orthographic view.
*/
char persp_backup;
/* are we flying an ortho camera in perspective view,
* which was originally in ortho view?
* could probably figure it out but better be explicit */
/**
* True when flying an orthographic camera in perspective view,
* which was originally in orthographic view.
* This could be detected available data but better be explicit.
*/
bool is_ortho_cam;
/* backup the objects transform */
/** Backup the objects transform. */
void *obtfm;
};

View File

@@ -218,7 +218,7 @@ static void set_prop_dist(TransInfo *t, const bool with_dist)
TransData *td = tc->data;
for (a = 0; a < tc->data_len; a++, td++) {
if (td->flag & TD_SELECTED) {
/* Initialize, it was mallocced. */
/* Initialize, it was malloced. */
float vec[3];
td->rdist = 0.0f;

View File

@@ -132,7 +132,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *r_count, int *r_flag)
/* Count */
/* Non nested strips (resect selection and handles) */
/* Non nested strips (reset selection and handles). */
if ((seq->flag & SELECT) == 0 || SEQ_transform_is_locked(channels, seq)) {
*r_count = 0;
*r_flag = 0;

View File

@@ -145,38 +145,44 @@ enum {
TD_NOTCONNECTED = 1 << 2,
/** Used for scaling of #MetaElem.rad */
TD_SINGLESIZE = 1 << 3,
/** Scale relative to individual element center */
/** Scale relative to individual element center. */
TD_INDIVIDUAL_SCALE = 1 << 4,
TD_NOCENTER = 1 << 5,
/** #TransData.ext abused for particle key timing. */
TD_NO_EXT = 1 << 6,
/** don't transform this data */
/** Don't transform this data. */
TD_SKIP = 1 << 7,
/** if this is a bez triple, we need to restore the handles,
* if this is set #TransData.hdata needs freeing */
/**
* If this is a bezier triple, we need to restore the handles,
* if this is set #TransData.hdata needs freeing.
*/
TD_BEZTRIPLE = 1 << 8,
/** when this is set, don't apply translation changes to this element */
TD_NO_LOC = 1 << 9,
/** For Graph Editor auto-snap, indicates that point should not undergo auto-snapping. */
TD_NOTIMESNAP = 1 << 10,
/** For Graph Editor - curves that can only have int-values
* need their keyframes tagged with this. */
/**
* For Graph Editor - curves that can only have int-values
* need their keyframes tagged with this.
*/
TD_INTVALUES = 1 << 11,
#define TD_MIRROR_AXIS_SHIFT 12
/** For editmode mirror. */
/** For edit-mode mirror. */
TD_MIRROR_X = 1 << 12,
TD_MIRROR_Y = 1 << 13,
TD_MIRROR_Z = 1 << 14,
#define TD_MIRROR_EDGE_AXIS_SHIFT 12
/** For editmode mirror, clamp axis to 0 */
/** For edit-mode mirror, clamp axis to 0. */
TD_MIRROR_EDGE_X = 1 << 12,
TD_MIRROR_EDGE_Y = 1 << 13,
TD_MIRROR_EDGE_Z = 1 << 14,
/** For fcurve handles, move them along with their keyframes */
/** For F-curve handles, move them along with their keyframes. */
TD_MOVEHANDLE1 = 1 << 15,
TD_MOVEHANDLE2 = 1 << 16,
/** Exceptional case with pose bone rotating when a parent bone has 'Local Location'
* option enabled and rotating also transforms it. */
/**
* Exceptional case with pose bone rotating when a parent bone has 'Local Location'
* option enabled and rotating also transforms it.
*/
TD_PBONE_LOCAL_MTX_P = 1 << 17,
/** Same as above but for a child bone. */
TD_PBONE_LOCAL_MTX_C = 1 << 18,

View File

@@ -392,7 +392,7 @@ void split_edges(Mesh &mesh,
MutableSpan<int> corner_verts = mesh.corner_verts_for_write();
/* Calculate vertex fans by reordering the vertex to edge maps. Fans are the the ordered
* groups of consecutive edges between consecutive faces looping around a vertex. */
* groups of consecutive edges between consecutive faces looping around a vertex. */
Array<Vector<int>> vertex_fan_sizes(mesh.totvert);
threading::parallel_for(IndexRange(mesh.totvert), 512, [&](IndexRange range) {
for (const int vert : range) {

View File

@@ -67,7 +67,7 @@ void MTLIndexBuf::read(uint32_t *data) const
MTLContext *ctx = MTLContext::get();
BLI_assert(ctx);
/* Ensure data is flushed for host caches. */
/* Ensure data is flushed for host caches. */
id<MTLBuffer> source_buffer = ibo_->get_metal_buffer();
if (source_buffer.storageMode == MTLStorageModeManaged) {
id<MTLBlitCommandEncoder> enc = ctx->main_command_buffer.ensure_begin_blit_encoder();

View File

@@ -350,7 +350,7 @@ void MTLVertBuf::read(void *data) const
if (usage_ != GPU_USAGE_DEVICE_ONLY) {
/* Ensure data is flushed for host caches. */
/* Ensure data is flushed for host caches. */
id<MTLBuffer> source_buffer = vbo_->get_metal_buffer();
if (source_buffer.storageMode == MTLStorageModeManaged) {
id<MTLBlitCommandEncoder> enc = ctx->main_command_buffer.ensure_begin_blit_encoder();

View File

@@ -82,7 +82,7 @@ class AbcObjectReader {
/* XXX - TODO(kevindietrich) : this references stack memory... */
ImportSettings *m_settings;
/* This is initialized from the ImportSettings above on construction. It will need to be removed
* once we fix the stack memory reference situation. */
* once we fix the stack memory reference situation. */
bool m_is_reading_a_file_sequence = false;
chrono_t m_min_time;

View File

@@ -1441,7 +1441,7 @@ static char *rna_def_property_set_func(
}
else {
rna_clamp_value_range(f, prop);
/* C++ may require casting to an enum type. */
/* C++ may require casting to an enum type. */
fprintf(f, "#ifdef __cplusplus\n");
fprintf(f,
/* If #rna_clamp_value() adds an expression like `CLAMPIS(...)`
@@ -4705,7 +4705,7 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
#if defined(__clang__)
/* TODO(@ideasman42): ideally this workaround would not be needed,
* could use some further investigation as these are intended to be declared. */
* could use some further investigation as these are intended to be declared. */
fprintf(f, "#pragma GCC diagnostic ignored \"-Wmissing-variable-declarations\"\n\n");
#endif