Cleanup: reformat trailing comments that caused line wrapping

This commit is contained in:
Campbell Barton 2021-06-23 12:05:40 +10:00
parent 2c916c97ac
commit 5cc8e7ab53
32 changed files with 124 additions and 113 deletions

View File

@ -223,12 +223,14 @@ ccl_device_inline ssef fastpow24(const ssef &arg)
ssef x = fastpow<0x3F4CCCCD, 0x4F55A7FB>(arg); // error max = 0.17 avg = 0.0018 |avg| = 0.05
ssef arg2 = arg * arg;
ssef arg4 = arg2 * arg2;
x = improve_5throot_solution(x,
arg4); /* error max = 0.018 avg = 0.0031 |avg| = 0.0031 */
x = improve_5throot_solution(x,
arg4); /* error max = 0.00021 avg = 1.6e-05 |avg| = 1.6e-05 */
x = improve_5throot_solution(x,
arg4); /* error max = 6.1e-07 avg = 5.2e-08 |avg| = 1.1e-07 */
/* error max = 0.018 avg = 0.0031 |avg| = 0.0031 */
x = improve_5throot_solution(x, arg4);
/* error max = 0.00021 avg = 1.6e-05 |avg| = 1.6e-05 */
x = improve_5throot_solution(x, arg4);
/* error max = 6.1e-07 avg = 5.2e-08 |avg| = 1.1e-07 */
x = improve_5throot_solution(x, arg4);
return x * (x * x);
}

View File

@ -282,8 +282,8 @@ static CPUCapabilities &system_cpu_capabilities()
/* actual opcode for xgetbv */
__asm__(".byte 0x0f, 0x01, 0xd0" : "=a"(xcr_feature_mask), "=d"(edx) : "c"(0));
# elif defined(_MSC_VER) && defined(_XCR_XFEATURE_ENABLED_MASK)
xcr_feature_mask = (uint32_t)_xgetbv(
_XCR_XFEATURE_ENABLED_MASK); /* min VS2010 SP1 compiler is required */
/* Minimum VS2010 SP1 compiler is required. */
xcr_feature_mask = (uint32_t)_xgetbv(_XCR_XFEATURE_ENABLED_MASK);
# else
xcr_feature_mask = 0;
# endif

View File

