Cleanup: remove spaces from commented arguments

Also use local enums for `MA_BM_*` in versioning code.
This commit is contained in:
Campbell Barton
2023-09-22 12:02:32 +10:00
parent 867f99c2af
commit 5fbcb4c27e
64 changed files with 138 additions and 138 deletions
@@ -159,7 +159,7 @@ void AS_asset_full_path_explode_from_weak_ref(const AssetWeakReference *asset_re
BLI_assert(!exploded->group_component.is_empty());
BLI_assert(!exploded->name_component.is_empty());
BLI_strncpy(r_path_buffer, exploded->full_path->c_str(), 1090 /* FILE_MAX_LIBEXTRA */);
BLI_strncpy(r_path_buffer, exploded->full_path->c_str(), 1090 /* #FILE_MAX_LIBEXTRA. */);
if (!exploded->dir_component.is_empty()) {
r_path_buffer[exploded->dir_component.size()] = '\0';
@@ -323,12 +323,10 @@ bool BKE_where_on_path(const Object *ob,
}
if (r_vec) {
r_vec[0] = /* X */
w[0] * p0->vec[0] + w[1] * p1->vec[0] + w[2] * p2->vec[0] + w[3] * p3->vec[0];
r_vec[1] = /* Y */
w[0] * p0->vec[1] + w[1] * p1->vec[1] + w[2] * p2->vec[1] + w[3] * p3->vec[1];
r_vec[2] = /* Z */
w[0] * p0->vec[2] + w[1] * p1->vec[2] + w[2] * p2->vec[2] + w[3] * p3->vec[2];
/* X, Y, Z axis. */
r_vec[0] = w[0] * p0->vec[0] + w[1] * p1->vec[0] + w[2] * p2->vec[0] + w[3] * p3->vec[0];
r_vec[1] = w[0] * p0->vec[1] + w[1] * p1->vec[1] + w[2] * p2->vec[1] + w[3] * p3->vec[1];
r_vec[2] = w[0] * p0->vec[2] + w[1] * p1->vec[2] + w[2] * p2->vec[2] + w[3] * p3->vec[2];
}
/* Clamp weights to 0-1 as we don't want to extrapolate other values than position. */
@@ -804,8 +804,7 @@ GAttributeReader AttributeAccessor::lookup_or_default(const AttributeIDRef &attr
Set<AttributeIDRef> AttributeAccessor::all_ids() const
{
Set<AttributeIDRef> ids;
this->for_all(
[&](const AttributeIDRef &attribute_id, const AttributeMetaData & /* meta_data */) {
this->for_all([&](const AttributeIDRef &attribute_id, const AttributeMetaData & /*meta_data*/) {
ids.add(attribute_id);
return true;
});
@@ -651,10 +651,7 @@ GVArray::GVArray(const GVArrayImpl *impl) : GVArrayCommon(impl) {}
GVArray::GVArray(std::shared_ptr<const GVArrayImpl> impl) : GVArrayCommon(std::move(impl)) {}
GVArray::GVArray(varray_tag::single /* tag */,
const CPPType &type,
int64_t size,
const void *value)
GVArray::GVArray(varray_tag::single /*tag*/, const CPPType &type, int64_t size, const void *value)
{
if (type.is_trivial() && type.size() <= 16 && type.alignment() <= 8) {
this->emplace<GVArrayImpl_For_SmallTrivialSingleValue<16>>(type, size, value);
+1 -4
View File
@@ -1443,10 +1443,7 @@ static void *newpackedadr(FileData *fd, const void *adr)
}
/* only lib data */
static void *newlibadr(FileData *fd,
ID * /* self_id */,
const bool is_linked_only,
const void *adr)
static void *newlibadr(FileData *fd, ID * /*self_id*/, const bool is_linked_only, const void *adr)
{
return oldnewmap_liblookup(fd->libmap, adr, is_linked_only);
}
@@ -662,7 +662,11 @@ static void do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, cha
continue;
}
if (blend_method == 1 /* MA_BM_ADD */) {
enum {
MA_BM_ADD = 1,
MA_BM_MULTIPLY = 2,
};
if (blend_method == MA_BM_ADD) {
nodeRemLink(ntree, link);
bNode *add_node = nodeAddStaticNode(nullptr, ntree, SH_NODE_ADD_SHADER);
@@ -686,7 +690,7 @@ static void do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, cha
need_update = true;
}
else if (blend_method == 2 /* MA_BM_MULTIPLY */) {
else if (blend_method == MA_BM_MULTIPLY) {
nodeRemLink(ntree, link);
bNode *transp_node = nodeAddStaticNode(nullptr, ntree, SH_NODE_BSDF_TRANSPARENT);
@@ -1682,9 +1686,7 @@ struct MappingNodeFCurveCallbackData {
* update if the rna path starts with the rna path of the mapping node and
* doesn't end with "default_value", that is, not the Vector input.
*/
static void update_mapping_node_fcurve_rna_path_callback(ID * /* id */,
FCurve *fcurve,
void *_data)
static void update_mapping_node_fcurve_rna_path_callback(ID * /*id*/, FCurve *fcurve, void *_data)
{
MappingNodeFCurveCallbackData *data = (MappingNodeFCurveCallbackData *)_data;
if (!STRPREFIX(fcurve->rna_path, data->nodePath) ||
@@ -2688,17 +2690,21 @@ void do_versions_after_linking_280(FileData *fd, Main *bmain)
* now that we use dual-source blending. */
/* We take care of doing only node-trees that are always part of materials
* with old blending modes. */
enum {
MA_BM_ADD = 1,
MA_BM_MULTIPLY = 2,
};
LISTBASE_FOREACH (Material *, ma, &bmain->materials) {
bNodeTree *ntree = ma->nodetree;
if (ma->blend_method == 1 /* MA_BM_ADD */) {
if (ma->blend_method == MA_BM_ADD) {
if (ma->use_nodes) {
do_versions_material_convert_legacy_blend_mode(ntree, 1 /* MA_BM_ADD */);
do_versions_material_convert_legacy_blend_mode(ntree, MA_BM_ADD);
}
ma->blend_method = MA_BM_BLEND;
}
else if (ma->blend_method == 2 /* MA_BM_MULTIPLY */) {
else if (ma->blend_method == MA_BM_MULTIPLY) {
if (ma->use_nodes) {
do_versions_material_convert_legacy_blend_mode(ntree, 2 /* MA_BM_MULTIPLY */);
do_versions_material_convert_legacy_blend_mode(ntree, MA_BM_MULTIPLY);
}
ma->blend_method = MA_BM_BLEND;
}
@@ -58,20 +58,20 @@ void *EEVEE_NEXT_lightbake_job_data_alloc(Main *bmain,
* Free the job data.
* NOTE: Does not free the GPUContext. This is the responsibility of `EEVEE_NEXT_lightbake_job()`
*/
void EEVEE_NEXT_lightbake_job_data_free(void *job_data /* EEVEE_NEXT_LightBake */);
void EEVEE_NEXT_lightbake_job_data_free(/*EEVEE_NEXT_LightBake*/ void *job_data);
/**
* Callback for updating original scene light cache with bake result.
* Run by the job system for each update step and the finish step.
* This is called manually by `EEVEE_NEXT_lightbake_job()` if not run from a job.
*/
void EEVEE_NEXT_lightbake_update(void *job_data /* EEVEE_NEXT_LightBake */);
void EEVEE_NEXT_lightbake_update(/*EEVEE_NEXT_LightBake*/ void *job_data);
/**
* Do the full light baking for all samples.
* Will call `EEVEE_NEXT_lightbake_update()` on finish.
*/
void EEVEE_NEXT_lightbake_job(void *job_data /* EEVEE_NEXT_LightBake */,
void EEVEE_NEXT_lightbake_job(/*EEVEE_NEXT_LightBake*/ void *job_data,
bool *stop,
bool *do_update,
float *progress);
@@ -16,7 +16,7 @@
/* Return scene linear Z depth from the camera or radial depth for panoramic cameras. */
float film_depth_convert_to_scene(float depth)
{
if (false /* Panoramic */) {
if (false /* Panoramic. */) {
/* TODO */
return 1.0;
}
@@ -434,7 +434,7 @@ void fragment_displacement()
vec3 coordinate_camera(vec3 P)
{
vec3 vP;
if (false /* probe */) {
if (false /* Probe. */) {
/* Unsupported. It would make the probe camera-dependent. */
vP = P;
}
@@ -452,7 +452,7 @@ vec3 coordinate_camera(vec3 P)
vec3 coordinate_screen(vec3 P)
{
vec3 window = vec3(0.0);
if (false /* probe */) {
if (false /* Probe. */) {
/* Unsupported. It would make the probe camera-dependent. */
window.xy = vec2(0.5);
}
@@ -6908,7 +6908,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but,
ColorPicker *cpicker = static_cast<ColorPicker *>(but->custom_data);
float *hsv = cpicker->hsv_perceptual;
float rgb[3];
float phi, r /*, sqr */ /* UNUSED */, v[2];
float phi, r, v[2];
const float sensitivity = (shift ? 0.06f : 0.3f) * ndof->dt;
ui_but_v3_get(but, rgb);
@@ -6918,7 +6918,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but,
/* Convert current color on hue/sat disc to circular coordinates phi, r */
phi = fmodf(hsv[0] + 0.25f, 1.0f) * -2.0f * float(M_PI);
r = hsv[1];
/* sqr = r > 0.0f ? sqrtf(r) : 1; */ /* UNUSED */
// const float sqr = r > 0.0f ? sqrtf(r) : 1; /* UNUSED */
/* Convert to 2d vectors */
v[0] = r * cosf(phi);
@@ -2066,7 +2066,10 @@ void GRAPH_OT_clickselect(wmOperatorType *ot)
}
/** \} */
/* Key/handles selection */
/* -------------------------------------------------------------------- */
/** \name Key/handles Selection Operator
* \{ */
/* Defines for key/handles select tool. */
static const EnumPropertyItem prop_graphkeys_select_key_handles_actions[] = {
@@ -2227,3 +2230,5 @@ void GRAPH_OT_select_key_handles(wmOperatorType *ot)
"Key",
"Effect on the key itself");
}
/** \} */
@@ -1222,7 +1222,7 @@ static const SocketColorFn std_node_socket_color_funcs[] = {
std_node_socket_color_fn<SOCK_RGBA>,
std_node_socket_color_fn<SOCK_SHADER>,
std_node_socket_color_fn<SOCK_BOOLEAN>,
nullptr /* UNUSED */,
nullptr /* UNUSED. */,
std_node_socket_color_fn<SOCK_INT>,
std_node_socket_color_fn<SOCK_STRING>,
std_node_socket_color_fn<SOCK_OBJECT>,
@@ -52,8 +52,7 @@ namespace detail {
* Utility to implement #execute_lazy_function_eagerly.
*/
template<typename... Inputs, typename... Outputs, size_t... InIndices, size_t... OutIndices>
inline void execute_lazy_function_eagerly_impl(
const LazyFunction &fn,
inline void execute_lazy_function_eagerly_impl(const LazyFunction &fn,
UserData *user_data,
LocalUserData *local_user_data,
std::tuple<Inputs...> &inputs,
@@ -795,8 +795,7 @@ void USDMaterialReader::load_tex_image(const pxr::UsdShadeShader &usd_shader,
}
}
void USDMaterialReader::convert_usd_primvar_reader_float2(
const pxr::UsdShadeShader &usd_shader,
void USDMaterialReader::convert_usd_primvar_reader_float2(const pxr::UsdShadeShader &usd_shader,
const pxr::TfToken & /*usd_source_name*/,
bNode *dest_node,
const char *dest_socket_name,
@@ -3824,7 +3824,7 @@ PyTypeObject matrix_access_Type = {
/*tp_as_async*/ nullptr,
/*tp_repr*/ nullptr,
/*tp_as_number*/ nullptr,
/*tp_as_sequence*/ nullptr /* &MatrixAccess_SeqMethods */ /* TODO */,
/*tp_as_sequence*/ nullptr /* &MatrixAccess_SeqMethods */ /* TODO. */,
/*tp_as_mapping*/ &MatrixAccess_AsMapping,
/*tp_hash*/ nullptr,
/*tp_call*/ nullptr,
@@ -3836,7 +3836,7 @@ PyTypeObject matrix_access_Type = {
/*tp_doc*/ nullptr,
/*tp_traverse*/ (traverseproc)MatrixAccess_traverse,
/*tp_clear*/ (inquiry)MatrixAccess_clear,
/*tp_richcompare*/ nullptr /* MatrixAccess_richcmpr */ /* TODO */,
/*tp_richcompare*/ nullptr /* MatrixAccess_richcmpr */ /* TODO. */,
/*tp_weaklistoffset*/ 0,
/*tp_iter*/ (getiterfunc)MatrixAccess_iter,
/*tp_iternext*/ nullptr,