From 84f048fda566c2098ec1baa2ff1ad6c00b7395d5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 26 Aug 2021 12:27:17 +1000 Subject: Cleanup: use C style comments for descriptive text --- source/blender/blenkernel/BKE_sound.h | 3 +- source/blender/blenkernel/intern/displist.cc | 4 +- source/blender/blenkernel/intern/fluid.c | 10 ++-- source/blender/blenkernel/intern/gpencil_curve.c | 4 +- source/blender/blenkernel/intern/nla.c | 4 +- source/blender/blenkernel/intern/particle_system.c | 8 +-- source/blender/blentranslation/msgfmt/msgfmt.c | 2 +- .../compositor/intern/COM_ExecutionGroup.cc | 2 +- source/blender/compositor/intern/COM_WorkPackage.h | 2 +- .../blender/compositor/nodes/COM_BokehBlurNode.cc | 5 +- .../blender/compositor/nodes/COM_ColorSpillNode.cc | 4 +- .../compositor/nodes/COM_Stabilize2dNode.cc | 4 +- .../operations/COM_ColorCurveOperation.cc | 2 +- .../operations/COM_ColorSpillOperation.cc | 2 +- .../operations/COM_CompositorOperation.cc | 6 +- .../operations/COM_DilateErodeOperation.cc | 2 +- .../operations/COM_GlareFogGlowOperation.cc | 68 +++++++++++----------- .../compositor/operations/COM_InpaintOperation.cc | 2 +- .../compositor/operations/COM_ScaleOperation.cc | 2 +- .../compositor/operations/COM_SplitOperation.cc | 2 +- .../operations/COM_VectorBlurOperation.cc | 4 +- .../compositor/operations/COM_ViewerOperation.cc | 2 +- .../operations/COM_WriteBufferOperation.cc | 8 +-- source/blender/depsgraph/DEG_depsgraph.h | 2 +- .../builder/deg_builder_relations_drivers.cc | 44 +++++++------- .../intern/builder/deg_builder_relations_keys.cc | 2 +- .../depsgraph/intern/debug/deg_time_average.h | 11 ++-- .../depsgraph/intern/depsgraph_query_iter.cc | 16 +++-- .../blender/depsgraph/intern/depsgraph_registry.cc | 2 +- .../depsgraph/intern/node/deg_node_component.cc | 2 +- .../editors/mesh/editmesh_extrude_spin_gizmo.c | 2 +- source/blender/editors/space_graph/graph_view.c | 2 +- source/blender/imbuf/intern/iris.c | 6 +- source/blender/io/alembic/tests/abc_matrix_test.cc | 2 +- source/blender/makesdna/DNA_action_types.h | 4 +- source/blender/makesdna/DNA_armature_types.h | 5 +- source/blender/makesdna/DNA_constraint_types.h | 2 +- 37 files changed, 124 insertions(+), 130 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 4b257b3b8ab..fa58813c5f8 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -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, diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc index c97e07ad487..58509e95de6 100644 --- a/source/blender/blenkernel/intern/displist.cc +++ b/source/blender/blenkernel/intern/displist.cc @@ -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. */ } } diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 799d6553682..87c1f99fd73 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -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; diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index 344be7bc0f5..0752424df71 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -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); } diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 7e524da0f53..7ea0d991f4c 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -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)) { diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 60edb78f8ba..8986847a034 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -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); diff --git a/source/blender/blentranslation/msgfmt/msgfmt.c b/source/blender/blentranslation/msgfmt/msgfmt.c index f95bf2a9037..05c71fd4852 100644 --- a/source/blender/blentranslation/msgfmt/msgfmt.c +++ b/source/blender/blentranslation/msgfmt/msgfmt.c @@ -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) { diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cc b/source/blender/compositor/intern/COM_ExecutionGroup.cc index 68bda8c70d6..a45c453d7ed 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cc +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cc @@ -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) { diff --git a/source/blender/compositor/intern/COM_WorkPackage.h b/source/blender/compositor/intern/COM_WorkPackage.h index f0f53f300a5..20fca89aa4c 100644 --- a/source/blender/compositor/intern/COM_WorkPackage.h +++ b/source/blender/compositor/intern/COM_WorkPackage.h @@ -30,7 +30,7 @@ #include namespace blender::compositor { -// Forward Declarations. +/* Forward Declarations. */ class ExecutionGroup; /** diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cc b/source/blender/compositor/nodes/COM_BokehBlurNode.cc index 1d2a0dae390..c51a98c0f82 100644 --- a/source/blender/compositor/nodes/COM_BokehBlurNode.cc +++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cc @@ -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)); diff --git a/source/blender/compositor/nodes/COM_ColorSpillNode.cc b/source/blender/compositor/nodes/COM_ColorSpillNode.cc index 119cff93e84..6119e635e59 100644 --- a/source/blender/compositor/nodes/COM_ColorSpillNode.cc +++ b/source/blender/compositor/nodes/COM_ColorSpillNode.cc @@ -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)); diff --git a/source/blender/compositor/nodes/COM_Stabilize2dNode.cc b/source/blender/compositor/nodes/COM_Stabilize2dNode.cc index 7b2388bebca..90f62c6d562 100644 --- a/source/blender/compositor/nodes/COM_Stabilize2dNode.cc +++ b/source/blender/compositor/nodes/COM_Stabilize2dNode.cc @@ -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)); diff --git a/source/blender/compositor/operations/COM_ColorCurveOperation.cc b/source/blender/compositor/operations/COM_ColorCurveOperation.cc index 1b7ad0ea608..646238460ba 100644 --- a/source/blender/compositor/operations/COM_ColorCurveOperation.cc +++ b/source/blender/compositor/operations/COM_ColorCurveOperation.cc @@ -128,7 +128,7 @@ void ColorCurveOperation::update_memory_buffer_partial(MemoryBuffer *output, } } -// Constant level curve mapping +/* Constant level curve mapping. */ ConstantLevelColorCurveOperation::ConstantLevelColorCurveOperation() { diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.cc b/source/blender/compositor/operations/COM_ColorSpillOperation.cc index 4b0e0520b75..5bf7a9ee9cd 100644 --- a/source/blender/compositor/operations/COM_ColorSpillOperation.cc +++ b/source/blender/compositor/operations/COM_ColorSpillOperation.cc @@ -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; } diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cc b/source/blender/compositor/operations/COM_CompositorOperation.cc index 8752d764107..fb9e2e43c60 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.cc +++ b/source/blender/compositor/operations/COM_CompositorOperation.cc @@ -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); diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cc b/source/blender/compositor/operations/COM_DilateErodeOperation.cc index a27148f967d..c459d09f02c 100644 --- a/source/blender/compositor/operations/COM_DilateErodeOperation.cc +++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cc @@ -160,7 +160,7 @@ bool DilateErodeThresholdOperation::determineDependingAreaOfInterest( return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } -// Dilate Distance +/* Dilate Distance. */ DilateDistanceOperation::DilateDistanceOperation() { this->addInputSocket(DataType::Value); diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc index 1c1eaebd331..0026615f08b 100644 --- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc +++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc @@ -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); diff --git a/source/blender/compositor/operations/COM_InpaintOperation.cc b/source/blender/compositor/operations/COM_InpaintOperation.cc index 413ed2694a9..bfcd504177f 100644 --- a/source/blender/compositor/operations/COM_InpaintOperation.cc +++ b/source/blender/compositor/operations/COM_InpaintOperation.cc @@ -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); diff --git a/source/blender/compositor/operations/COM_ScaleOperation.cc b/source/blender/compositor/operations/COM_ScaleOperation.cc index ef34bc7bee6..bbb6de2f39e 100644 --- a/source/blender/compositor/operations/COM_ScaleOperation.cc +++ b/source/blender/compositor/operations/COM_ScaleOperation.cc @@ -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); diff --git a/source/blender/compositor/operations/COM_SplitOperation.cc b/source/blender/compositor/operations/COM_SplitOperation.cc index d18ed3b8e14..b2a50e2c740 100644 --- a/source/blender/compositor/operations/COM_SplitOperation.cc +++ b/source/blender/compositor/operations/COM_SplitOperation.cc @@ -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); } diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cc b/source/blender/compositor/operations/COM_VectorBlurOperation.cc index b5b5d426338..df65044afc1 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.cc +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cc @@ -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; diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cc b/source/blender/compositor/operations/COM_ViewerOperation.cc index 37a45ac32cb..a038e8994d8 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.cc +++ b/source/blender/compositor/operations/COM_ViewerOperation.cc @@ -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); diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cc b/source/blender/compositor/operations/COM_WriteBufferOperation.cc index e2dc6287baf..6380f6bf3df 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.cc +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cc @@ -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 *clMemToCleanUp = new std::list(); clMemToCleanUp->push_back(clOutputBuffer); std::list *clKernelsToCleanUp = new std::list(); @@ -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); diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h index 47dad17b482..aa184cce433 100644 --- a/source/blender/depsgraph/DEG_depsgraph.h +++ b/source/blender/depsgraph/DEG_depsgraph.h @@ -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? */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc index b9ce29ce8d2..bf3af571f0b 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc @@ -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 queue; Set 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> driver_groups; PointerRNA id_ptr; @@ -197,47 +197,47 @@ void DepsgraphRelationBuilder::build_driver_relations(IDNode *id_node) } for (Span 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; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc index e0a7a42ea4a..bad4e96c60b 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_keys.cc @@ -28,7 +28,7 @@ namespace blender::deg { //////////////////////////////////////////////////////////////////////////////// -// Time source. +/* Time source. */ TimeSourceKey::TimeSourceKey() : id(nullptr) { diff --git a/source/blender/depsgraph/intern/debug/deg_time_average.h b/source/blender/depsgraph/intern/debug/deg_time_average.h index 838ceff8d96..4ed78fe70cb 100644 --- a/source/blender/depsgraph/intern/debug/deg_time_average.h +++ b/source/blender/depsgraph/intern/debug/deg_time_average.h @@ -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 class AveragedTimeSampler { public: AveragedTimeSampler() : num_samples_(0), next_sample_index_(0) @@ -38,13 +37,13 @@ template 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 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_; }; diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc index df1cf8cc771..770d9775dd3 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc @@ -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; } diff --git a/source/blender/depsgraph/intern/depsgraph_registry.cc b/source/blender/depsgraph/intern/depsgraph_registry.cc index f348ef6e6e9..cc9fcf78292 100644 --- a/source/blender/depsgraph/intern/depsgraph_registry.cc +++ b/source/blender/depsgraph/intern/depsgraph_registry.cc @@ -49,7 +49,7 @@ void unregister_graph(Depsgraph *depsgraph) VectorSet &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); } diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc index 431bf536b65..a29618cefa8 100644 --- a/source/blender/depsgraph/intern/node/deg_node_component.cc +++ b/source/blender/depsgraph/intern/node/deg_node_component.cc @@ -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); diff --git a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c index 1af489b60ce..ae37d6c8deb 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c @@ -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 diff --git a/source/blender/editors/space_graph/graph_view.c b/source/blender/editors/space_graph/graph_view.c index 036fd354c18..c38c5f09a2a 100644 --- a/source/blender/editors/space_graph/graph_view.c +++ b/source/blender/editors/space_graph/graph_view.c @@ -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; diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c index 59a17fcc600..df516d2a5c4 100644 --- a/source/blender/imbuf/intern/iris.c +++ b/source/blender/imbuf/intern/iris.c @@ -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 */ diff --git a/source/blender/io/alembic/tests/abc_matrix_test.cc b/source/blender/io/alembic/tests/abc_matrix_test.cc index c6d7245a52c..2706699d994 100644 --- a/source/blender/io/alembic/tests/abc_matrix_test.cc +++ b/source/blender/io/alembic/tests/abc_matrix_test.cc @@ -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" diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index baed2aa2866..e899e6bd3ec 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -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) */ diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 454d843112a..3b65378f9eb 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -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), diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 822b8705c9b..4b4c24a7a4e 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -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; -- cgit v1.2.3