@ -392,9 +392,10 @@ GHOST_XrActionSet::GHOST_XrActionSet(XrInstance instance, const GHOST_XrActionSe
{
XrActionSetCreateInfo action_set_info{XR_TYPE_ACTION_SET_CREATE_INFO};
strcpy(action_set_info.actionSetName, info.name);
strcpy(action_set_info.localizedActionSetName,
info.name); /* Just use same name for localized. This can be changed in the future if
necessary. */
/* Just use same name for localized. This can be changed in the future if necessary. */
strcpy(action_set_info.localizedActionSetName, info.name);
action_set_info.priority = 0; /* Use same (default) priority for all action sets. */
CHECK_XR(xrCreateActionSet(instance, &action_set_info, &m_action_set),

View File

@ -74,10 +74,11 @@ class GHOST_XrSession {
const GHOST_XrActionProfileInfo *infos);
bool attachActionSets();
/** Action functions to be called post-session start. */
bool syncActions(
const char *action_set_name = nullptr); /* If action_set_name is nullptr, all attached
* action sets will be synced. */
/**
* Action functions to be called post-session start.
* \param action_set_name: When `nullptr`, all attached action sets will be synced.
*/
bool syncActions(const char *action_set_name = nullptr);
bool applyHapticAction(const char *action_set_name,
const char *action_name,
const GHOST_TInt64 &duration,

View File

@ -846,8 +846,9 @@ void BKE_pose_copy_data_ex(bPose **dst,
}
if (copy_constraints) {
BKE_constraints_copy_ex(
&listb, &pchan->constraints, flag, true); /* BKE_constraints_copy NULLs listb */
/* #BKE_constraints_copy NULL's `listb` */
BKE_constraints_copy_ex(&listb, &pchan->constraints, flag, true);
pchan->constraints = listb;
/* XXX: This is needed for motionpath drawing to work.

View File

@ -173,12 +173,10 @@ static bool calc_curve_deform(
copy_qt_qt(quat, new_quat);
copy_v3_v3(cent, co);
/* zero the axis which is not used,
* the big block of text above now applies to these 3 lines */
quat_apply_track(quat,
axis,
(ELEM(axis, 0, 2)) ? 1 :
0); /* up flag is a dummy, set so no rotation is done */
/* Zero the axis which is not used,
* the big block of text above now applies to these 3 lines.
* The `upflag` argument may be a dummy, set so no rotation is done. */
quat_apply_track(quat, axis, (ELEM(axis, 0, 2)) ? 1 : 0);
vec_apply_track(cent, axis);
cent[index] = 0.0f;

View File

@ -1615,8 +1615,9 @@ static void emit_from_particles(Object *flow_ob,
}
}
state.time = BKE_scene_frame_get(
scene); /* DEG_get_ctime(depsgraph) does not give subframe time */
/* `DEG_get_ctime(depsgraph)` does not give sub-frame time. */
state.time = BKE_scene_frame_get(scene);
if (psys_get_particle_state(&sim, p, &state, 0) == 0) {
continue;
}

View File

@ -957,8 +957,8 @@ static void object_blend_read_lib(BlendLibReader *reader, ID *id)
ob, eModifierType_Fluidsim);
if (fluidmd && fluidmd->fss) {
BLO_read_id_address(
reader, ob->id.lib, &fluidmd->fss->ipo); /* XXX deprecated - old animation system */
/* XXX: deprecated - old animation system. */
BLO_read_id_address(reader, ob->id.lib, &fluidmd->fss->ipo);
}
}

View File

@ -384,8 +384,9 @@ void BKE_particle_partdeflect_blend_read_lib(BlendLibReader *reader, ID *id, Par
static void particle_settings_blend_read_lib(BlendLibReader *reader, ID *id)
{
ParticleSettings *part = (ParticleSettings *)id;
BLO_read_id_address(
reader, part->id.lib, &part->ipo); /* XXX deprecated - old animation system */
/* XXX: deprecated - old animation system. */
BLO_read_id_address(reader, part->id.lib, &part->ipo);
BLO_read_id_address(reader, part->id.lib, &part->instance_object);
BLO_read_id_address(reader, part->id.lib, &part->instance_collection);

View File

@ -1466,8 +1466,8 @@ static void scene_blend_read_lib(BlendLibReader *reader, ID *id)
IDP_BlendReadLib(reader, seq->prop);
if (seq->ipo) {
BLO_read_id_address(
reader, sce->id.lib, &seq->ipo); /* XXX deprecated - old animation system */
/* XXX: deprecated - old animation system. */
BLO_read_id_address(reader, sce->id.lib, &seq->ipo);
}
seq->scene_sound = NULL;
if (seq->scene) {

View File

@ -187,8 +187,8 @@ static void sound_blend_read_data(BlendDataReader *reader, ID *id)
static void sound_blend_read_lib(BlendLibReader *reader, ID *id)
{
bSound *sound = (bSound *)id;
BLO_read_id_address(
reader, sound->id.lib, &sound->ipo); /* XXX deprecated - old animation system */
/* XXX: deprecated - old animation system. */
BLO_read_id_address(reader, sound->id.lib, &sound->ipo);
}
static void sound_blend_read_expand(BlendExpander *expander, ID *id)

View File

@ -154,8 +154,9 @@ void bmo_face_attribute_fill_exec(BMesh *bm, BMOperator *op)
int face_tot;
BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false);
BMO_slot_buffer_hflag_enable(
bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, false); /* do inline */
/* do inline */
BMO_slot_buffer_hflag_enable(bm, op->slots_in, "faces", BM_FACE, BM_ELEM_TAG, false);
/* now we can copy adjacent data */
face_tot = bmesh_face_attribute_fill(bm, use_normals, use_data);

View File

@ -3443,12 +3443,14 @@ static void ANIM_OT_channels_click(wmOperatorType *ot)
ot->flag = OPTYPE_UNDO;
/* properties */
/* NOTE: don't save settings, otherwise, can end up with some weird behavior (sticky extend) */
prop = RNA_def_boolean(ot->srna, "extend", false, "Extend Select", ""); /* SHIFTKEY */
/* NOTE: don't save settings, otherwise, can end up with some weird behavior (sticky extend)
*
* Key-map: Enable with `Shift`. */
prop = RNA_def_boolean(ot->srna, "extend", false, "Extend Select", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(
ot->srna, "children_only", false, "Select Children Only", ""); /* CTRLKEY|SHIFTKEY */
/* Key-map: Enable with `Ctrl-Shift`. */
prop = RNA_def_boolean(ot->srna, "children_only", false, "Select Children Only", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}

View File

@ -109,8 +109,8 @@ void ANIM_list_elem_update(Main *bmain, Scene *scene, bAnimListElem *ale)
/* in other case we do standard depsgraph update, ideally
* we'd be calling property update functions here too ... */
DEG_id_tag_update(id,
ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY |
ID_RECALC_ANIMATION); /* XXX or do we want something more restrictive? */
/* XXX: or do we want something more restrictive? */
ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
}
}
@ -119,11 +119,10 @@ void ANIM_list_elem_update(Main *bmain, Scene *scene, bAnimListElem *ale)
void ANIM_id_update(Main *bmain, ID *id)
{
if (id) {
DEG_id_tag_update_ex(
bmain,
id,
ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY |
ID_RECALC_ANIMATION); /* XXX or do we want something more restrictive? */
DEG_id_tag_update_ex(bmain,
id,
/* XXX: or do we want something more restrictive? */
ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
}
}

View File

@ -991,10 +991,11 @@ void UI_view2d_totRect_set_resize(View2D *v2d, int width, int height, bool resiz
if (ELEM(0, width, height)) {
if (G.debug & G_DEBUG) {
/* XXX: temp debug info. */
printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d\n",
(void *)v2d,
width,
height); /* XXX temp debug info */
height);
}
return;
}

View File

@ -403,8 +403,10 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update,
BLI_path_join(
temp_dir, sizeof(temp_dir), fds->cache_directory, FLUID_DOMAIN_DIR_PARTICLES, NULL);
BLI_path_abs(temp_dir, relbase);
BLI_dir_create_recursive(
temp_dir); /* Create 'particles' subdir if it does not exist already */
/* Create 'particles' subdir if it does not exist already */
BLI_dir_create_recursive(temp_dir);
fds->cache_flag &= ~(FLUID_DOMAIN_BAKED_PARTICLES | FLUID_DOMAIN_OUTDATED_PARTICLES);
fds->cache_flag |= FLUID_DOMAIN_BAKING_PARTICLES;
job->pause_frame = &fds->cache_frame_pause_particles;

View File

@ -6468,6 +6468,8 @@ static Image *proj_paint_image_create(wmOperator *op, Main *bmain, bool is_data)
alpha = RNA_boolean_get(op->ptr, "alpha");
RNA_string_get(op->ptr, "name", imagename);
}
/* TODO(lukas): Add option for tiled image. */
ima = BKE_image_add_generated(bmain,
width,
height,
@ -6478,7 +6480,7 @@ static Image *proj_paint_image_create(wmOperator *op, Main *bmain, bool is_data)
color,
false,
is_data,
false); /* TODO(lukas): Add option */
false);
return ima;
}

