Cleanup: use C style comments for descriptive text

This commit is contained in:
Campbell Barton 2021-08-26 12:27:17 +10:00
parent 42032db1c2
commit 84f048fda5
37 changed files with 124 additions and 130 deletions

View File

@ -61,8 +61,7 @@ struct bSound *BKE_sound_new_file_exists_ex(struct Main *bmain,
bool *r_exists);
struct bSound *BKE_sound_new_file_exists(struct Main *bmain, const char *filepath);
// XXX unused currently
#if 0
#if 0 /* UNUSED */
struct bSound *BKE_sound_new_buffer(struct Main *bmain, struct bSound *source);
struct bSound *BKE_sound_new_limiter(struct Main *bmain,

View File

@ -56,7 +56,7 @@
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BLI_sys_types.h" // for intptr_t support
#include "BLI_sys_types.h" /* For #intptr_t support. */
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
@ -655,7 +655,7 @@ static float displist_calc_taper(Depsgraph *depsgraph,
return fp[1];
}
}
return fp[-2]; // last y coord
return fp[-2]; /* Last y coordinate. */
}
}

View File

@ -557,7 +557,7 @@ static bool BKE_fluid_modifier_init(
return false;
}
// forward declaration
/* Forward declarations. */
static void manta_smoke_calc_transparency(FluidDomainSettings *fds, ViewLayer *view_layer);
static float calc_voxel_transp(
float *result, const float *input, int res[3], int *pixel, float *t_ray, float correct);
@ -4380,10 +4380,10 @@ static void manta_smoke_calc_transparency(FluidDomainSettings *fds, ViewLayer *v
light[2] = (light[2] - fds->p0[2]) / fds->cell_size[2] - 0.5f - (float)fds->res_min[2];
/* Calculate domain bounds in sim cell space. */
// 0,2,4 = 0.0f
bv[1] = (float)fds->res[0]; // x
bv[3] = (float)fds->res[1]; // y
bv[5] = (float)fds->res[2]; // z
/* 0,2,4 = 0.0f */
bv[1] = (float)fds->res[0]; /* X */
bv[3] = (float)fds->res[1]; /* Y */
bv[5] = (float)fds->res[2]; /* Z */
for (int z = 0; z < fds->res[2]; z++) {
size_t index = z * slabsize;

View File

@ -883,7 +883,7 @@ static void gpencil_interpolate_fl_from_to(
float *r = point_offset;
for (int i = 0; i <= it; i++) {
float fac = (float)i / (float)it;
fac = 3.0f * fac * fac - 2.0f * fac * fac * fac; // smooth
fac = 3.0f * fac * fac - 2.0f * fac * fac * fac; /* Smooth. */
*r = interpf(to, from, fac);
r = POINTER_OFFSET(r, stride);
}
@ -896,7 +896,7 @@ static void gpencil_interpolate_v4_from_to(
float *r = point_offset;
for (int i = 0; i <= it; i++) {
float fac = (float)i / (float)it;
fac = 3.0f * fac * fac - 2.0f * fac * fac * fac; // smooth
fac = 3.0f * fac * fac - 2.0f * fac * fac * fac; /* Smooth. */
interp_v4_v4v4(r, from, to, fac);
r = POINTER_OFFSET(r, stride);
}

View File

@ -269,7 +269,7 @@ void BKE_nla_tracks_copy(Main *bmain, ListBase *dst, const ListBase *src, const
/* copy each NLA-track, one at a time */
for (nlt = src->first; nlt; nlt = nlt->next) {
/* make a copy, and add the copy to the destination list */
// XXX: we need to fix this sometime
/* XXX: we need to fix this sometime. */
nlt_d = BKE_nlatrack_copy(bmain, nlt, true, flag);
BLI_addtail(dst, nlt_d);
}
@ -516,7 +516,7 @@ static float nlastrip_get_frame_actionclip(NlaStrip *strip, float cframe, short
if (IS_EQF(strip->repeat, 0.0f)) {
strip->repeat = 1.0f;
}
// repeat = strip->repeat; // UNUSED
// repeat = strip->repeat; /* UNUSED */
/* scaling */
if (IS_EQF(strip->scale, 0.0f)) {

View File

@ -1638,10 +1638,10 @@ static void sph_springs_modify(ParticleSystem *psys, float dtime)
Lij = spring->rest_length;
d = yield_ratio * timefix * Lij;
if (rij > Lij + d) { // Stretch
if (rij > Lij + d) { /* Stretch */
spring->rest_length += plasticity * (rij - Lij - d) * timefix;
}
else if (rij < Lij - d) { // Compress
else if (rij < Lij - d) { /* Compress */
spring->rest_length -= plasticity * (Lij - d - rij) * timefix;
}
@ -2209,7 +2209,7 @@ static void sph_integrate(ParticleSimulationData *sim,
SPHData *sphdata)
{
ParticleSettings *part = sim->psys->part;
// float timestep = psys_get_timestep(sim); // UNUSED
// float timestep = psys_get_timestep(sim); /* UNUSED */
float pa_mass = part->mass * ((part->flag & PART_SIZEMASS) ? pa->size : 1.0f);
float dtime = dfra * psys_get_timestep(sim);
// int steps = 1; // UNUSED
@ -2218,7 +2218,7 @@ static void sph_integrate(ParticleSimulationData *sim,
sphdata->pa = pa;
sphdata->mass = pa_mass;
sphdata->pass = 0;
// sphdata.element_size and sphdata.flow are set in the callback.
/* #sphdata.element_size and #sphdata.flow are set in the callback. */
/* Restore previous state and treat gravity & effectors as external acceleration. */
sub_v3_v3v3(effector_acceleration, pa->state.vel, pa->prev_state.vel);

View File

@ -382,7 +382,7 @@ static int make(const char *input_file_name, const char *output_file_name)
}
else if (strstr(l, msgstr_kw) == l) {
l = l + msgstr_len;
// Now we are in a msgstr section
/* Now we are in a `msgstr` section. */
section = SECTION_STR;
if (l[0] == '[') {
if (!is_plural) {

View File

@ -561,7 +561,7 @@ bool ExecutionGroup::scheduleChunkWhenPossible(ExecutionSystem *graph,
return true;
}
// Check if chunk is already executed or scheduled and not yet executed.
/* Check if chunk is already executed or scheduled and not yet executed. */
const int chunk_index = chunk_y * this->m_x_chunks_len + chunk_x;
WorkPackage &work_package = m_work_packages[chunk_index];
if (work_package.state == eWorkPackageState::Executed) {

View File

@ -30,7 +30,7 @@
#include <ostream>
namespace blender::compositor {
// Forward Declarations.
/* Forward Declarations. */
class ExecutionGroup;
/**

View File

@ -64,9 +64,8 @@ void BokehBlurNode::convertToOperations(NodeConverter &converter,
converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0));
converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
// NOTE: on the bokeh blur operation the sockets are switched.
// for this reason the next two lines are correct.
// Fix for T43771
/* NOTE: on the bokeh blur operation the sockets are switched.
* for this reason the next two lines are correct. Fix for T43771. */
converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(3));
converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(2));

View File

@ -39,8 +39,8 @@ void ColorSpillNode::convertToOperations(NodeConverter &converter,
ColorSpillOperation *operation;
operation = new ColorSpillOperation();
operation->setSettings((NodeColorspill *)editorsnode->storage);
operation->setSpillChannel(editorsnode->custom1 - 1); // Channel for spilling
operation->setSpillMethod(editorsnode->custom2); // Channel method
operation->setSpillChannel(editorsnode->custom1 - 1); /* Channel for spilling */
operation->setSpillMethod(editorsnode->custom2); /* Channel method */
converter.addOperation(operation);
converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0));

View File

@ -101,7 +101,7 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter,
converter.mapOutputSocket(getOutputSocket(), psoperation->getOutputSocket());
if (invert) {
// Translate -> Rotate -> Scale.
/* Translate -> Rotate -> Scale. */
converter.mapInputSocket(imageInput, translateOperation->getInputSocket(0));
converter.addLink(translateOperation->getOutputSocket(),
@ -111,7 +111,7 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter,
converter.addLink(scaleOperation->getOutputSocket(), psoperation->getInputSocket(0));
}
else {
// Scale -> Rotate -> Translate.
/* Scale -> Rotate -> Translate. */
converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0));
converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0));

View File

@ -128,7 +128,7 @@ void ColorCurveOperation::update_memory_buffer_partial(MemoryBuffer *output,
}
}
// Constant level curve mapping
/* Constant level curve mapping. */
ConstantLevelColorCurveOperation::ConstantLevelColorCurveOperation()
{

View File

@ -30,7 +30,7 @@ ColorSpillOperation::ColorSpillOperation()
this->m_inputImageReader = nullptr;
this->m_inputFacReader = nullptr;
this->m_spillChannel = 1; // GREEN
this->m_spillChannel = 1; /* GREEN */
this->m_spillMethod = 0;
flags.can_be_constant = true;
}

View File

@ -62,7 +62,7 @@ void CompositorOperation::initExecution()
return;
}
// When initializing the tree during initial load the width and height can be zero.
/* When initializing the tree during initial load the width and height can be zero. */
this->m_imageInput = getInputSocketReader(0);
this->m_alphaInput = getInputSocketReader(1);
this->m_depthInput = getInputSocketReader(2);
@ -242,8 +242,8 @@ void CompositorOperation::determineResolution(unsigned int resolution[2],
int width = this->m_rd->xsch * this->m_rd->size / 100;
int height = this->m_rd->ysch * this->m_rd->size / 100;
// check actual render resolution with cropping it may differ with cropped border.rendering
// FIX for: [31777] Border Crop gives black (easy)
/* Check actual render resolution with cropping it may differ with cropped border.rendering
* Fix for T31777 Border Crop gives black (easy). */
Render *re = RE_GetSceneRender(this->m_scene);
if (re) {
RenderResult *rr = RE_AcquireResultRead(re);

View File

@ -160,7 +160,7 @@ bool DilateErodeThresholdOperation::determineDependingAreaOfInterest(
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
// Dilate Distance
/* Dilate Distance. */
DilateDistanceOperation::DilateDistanceOperation()
{
this->addInputSocket(DataType::Value);

View File

@ -27,7 +27,7 @@ namespace blender::compositor {
using fREAL = float;
// returns next highest power of 2 of x, as well its log2 in L2
/* Returns next highest power of 2 of x, as well its log2 in L2. */
static unsigned int nextPow2(unsigned int x, unsigned int *L2)
{
unsigned int pw, x_notpow2 = x & (x - 1);
@ -45,8 +45,8 @@ static unsigned int nextPow2(unsigned int x, unsigned int *L2)
//------------------------------------------------------------------------------
// from FXT library by Joerg Arndt, faster in order bitreversal
// use: r = revbin_upd(r, h) where h = N>>1
/* From FXT library by Joerg Arndt, faster in order bit-reversal
* use: `r = revbin_upd(r, h)` where `h = N>>1`. */
static unsigned int revbin_upd(unsigned int r, unsigned int h)
{
while (!((r ^= h) & h)) {
@ -127,7 +127,7 @@ static void FHT(fREAL *data, unsigned int M, unsigned int inverse)
//------------------------------------------------------------------------------
/* 2D Fast Hartley Transform, Mx/My -> log2 of width/height,
* nzp -> the row where zero pad data starts,
* inverse -> see above */
* inverse -> see above. */
static void FHT2D(
fREAL *data, unsigned int Mx, unsigned int My, unsigned int nzp, unsigned int inverse)
{
@ -136,14 +136,14 @@ static void FHT2D(
Nx = 1 << Mx;
Ny = 1 << My;
// rows (forward transform skips 0 pad data)
/* Rows (forward transform skips 0 pad data). */
maxy = inverse ? Ny : nzp;
for (j = 0; j < maxy; j++) {
FHT(&data[Nx * j], Mx, inverse);
}
// transpose data
if (Nx == Ny) { // square
/* Transpose data. */
if (Nx == Ny) { /* Square. */
for (j = 0; j < Ny; j++) {
for (i = j + 1; i < Nx; i++) {
unsigned int op = i + (j << Mx), np = j + (i << My);
@ -151,12 +151,12 @@ static void FHT2D(
}
}
}
else { // rectangular
else { /* Rectangular. */
unsigned int k, Nym = Ny - 1, stm = 1 << (Mx + My);
for (i = 0; stm > 0; i++) {
#define PRED(k) (((k & Nym) << Mx) + (k >> My))
for (j = PRED(i); j > i; j = PRED(j)) {
/* pass */
/* Pass. */
}
if (j < i) {
continue;
@ -172,12 +172,12 @@ static void FHT2D(
SWAP(unsigned int, Nx, Ny);
SWAP(unsigned int, Mx, My);
// now columns == transposed rows
/* Now columns == transposed rows. */
for (j = 0; j < Ny; j++) {
FHT(&data[Nx * j], Mx, inverse);
}
// finalize
/* Finalize. */
for (j = 0; j <= (Ny >> 1); j++) {
unsigned int jm = (Ny - j) & (Ny - 1);
unsigned int ji = j << Mx;
@ -199,7 +199,7 @@ static void FHT2D(
//------------------------------------------------------------------------------
/* 2D convolution calc, d1 *= d2, M/N - > log2 of width/height */
/* 2D convolution calc, d1 *= d2, M/N - > log2 of width/height. */
static void fht_convolve(fREAL *d1, const fREAL *d2, unsigned int M, unsigned int N)
{
fREAL a, b;
@ -275,18 +275,18 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
0,
rdst->getWidth() * rdst->getHeight() * COM_DATA_TYPE_COLOR_CHANNELS * sizeof(float));
// convolution result width & height
/* Convolution result width & height. */
w2 = 2 * kernelWidth - 1;
h2 = 2 * kernelHeight - 1;
// FFT pow2 required size & log2
/* FFT pow2 required size & log2. */
w2 = nextPow2(w2, &log2_w);
h2 = nextPow2(h2, &log2_h);
// alloc space
/* Allocate space. */
data1 = (fREAL *)MEM_callocN(3 * w2 * h2 * sizeof(fREAL), "convolve_fast FHT data1");
data2 = (fREAL *)MEM_callocN(w2 * h2 * sizeof(fREAL), "convolve_fast FHT data2");
// normalize convolutor
/* Normalize convolutor. */
wt[0] = wt[1] = wt[2] = 0.0f;
for (y = 0; y < kernelHeight; y++) {
colp = (fRGB *)&kernelBuffer[y * kernelWidth * COM_DATA_TYPE_COLOR_CHANNELS];
@ -310,10 +310,10 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
}
}
// copy image data, unpacking interleaved RGBA into separate channels
// only need to calc data1 once
/* Copy image data, unpacking interleaved RGBA into separate channels
* only need to calc data1 once. */
// block add-overlap
/* Block add-overlap. */
hw = kernelWidth >> 1;
hh = kernelHeight >> 1;
xbsz = (w2 + 1) - kernelWidth;
@ -329,13 +329,13 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
for (ybl = 0; ybl < nyb; ybl++) {
for (xbl = 0; xbl < nxb; xbl++) {
// each channel one by one
/* Each channel one by one. */
for (ch = 0; ch < 3; ch++) {
fREAL *data1ch = &data1[ch * w2 * h2];
// only need to calc fht data from in2 once, can re-use for every block
/* Only need to calc fht data from in2 once, can re-use for every block. */
if (!in2done) {
// in2, channel ch -> data1
/* in2, channel ch -> data1 */
for (y = 0; y < kernelHeight; y++) {
fp = &data1ch[y * w2];
colp = (fRGB *)&kernelBuffer[y * kernelWidth * COM_DATA_TYPE_COLOR_CHANNELS];
@ -345,7 +345,7 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
}
}
// in1, channel ch -> data2
/* in1, channel ch -> data2 */
memset(data2, 0, w2 * h2 * sizeof(fREAL));
for (y = 0; y < ybsz; y++) {
int yy = ybl * ybsz + y;
@ -363,20 +363,20 @@ static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2)
}
}
// forward FHT
// zero pad data start is different for each == height+1
/* Forward FHT
* zero pad data start is different for each == height+1. */
if (!in2done) {
FHT2D(data1ch, log2_w, log2_h, kernelHeight + 1, 0);
}
FHT2D(data2, log2_w, log2_h, kernelHeight + 1, 0);
// FHT2D transposed data, row/col now swapped
// convolve & inverse FHT
/* FHT2D transposed data, row/col now swapped
* convolve & inverse FHT. */
fht_convolve(data2, data1ch, log2_h, log2_w);
FHT2D(data2, log2_h, log2_w, 0, 1);
// data again transposed, so in order again
/* Data again transposed, so in order again. */
// overlap-add result
/* Overlap-add result. */
for (y = 0; y < (int)h2; y++) {
const int yy = ybl * ybsz + y - hh;
if ((yy < 0) || (yy >= imageHeight)) {
@ -416,8 +416,8 @@ void GlareFogGlowOperation::generateGlare(float *data,
unsigned int sz = 1 << settings->size;
const float cs_r = 1.0f, cs_g = 1.0f, cs_b = 1.0f;
// temp. src image
// make the convolution kernel
/* Temp. src image
* make the convolution kernel. */
rcti kernelRect;
BLI_rcti_init(&kernelRect, 0, sz, 0, sz);
ckrn = new MemoryBuffer(DataType::Color, kernelRect);
@ -433,9 +433,9 @@ void GlareFogGlowOperation::generateGlare(float *data,
fcol[0] = expf(d * cs_r);
fcol[1] = expf(d * cs_g);
fcol[2] = expf(d * cs_b);
// linear window good enough here, visual result counts, not scientific analysis
// w = (1.0f-fabs(u))*(1.0f-fabs(v));
// actually, Hanning window is ok, cos^2 for some reason is slower
/* Linear window good enough here, visual result counts, not scientific analysis:
* `w = (1.0f-fabs(u))*(1.0f-fabs(v));`
* actually, Hanning window is ok, `cos^2` for some reason is slower. */
w = (0.5f + 0.5f * cosf(u * (float)M_PI)) * (0.5f + 0.5f * cosf(v * (float)M_PI));
mul_v3_fl(fcol, w);
ckrn->writePixel(x, y, fcol);

View File

@ -28,7 +28,7 @@ namespace blender::compositor {
#define ASSERT_XY_RANGE(x, y) \
BLI_assert(x >= 0 && x < this->getWidth() && y >= 0 && y < this->getHeight())
// Inpaint (simple convolve using average of known pixels)
/* In-paint (simple convolve using average of known pixels). */
InpaintSimpleOperation::InpaintSimpleOperation()
{
this->addInputSocket(DataType::Color);

View File

@ -262,7 +262,7 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input,
return ScaleOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
// Absolute fixed size
/* Absolute fixed size. */
ScaleFixedSizeOperation::ScaleFixedSizeOperation() : BaseScaleOperation()
{
this->addInputSocket(DataType::Color, ResizeMode::None);

View File

@ -40,7 +40,7 @@ SplitOperation::SplitOperation()
void SplitOperation::initExecution()
{
// When initializing the tree during initial load the width and height can be zero.
/* When initializing the tree during initial load the width and height can be zero. */
this->m_image1Input = getInputSocketReader(0);
this->m_image2Input = getInputSocketReader(1);
}

View File

@ -48,8 +48,8 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove);
VectorBlurOperation::VectorBlurOperation()
{
this->addInputSocket(DataType::Color);
this->addInputSocket(DataType::Value); // ZBUF
this->addInputSocket(DataType::Color); // SPEED
this->addInputSocket(DataType::Value); /* ZBUF */
this->addInputSocket(DataType::Color); /* SPEED */
this->addOutputSocket(DataType::Color);
this->m_settings = nullptr;
this->m_cachedInstance = nullptr;

View File

@ -61,7 +61,7 @@ ViewerOperation::ViewerOperation()
void ViewerOperation::initExecution()
{
// When initializing the tree during initial load the width and height can be zero.
/* When initializing the tree during initial load the width and height can be zero. */
this->m_imageInput = getInputSocketReader(0);
this->m_alphaInput = getInputSocketReader(1);
this->m_depthInput = getInputSocketReader(2);

View File

@ -126,7 +126,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device,
*
* NOTE: list of cl_mem will be filled by 2, and needs to be cleaned up by 4
*/
// STEP 1
/* STEP 1 */
const unsigned int outputBufferWidth = outputBuffer->getWidth();
const unsigned int outputBufferHeight = outputBuffer->getHeight();
@ -144,7 +144,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device,
printf("CLERROR[%d]: %s\n", error, clewErrorString(error));
}
// STEP 2
/* STEP 2 */
std::list<cl_mem> *clMemToCleanUp = new std::list<cl_mem>();
clMemToCleanUp->push_back(clOutputBuffer);
std::list<cl_kernel> *clKernelsToCleanUp = new std::list<cl_kernel>();
@ -156,7 +156,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device,
clMemToCleanUp,
clKernelsToCleanUp);
// STEP 3
/* STEP 3 */
size_t origin[3] = {0, 0, 0};
size_t region[3] = {outputBufferWidth, outputBufferHeight, 1};
@ -185,7 +185,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice *device,
this->getMemoryProxy()->getBuffer()->fill_from(*outputBuffer);
// STEP 4
/* STEP 4 */
while (!clMemToCleanUp->empty()) {
cl_mem mem = clMemToCleanUp->front();
error = clReleaseMemObject(mem);

View File

@ -82,7 +82,7 @@ extern "C" {
/* CRUD ------------------------------------------- */
// Get main depsgraph instance from context!
/* Get main depsgraph instance from context! */
/* Create new Depsgraph instance */
/* TODO: what args are needed here? What's the building-graph entry point? */

View File

@ -125,13 +125,13 @@ static bool is_reachable(const Node *const from, const Node *const to)
return true;
}
// Perform a graph walk from 'to' towards its incoming connections.
// Walking from 'from' towards its outgoing connections is 10x slower on the Spring rig.
/* Perform a graph walk from 'to' towards its incoming connections.
* Walking from 'from' towards its outgoing connections is 10x slower on the Spring rig. */
deque<const Node *> queue;
Set<const Node *> seen;
queue.push_back(to);
while (!queue.empty()) {
// Visit the next node to inspect.
/* Visit the next node to inspect. */
const Node *visit = queue.back();
queue.pop_back();
@ -139,7 +139,7 @@ static bool is_reachable(const Node *const from, const Node *const to)
return true;
}
// Queue all incoming relations that we haven't seen before.
/* Queue all incoming relations that we haven't seen before. */
for (Relation *relation : visit->inlinks) {
const Node *prev_node = relation->from;
if (seen.add(prev_node)) {
@ -177,7 +177,7 @@ void DepsgraphRelationBuilder::build_driver_relations(IDNode *id_node)
return;
}
// Mapping from RNA prefix -> set of driver descriptors:
/* Mapping from RNA prefix -> set of driver descriptors: */
Map<string, Vector<DriverDescriptor>> driver_groups;
PointerRNA id_ptr;
@ -197,47 +197,47 @@ void DepsgraphRelationBuilder::build_driver_relations(IDNode *id_node)
}
for (Span<DriverDescriptor> prefix_group : driver_groups.values()) {
// For each node in the driver group, try to connect it to another node
// in the same group without creating any cycles.
/* For each node in the driver group, try to connect it to another node
* in the same group without creating any cycles. */
int num_drivers = prefix_group.size();
if (num_drivers < 2) {
// A relation requires two drivers.
/* A relation requires two drivers. */
continue;
}
for (int from_index = 0; from_index < num_drivers; ++from_index) {
const DriverDescriptor &driver_from = prefix_group[from_index];
Node *op_from = get_node(driver_from.depsgraph_key());
// Start by trying the next node in the group.
/* Start by trying the next node in the group. */
for (int to_offset = 1; to_offset < num_drivers; ++to_offset) {
const int to_index = (from_index + to_offset) % num_drivers;
const DriverDescriptor &driver_to = prefix_group[to_index];
Node *op_to = get_node(driver_to.depsgraph_key());
// Duplicate drivers can exist (see T78615), but cannot be distinguished by OperationKey
// and thus have the same depsgraph node. Relations between those drivers should not be
// created. This not something that is expected to happen (both the UI and the Python API
// prevent duplicate drivers), it did happen in a file and it is easy to deal with here.
/* Duplicate drivers can exist (see T78615), but cannot be distinguished by OperationKey
* and thus have the same depsgraph node. Relations between those drivers should not be
* created. This not something that is expected to happen (both the UI and the Python API
* prevent duplicate drivers), it did happen in a file and it is easy to deal with here. */
if (op_from == op_to) {
continue;
}
if (from_index < to_index && driver_from.is_same_array_as(driver_to)) {
// This is for adding a relation like `color[0]` -> `color[1]`.
// When the search for another driver wraps around, we cannot blindly add relations any
// more.
/* This is for adding a relation like `color[0]` -> `color[1]`.
* When the search for another driver wraps around,
* we cannot blindly add relations any more. */
}
else {
// Investigate whether this relation would create a dependency cycle.
// Example graph:
// A -> B -> C
// and investigating a potential connection C->A. Because A->C is an
// existing transitive connection, adding C->A would create a cycle.
/* Investigate whether this relation would create a dependency cycle.
* Example graph:
* A -> B -> C
* and investigating a potential connection C->A. Because A->C is an
* existing transitive connection, adding C->A would create a cycle. */
if (is_reachable(op_to, op_from)) {
continue;
}
// No need to directly connect this node if there is already a transitive connection.
/* No need to directly connect this node if there is already a transitive connection. */
if (is_reachable(op_from, op_to)) {
break;
}

View File

@ -28,7 +28,7 @@
namespace blender::deg {
////////////////////////////////////////////////////////////////////////////////
// Time source.
/* Time source. */
TimeSourceKey::TimeSourceKey() : id(nullptr)
{

View File

@ -26,8 +26,7 @@
namespace blender {
namespace deg {
// Utility class which takes care of calculating average of time series, such as
// FPS counters.
/* Utility class which takes care of calculating average of time series, such as FPS counters. */
template<int MaxSamples> class AveragedTimeSampler {
public:
AveragedTimeSampler() : num_samples_(0), next_sample_index_(0)
@ -38,13 +37,13 @@ template<int MaxSamples> class AveragedTimeSampler {
{
samples_[next_sample_index_] = value;
// Move to the next index, keeping wrapping at the end of array into account.
/* Move to the next index, keeping wrapping at the end of array into account. */
++next_sample_index_;
if (next_sample_index_ == MaxSamples) {
next_sample_index_ = 0;
}
// Update number of stored samples.
/* Update number of stored samples. */
if (num_samples_ != MaxSamples) {
++num_samples_;
}
@ -62,10 +61,10 @@ template<int MaxSamples> class AveragedTimeSampler {
protected:
double samples_[MaxSamples];
// Number of samples which are actually stored in the array.
/* Number of samples which are actually stored in the array. */
int num_samples_;
// Index in the samples_ array under which next sample will be stored.
/* Index in the samples_ array under which next sample will be stored. */
int next_sample_index_;
};

View File

@ -51,9 +51,9 @@
# include "intern/eval/deg_eval_copy_on_write.h"
#endif
// If defined, all working data will be set to an invalid state, helping
// to catch issues when areas accessing data which is considered to be no
// longer available.
/* If defined, all working data will be set to an invalid state, helping
* to catch issues when areas accessing data which is considered to be no
* longer available. */
#undef INVALIDATE_WORK_DATA
#ifndef NDEBUG
@ -79,22 +79,20 @@ void deg_invalidate_iterator_work_data(DEGObjectIterData *data)
void verify_id_properties_freed(DEGObjectIterData *data)
{
if (data->dupli_object_current == nullptr) {
// We didn't enter duplication yet, so we can't have any dangling
// pointers.
/* We didn't enter duplication yet, so we can't have any dangling pointers. */
return;
}
const Object *dupli_object = data->dupli_object_current->ob;
Object *temp_dupli_object = &data->temp_dupli_object;
if (temp_dupli_object->id.properties == nullptr) {
// No ID properties in temp data-block -- no leak is possible.
/* No ID properties in temp data-block -- no leak is possible. */
return;
}
if (temp_dupli_object->id.properties == dupli_object->id.properties) {
// Temp copy of object did not modify ID properties.
/* Temp copy of object did not modify ID properties. */
return;
}
// Free memory which is owned by temporary storage which is about to
// get overwritten.
/* Free memory which is owned by temporary storage which is about to get overwritten. */
IDP_FreeProperty(temp_dupli_object->id.properties);
temp_dupli_object->id.properties = nullptr;
}

View File

@ -49,7 +49,7 @@ void unregister_graph(Depsgraph *depsgraph)
VectorSet<Depsgraph *> &graphs = graph_registry.lookup(bmain);
graphs.remove(depsgraph);
// If this was the last depsgraph associated with the main, remove the main entry as well.
/* If this was the last depsgraph associated with the main, remove the main entry as well. */
if (graphs.is_empty()) {
graph_registry.remove(bmain);
}

View File

@ -237,7 +237,7 @@ void ComponentNode::tag_update(Depsgraph *graph, eUpdateSource source)
for (OperationNode *op_node : operations) {
op_node->tag_update(graph, source);
}
// It is possible that tag happens before finalization.
/* It is possible that tag happens before finalization. */
if (operations_map != nullptr) {
for (OperationNode *op_node : operations_map->values()) {
op_node->tag_update(graph, source);

View File

@ -51,7 +51,7 @@
/**
* Orient the handles towards the selection (can be slow with high-poly mesh!).
*/
// Disable for now, issues w/ refresh and '+' icons overlap.
/* Disable for now, issues w/ refresh and '+' icons overlap. */
// #define USE_SELECT_CENTER
#ifdef USE_SELECT_CENTER

View File

@ -219,7 +219,7 @@ static int graphkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
scene->r.pefra = round_fl_to_int(max);
/* Set notifier that things have changed. */
// XXX Err... there's nothing for frame ranges yet, but this should do fine too.
/* XXX: Err... there's nothing for frame ranges yet, but this should do fine too. */
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, ac.scene);
return OPERATOR_FINISHED;

View File

@ -72,14 +72,14 @@ BLI_STATIC_ASSERT(sizeof(IMAGE) == HEADER_SIZE, "Invalid header size");
// #define TYPEMASK 0xff00
#define BPPMASK 0x00ff
// #define ITYPE_VERBATIM 0x0000 // UNUSED
// #define ITYPE_VERBATIM 0x0000 /* UNUSED */
#define ITYPE_RLE 0x0100
#define ISRLE(type) (((type)&0xff00) == ITYPE_RLE)
// #define ISVERBATIM(type) (((type) & 0xff00) == ITYPE_VERBATIM)
#define BPP(type) ((type)&BPPMASK)
#define RLE(bpp) (ITYPE_RLE | (bpp))
// #define VERBATIM(bpp) (ITYPE_VERBATIM | (bpp)) // UNUSED
// #define IBUFSIZE(pixels) ((pixels + (pixels >> 6)) << 2) // UNUSED
// #define VERBATIM(bpp) (ITYPE_VERBATIM | (bpp)) /* UNUSED */
// #define IBUFSIZE(pixels) ((pixels + (pixels >> 6)) << 2) /* UNUSED */
// #define RLE_NOP 0x00
/* local struct for mem access */

View File

@ -1,6 +1,6 @@
#include "testing/testing.h"
// Keep first since utildefines defines AT which conflicts with STL
/* Keep first since utildefines defines AT which conflicts with STL. */
#include "intern/abc_axis_conversion.h"
#include "BLI_math.h"

View File

@ -856,11 +856,11 @@ typedef enum eSAction_Flag {
/* draw time in seconds instead of time in frames */
SACTION_DRAWTIME = (1 << 2),
/* don't filter action channels according to visibility */
// SACTION_NOHIDE = (1 << 3), /* XXX deprecated... old animation systems. */
// SACTION_NOHIDE = (1 << 3), /* Deprecated, old animation systems. */
/* don't kill overlapping keyframes after transform */
SACTION_NOTRANSKEYCULL = (1 << 4),
/* don't include keyframes that are out of view */
// SACTION_HORIZOPTIMISEON = (1 << 5), // XXX deprecated... old irrelevant trick
// SACTION_HORIZOPTIMISEON = (1 << 5), /* Deprecated, old irrelevant trick. */
/* show pose-markers (local to action) in Action Editor mode. */
SACTION_POSEMARKERS_SHOW = (1 << 6),
/* don't draw action channels using group colors (where applicable) */

View File

@ -207,9 +207,8 @@ typedef enum eArmature_DeformFlag {
ARM_DEF_INVERT_VGROUP = (1 << 4),
} eArmature_DeformFlag;
/* armature->pathflag */
// XXX deprecated... old animation system (armature only viz)
#ifdef DNA_DEPRECATED_ALLOW
#ifdef DNA_DEPRECATED_ALLOW /* Old animation system (armature only viz). */
/** #bArmature.pathflag */
typedef enum eArmature_PathFlag {
ARM_PATH_FNUMS = (1 << 0),
ARM_PATH_KFRAS = (1 << 1),

View File

@ -37,7 +37,7 @@ struct Ipo;
struct Text;
/* channels reside in Object or Action (ListBase) constraintChannels */
// XXX deprecated... old AnimSys
/* XXX: deprecated... old AnimSys. */
typedef struct bConstraintChannel {
struct bConstraintChannel *next, *prev;
struct Ipo *ipo;