View File

@ -1872,12 +1872,13 @@ void ACTION_OT_clickselect(wmOperatorType *ot)
/* properties */
WM_operator_properties_generic_select(ot);
/* Key-map: Enable with `Shift`. */
prop = RNA_def_boolean(
ot->srna,
"extend",
0,
"Extend Select",
"Toggle keyframe selection instead of leaving newly selected keyframes only"); /* SHIFTKEY */
"Toggle keyframe selection instead of leaving newly selected keyframes only");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(ot->srna,
@ -1887,20 +1888,21 @@ void ACTION_OT_clickselect(wmOperatorType *ot)
"Deselect all when nothing under the cursor");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
/* Key-map: Enable with `Alt`. */
prop = RNA_def_boolean(
ot->srna,
"column",
0,
"Column Select",
"Select all keyframes that occur on the same frame as the one under the mouse"); /* ALTKEY */
"Select all keyframes that occur on the same frame as the one under the mouse");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(
ot->srna,
"channel",
0,
"Only Channel",
"Select all the keyframes in the channel under the mouse"); /* CTRLKEY + ALTKEY */
/* Key-map: Enable with `Ctrl-Alt`. */
prop = RNA_def_boolean(ot->srna,
"channel",
0,
"Only Channel",
"Select all the keyframes in the channel under the mouse");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}

View File

@ -1337,8 +1337,8 @@ static void do_graph_region_modifier_buttons(bContext *C, void *UNUSED(arg), int
{
switch (event) {
case B_FMODIFIER_REDRAW: /* XXX this should send depsgraph updates too */
WM_event_add_notifier(
C, NC_ANIMATION, NULL); /* XXX need a notifier specially for F-Modifiers */
/* XXX: need a notifier specially for F-Modifiers */
WM_event_add_notifier(C, NC_ANIMATION, NULL);
break;
}
}

View File

@ -1958,12 +1958,14 @@ void GRAPH_OT_clickselect(wmOperatorType *ot)
/* properties */
WM_operator_properties_generic_select(ot);
/* Key-map: Enable with `Shift`. */
prop = RNA_def_boolean(ot->srna,
"extend",
0,
"Extend Select",
"Toggle keyframe selection instead of leaving newly selected "
"keyframes only"); /* SHIFTKEY */
"keyframes only");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(ot->srna,
@ -1973,19 +1975,18 @@ void GRAPH_OT_clickselect(wmOperatorType *ot)
"Deselect all when nothing under the cursor");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
/* Key-map: Enable with `Alt`. */
prop = RNA_def_boolean(ot->srna,
"column",
0,
"Column Select",
"Select all keyframes that occur on the same frame as the one under "
"the mouse"); /* ALTKEY */
"the mouse");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(ot->srna,
"curves",
0,
"Only Curves",
"Select all the keyframes in the curve"); /* CTRLKEY + ALTKEY */
/* Key-map: Enable with `Ctrl-Atl`. */
prop = RNA_def_boolean(
ot->srna, "curves", 0, "Only Curves", "Select all the keyframes in the curve");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}

View File

@ -293,8 +293,9 @@ static void ptile_restore_runtime_list(ListBase *paint_tiles)
SWAP(uint *, ptile->rect.uint, tmpibuf->rect);
}
BKE_image_free_gputextures(
image); /* force OpenGL reload (maybe partial update will operate better?) */
/* Force OpenGL reload (maybe partial update will operate better?) */
BKE_image_free_gputextures(image);
if (ibuf->rect_float) {
ibuf->userflags |= IB_RECT_INVALID; /* force recreate of char rect */
}

View File

@ -312,12 +312,8 @@ static void outliner_add_object_contents(SpaceOutliner *space_outliner,
outliner_add_element(space_outliner, &te->subtree, ob, te, TSE_ANIM_DATA, 0);
}
outliner_add_element(space_outliner,
&te->subtree,
ob->poselib,
te,
TSE_SOME_ID,
0); /* XXX FIXME.. add a special type for this. */
/* FIXME: add a special type for this. */
outliner_add_element(space_outliner, &te->subtree, ob->poselib, te, TSE_SOME_ID, 0);
if (ob->proxy && !ID_IS_LINKED(ob)) {
outliner_add_element(space_outliner, &te->subtree, ob->proxy, te, TSE_PROXY, 0);

View File

@ -1449,9 +1449,9 @@ void recalcData_pose(TransInfo *t)
/* TODO: autokeyframe calls need some setting to specify to add samples
* (FPoints) instead of keyframes? */
if ((t->animtimer) && (t->context) && IS_AUTOKEY_ON(t->scene)) {
int targetless_ik =
(t->flag &
T_AUTOIK); /* XXX this currently doesn't work, since flags aren't set yet! */
/* XXX: this currently doesn't work, since flags aren't set yet! */
int targetless_ik = (t->flag & T_AUTOIK);
animrecord_check_state(t, ob);
autokeyframe_pose(t->context, t->scene, ob, t->mode, targetless_ik);

View File

@ -113,9 +113,8 @@ void ColorBlock::init(uint w, uint h, const float *data, uint x, uint y)
const uint idx = ((y + by) * w + x + bx);
Color32 &c = color(e, i);
c.r = uint8(255 * CLAMP(data[idx + 0 * srcPlane],
0.0f,
1.0f)); /* @@ Is this the right way to quantize floats to bytes? */
/* @@ Is this the right way to quantize floats to bytes? */
c.r = uint8(255 * CLAMP(data[idx + 0 * srcPlane], 0.0f, 1.0f));
c.g = uint8(255 * CLAMP(data[idx + 1 * srcPlane], 0.0f, 1.0f));
c.b = uint8(255 * CLAMP(data[idx + 2 * srcPlane], 0.0f, 1.0f));
c.a = uint8(255 * CLAMP(data[idx + 3 * srcPlane], 0.0f, 1.0f));

View File

@ -67,8 +67,9 @@ BCMatrix::BCMatrix(BC_global_forward_axis global_forward_axis, BC_global_up_axis
mat3_from_axis_conversion(
BC_DEFAULT_FORWARD, BC_DEFAULT_UP, global_forward_axis, global_up_axis, mrot);
transpose_m3(
mrot); /* TODO: Verify that mat3_from_axis_conversion() returns a transposed matrix */
/* TODO: Verify that `mat3_from_axis_conversion()` returns a transposed matrix */
transpose_m3(mrot);
copy_m4_m3(mat, mrot);
set_transform(mat);
}

View File

@ -1999,8 +1999,8 @@ static void rna_VertexGroup_vertex_add(ID *id,
}
while (index_len--) {
ED_vgroup_vert_add(
ob, def, *index++, weight, assignmode); /* XXX, not efficient calling within loop*/
/* XXX: not efficient calling within loop. */
ED_vgroup_vert_add(ob, def, *index++, weight, assignmode);
}
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);

View File

@ -575,8 +575,10 @@ static void rna_Object_ray_cast(Object *ob,
/* Test BoundBox first (efficiency) */
BoundBox *bb = BKE_object_boundbox_get(ob);
float distmin;
normalize_v3(
direction); /* Needed for valid distance check from isect_ray_aabb_v3_simple() call. */
/* Needed for valid distance check from #isect_ray_aabb_v3_simple() call. */
normalize_v3(direction);
if (!bb ||
(isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], &distmin, NULL) &&
distmin <= distance)) {

View File

@ -620,8 +620,8 @@ static void rna_PoseChannel_constraints_remove(
ED_object_constraint_update(bmain, ob);
BKE_constraints_active_set(&pchan->constraints,
NULL); /* XXX, is this really needed? - Campbell */
/* XXX(Campbell): is this really needed? */
BKE_constraints_active_set(&pchan->constraints, NULL);
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, id);

View File

@ -1018,8 +1018,8 @@ void RNA_api_ui_layout(StructRNA *srna)
func = RNA_def_function(srna, "operator_menu_enum", "rna_uiItemMenuEnumO");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_op(
func); /* can't use api_ui_item_op_common because property must come right after */
/* Can't use #api_ui_item_op_common because property must come right after. */
api_ui_item_op(func);
parm = RNA_def_string(func, "property", NULL, 0, "", "Identifier of property in operator");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
api_ui_item_common(func);

View File

@ -263,28 +263,24 @@ static void simple_helper(void *__restrict userdata,
copy_v3_v3_map(dcut_remap, dcut, axis_map);
switch (curr_deform_data->mode) {
case MOD_SIMPLEDEFORM_MODE_TWIST:
simpleDeform_twist(curr_deform_data->smd_factor,
curr_deform_data->deform_axis,
dcut_remap,
co_remap); /* apply deform */
/* Apply deform. */
simpleDeform_twist(
curr_deform_data->smd_factor, curr_deform_data->deform_axis, dcut_remap, co_remap);
break;
case MOD_SIMPLEDEFORM_MODE_BEND:
simpleDeform_bend(curr_deform_data->smd_factor,
curr_deform_data->deform_axis,
dcut_remap,
co_remap); /* apply deform */
/* Apply deform. */
simpleDeform_bend(
curr_deform_data->smd_factor, curr_deform_data->deform_axis, dcut_remap, co_remap);
break;
case MOD_SIMPLEDEFORM_MODE_TAPER:
simpleDeform_taper(curr_deform_data->smd_factor,
curr_deform_data->deform_axis,
dcut_remap,
co_remap); /* apply deform */
/* Apply deform. */
simpleDeform_taper(
curr_deform_data->smd_factor, curr_deform_data->deform_axis, dcut_remap, co_remap);
break;
case MOD_SIMPLEDEFORM_MODE_STRETCH:
simpleDeform_stretch(curr_deform_data->smd_factor,
curr_deform_data->deform_axis,
dcut_remap,
co_remap); /* apply deform */
/* Apply deform. */
simpleDeform_stretch(
curr_deform_data->smd_factor, curr_deform_data->deform_axis, dcut_remap, co_remap);
break;
default:
return; /* No simple-deform mode? */

View File

@ -999,9 +999,9 @@ void WM_xr_action_binding_destroy(wmXrData *xr,
unsigned int count_interaction_paths,
const char **interaction_paths);
bool WM_xr_active_action_set_set(
wmXrData *xr, const char *action_set_name); /* If action_set_name is NULL, then
* all action sets will be treated as active. */
/* If action_set_name is NULL, then all action sets will be treated as active. */
bool WM_xr_active_action_set_set(wmXrData *xr, const char *action_set_name);
bool WM_xr_controller_pose_action_set(wmXrData *xr,
const char *action_set_name,
const char *action_name);

View File

@ -312,9 +312,10 @@ void WM_gizmo_do_msg_notify_tag_refresh(bContext *UNUSED(C),
ARegion *region = msg_val->owner;
wmGizmoMap *gzmap = msg_val->user_data;
ED_region_tag_redraw(
region); /* Could possibly avoid a full redraw and only tag for editor overlays
* redraw in some cases, see #ED_region_tag_redraw_editor_overlays(). */
/* Could possibly avoid a full redraw and only tag for editor overlays
* redraw in some cases, see #ED_region_tag_redraw_editor_overlays(). */
ED_region_tag_redraw(region);
WM_gizmomap_tag_refresh(gzmap);
}