Cleanup: spelling in comments, use doxygen doc-strings

This commit is contained in:
Campbell Barton
2023-07-31 10:15:30 +10:00
parent d5fc5c5a04
commit 724755879e
32 changed files with 78 additions and 62 deletions
@@ -20,9 +20,9 @@ extern "C" {
* \note Use #STRINGIFY() rather than defining with quotes.
*/
/* Blender major and minor version. */
/** Blender major and minor version. */
#define BLENDER_VERSION 400
/* Blender patch version for bug-fix releases. */
/** Blender patch version for bug-fix releases. */
#define BLENDER_VERSION_PATCH 0
/** Blender release cycle stage: alpha/beta/rc/release. */
#define BLENDER_VERSION_CYCLE alpha
@@ -42,17 +42,19 @@ extern "C" {
/** User readable version string. */
const char *BKE_blender_version_string(void);
/* Returns true when version cycle is alpha, otherwise (beta, rc) returns false. */
/** Returns true when version cycle is alpha, otherwise (beta, rc) returns false. */
bool BKE_blender_version_is_alpha(void);
/** Fill in given string buffer with user-readable formated file version and subversion (if
/**
* Fill in given string buffer with user-readable formatted file version and subversion (if
* provided).
*
* \param str_buff a char buffer where the formated string is written, minimal recommended size is
* \param str_buff a char buffer where the formatted string is written, minimal recommended size is
* 8, or 16 if subversion is provided.
*
* \param file_subversion the file subversion, if given value < 0, it is ignored, and only the
* `file_version` is used. */
* `file_version` is used.
*/
void BKE_blender_version_blendfile_string_from_values(char *str_buff,
const size_t str_buff_len,
const short file_version,
+2 -1
View File
@@ -2792,7 +2792,8 @@ static void nlastrip_evaluate_transition(const int evaluation_mode,
anim_eval_context,
flush_to_original);
/** Replace \a snapshot2 nullptr channels with base or default values so all channels blend.
/**
* Replace \a snapshot2 nullptr channels with base or default values so all channels blend.
*/
nlasnapshot_ensure_channels(channels, &snapshot2);
/** Mark all \a snapshot2 channel's values to blend. */
@@ -548,7 +548,8 @@ static int reuse_bmain_data_invalid_local_usages_fix_cb(LibraryIDLinkCallbackDat
return IDWALK_RET_NOP;
}
/** Detect and fix invalid usages of locale IDs by linked ones (or as reference of liboverrides).
/**
* Detect and fix invalid usages of locale IDs by linked ones (or as reference of liboverrides).
*/
static void reuse_bmain_data_invalid_local_usages_fix(ReuseOldBMainData *reuse_data)
{
+8 -5
View File
@@ -570,7 +570,7 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab
void blo_readfile_invalidate(FileData *fd, Main *bmain, const char *message)
{
/* Tag given bmain, and 'root 'local' main one (in case given one is a library one) as invalid.
/* Tag given `bmain`, and 'root 'local' main one (in case given one is a library one) as invalid.
*/
bmain->is_read_invalid = true;
for (; bmain->prev != nullptr; bmain = bmain->prev)
@@ -727,7 +727,7 @@ static BHeadN *get_bhead(FileData *fd)
bh4_from_bh8(&bhead, &bhead8, (fd->flags & FD_FLAGS_SWITCH_ENDIAN) != 0);
}
else {
/* MIN2 is only to quiet '-Warray-bounds' compiler warning. */
/* MIN2 is only to quiet `-Warray-bounds` compiler warning. */
BLI_assert(sizeof(bhead) == sizeof(bhead8));
memcpy(&bhead, &bhead8, MIN2(sizeof(bhead), sizeof(bhead8)));
}
@@ -1081,8 +1081,11 @@ static FileData *filedata_new(BlendFileReadReport *reports)
return fd;
}
/** Check if minversion of the file is older than current Blender, return false if it is not.
* Should only be called after #read_file_dna was successfuly executed. */
/**
* Check if #FileGlobal::minversion of the file is older than current Blender,
* return false if it is not.
* Should only be called after #read_file_dna was successfully executed.
*/
static bool is_minversion_older_than_blender(FileData *fd, ReportList *reports)
{
BLI_assert(fd->filesdna != nullptr);
@@ -1188,7 +1191,7 @@ static FileData *blo_filedata_from_file_descriptor(const char *filepath,
/* Try opening the file with memory-mapped IO. */
file = BLI_filereader_new_mmap(filedes);
if (file == nullptr) {
/* mmap failed, so just keep using rawfile. */
/* `mmap` failed, so just keep using `rawfile`. */
file = rawfile;
rawfile = nullptr;
}
@@ -792,11 +792,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
sound = static_cast<bSound *>(sound->id.next);
}
/* me->subdiv changed to reflect the actual reparametization
* better, and smeshes were removed - if it was a smesh make
* it a subsurf, and reset the subdiv level because subsurf
* takes a lot more work to calculate.
*/
/* `me->subdiv` changed to reflect the actual reparametization
* better, and S-meshes were removed - if it was a S-mesh make
* it a subsurf, and reset the subdivision level because subsurf
* takes a lot more work to calculate. */
for (me = static_cast<Mesh *>(bmain->meshes.first); me; me = static_cast<Mesh *>(me->id.next))
{
enum {
@@ -1192,9 +1191,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
wrld = static_cast<World *>(wrld->id.next);
}
/* new variable blockscale, for panels in any area, do again because new
* areas didn't initialize it to 0.7 yet
*/
/* New variable block-scale, for panels in any area, do again because new
* areas didn't initialize it to 0.7 yet. */
for (screen = static_cast<bScreen *>(bmain->screens.first); screen;
screen = static_cast<bScreen *>(screen->id.next))
{
+2 -2
View File
@@ -1406,9 +1406,9 @@ BMFace *bmesh_kernel_split_face_make_edge(BMesh *bm,
} while ((l_iter = l_iter->next) != l_first);
if (first_loop_f1) {
/* original first loop was in f1, find a suitable first loop for f2
/* Original first loop was in f1, find a suitable first loop for f2
* which is as similar as possible to f1. the order matters for tools
* such as duplifaces. */
* such as dupli-faces. */
if (f->l_first->prev == l_f1) {
f2->l_first = l_f2->prev;
}
+1 -1
View File
@@ -28,7 +28,7 @@
*/
#include <cstdlib>
#include <cstring> /* for memcpy */
#include <cstring> /* For `memcpy`. */
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
@@ -228,7 +228,7 @@ void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op)
normal_tri_v3(dvec2, v1->co, v4->co, v3->co);
#else
{
/* save some CPU cycles and skip the sqrt and 1 subtraction */
/* Save some CPU cycles and skip the `sqrt` and 1 subtraction. */
float a1[3], a2[3], a3[3];
sub_v3_v3v3(a1, v1->co, v2->co);
sub_v3_v3v3(a2, v1->co, v4->co);
@@ -191,7 +191,7 @@ void BM_mesh_wireframe(BMesh *bm,
MEM_mallocN(sizeof(float) * totvert_orig, __func__) :
nullptr);
/* may over-alloc if not all faces have wire */
/* May over-allocate if not all faces have wire. */
BMVert **verts_loop;
int verts_loop_tot = 0;
@@ -10,7 +10,7 @@
#include "MEM_guardedalloc.h"
#include <cstring> /* XXX: memcpy */
#include <cstring> /* XXX: `memcpy`. */
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
@@ -355,13 +355,13 @@ static void eevee_cryptomatte_download_buffer(EEVEE_Data *vedata, GPUFrameBuffer
GPU_DATA_FLOAT,
download_buffer);
/* Integrate download buffer into the accum buffer.
/* Integrate download buffer into the accumulation buffer.
* The download buffer contains up to 3 floats per pixel (one float per cryptomatte layer.
*
* NOTE: here we deviate from the cryptomatte standard. During integration the standard always
* sort the samples by its weight to make sure that samples with the lowest weight
* are discarded first. In our case the weight of each sample is always 1 as we don't have
* subsamples and apply the coverage during the post processing. When there is no room for new
* sub-samples and apply the coverage during the post processing. When there is no room for new
* samples the new samples has a weight of 1 and will always be discarded. */
int download_pixel_index = 0;
int accum_pixel_index = 0;
@@ -424,7 +424,7 @@ void EEVEE_cryptomatte_output_accumulate(EEVEE_ViewLayerData * /*sldata*/, EEVEE
void EEVEE_cryptomatte_update_passes(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
{
/* NOTE: Name channels lowercase rgba so that compression rules check in OpenEXR DWA code uses
/* NOTE: Name channels lowercase RGBA so that compression rules check in OpenEXR DWA code uses
* lossless compression. Reportedly this naming is the only one which works good from the
* interoperability point of view. Using XYZW naming is not portable. */
@@ -458,7 +458,7 @@ void eevee_id_update(void *vedata, ID *id)
static void eevee_render_reset_passes(EEVEE_Data *vedata)
{
/* Reset passlist. This is safe as they are stored into managed memory chunks. */
/* Reset pass-list. This is safe as they are stored into managed memory chunks. */
memset(vedata->psl, 0, sizeof(*vedata->psl));
}
@@ -1099,7 +1099,7 @@ void EEVEE_lightbake_filter_diffuse(EEVEE_ViewLayerData *sldata,
int y = size[1] * (grid_offset / cell_per_row);
#ifndef IRRADIANCE_SH_L2
/* Tweaking parameters to balance perf. vs precision */
/* Tweaking parameters to balance performance vs precision. */
const float bias = 0.0f;
pinfo->lodfactor = bias + 0.5f * log(square_f(target_size) / pinfo->samples_len) / log(2);
pinfo->lod_rt_max = log2_floor_u(target_size) - 2.0f;
@@ -154,7 +154,7 @@ static void eevee_shadow_cascade_setup(EEVEE_LightsInfo *linfo,
copy_v3_v3(csm_data->shadow_vec, csm_render->viewinv[2]);
/* Compute near and far value based on all shadow casters cumulated AABBs. */
/* Compute near and far value based on all shadow casters accumulated AABBs. */
float sh_near = -1.0e30f, sh_far = 1.0e30f;
BoundBox shcaster_bounds;
BKE_boundbox_init_from_minmax(
@@ -150,7 +150,7 @@ static void eevee_ensure_cube_views(
}
}
/* Does a spot angle fits a single cubeface. */
/* Does a spot angle fits a single cube-face. */
static bool spot_angle_fit_single_face(const EEVEE_Light *evli)
{
/* alpha = spot/cone half angle. */
@@ -2012,10 +2012,10 @@ static bool pchan_culling_test_with_radius_scale(const DRWView *view,
/** \name Bone Drawing Strategies
*
* Bone drawing uses a strategy pattern for the different armature drawing modes.
*
* \{ */
/** Bone drawing strategy for unknown draw types.
/**
* Bone drawing strategy for unknown draw types.
* This doesn't do anything, except call the default matrix update function.
*/
class ArmatureBoneDrawStrategyEmpty : public ArmatureBoneDrawStrategy {
@@ -2491,7 +2491,8 @@ class ArmatureBoneDrawStrategyWire : public ArmatureBoneDrawStrategy {
};
namespace {
/** Armature drawing strategies.
/**
* Armature drawing strategies.
*
* Declared statically here because they cost almost no memory (no fields in any
* of the structs, so just the virtual function table), and this makes it very
@@ -143,7 +143,7 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata)
const float *full_size = DRW_viewport_size_get();
const int size[2] = {max_ii(1, int(full_size[0]) / 2), max_ii(1, int(full_size[1]) / 2)};
#if 0 /* TODO(fclem): finish COC min_max optimization. */
/* NOTE: We Ceil here in order to not miss any edge texel if using a NPO2 texture. */
/* NOTE: We `ceil` here in order to not miss any edge texel if using a NPO2 texture. */
int shrink_h_size[2] = {ceilf(size[0] / 8.0f), size[1]};
int shrink_w_size[2] = {shrink_h_size[0], ceilf(size[1] / 8.0f)};
#endif
+2 -2
View File
@@ -1536,7 +1536,7 @@ void DRW_draw_callbacks_post_scene()
/* XXX: Or should we use a proper draw/overlay engine for this case? */
if (((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) && (do_annotations)) {
GPU_depth_test(GPU_DEPTH_NONE);
/* XXX: as scene->gpd is not copied for COW yet */
/* XXX: as `scene->gpd` is not copied for COW yet */
ED_annotation_draw_view3d(DEG_get_input_scene(depsgraph), depsgraph, v3d, region, false);
}
@@ -1559,7 +1559,7 @@ void DRW_draw_callbacks_post_scene()
else {
if (v3d && ((v3d->flag2 & V3D_SHOW_ANNOTATION) != 0)) {
GPU_depth_test(GPU_DEPTH_NONE);
/* XXX: as scene->gpd is not copied for COW yet */
/* XXX: as `scene->gpd` is not copied for COW yet */
ED_annotation_draw_view3d(DEG_get_input_scene(depsgraph), depsgraph, v3d, region, true);
GPU_depth_test(GPU_DEPTH_LESS_EQUAL);
}
@@ -3045,7 +3045,7 @@ static void gpencil_draw_apply_event(bContext *C,
/* get stroke angle for grids */
if (ELEM(guide->type, GP_GUIDE_ISO)) {
p->guide.stroke_angle = atan2f(pt[1], pt[0]);
/* determine iso angle, less weight is given for vertical strokes */
/* Determine ISO angle, less weight is given for vertical strokes. */
if (((p->guide.stroke_angle >= 0.0f) && (p->guide.stroke_angle < DEG2RAD(75))) ||
(p->guide.stroke_angle < DEG2RAD(-105)))
{
@@ -1853,7 +1853,7 @@ static void edittranslation_find_po_file(const char *root,
return;
}
/* Now try without the second iso code part (_ES in es_ES). */
/* Now try without the second ISO code part (`_ES` in `es_ES`). */
{
const char *tc = nullptr;
size_t szt = 0;
@@ -63,7 +63,7 @@ void AbstractView::update_from_old(uiBlock &new_block)
/** \} */
/* ---------------------------------------------------------------------- */
/** \name State Managment
/** \name State Management
* \{ */
void AbstractView::change_state_delayed()
+3 -3
View File
@@ -230,12 +230,12 @@ static std::ostream &operator<<(std::ostream &stream, const GPUConstant *input)
{
stream << input->type << "(";
for (int i = 0; i < input->type; i++) {
char formated_float[32];
char formatted_float[32];
/* Use uint representation to allow exact same bit pattern even if NaN. This is because we can
* pass UINTs as floats for constants. */
const uint32_t *uint_vec = reinterpret_cast<const uint32_t *>(input->vec);
SNPRINTF(formated_float, "uintBitsToFloat(%uu)", uint_vec[i]);
stream << formated_float;
SNPRINTF(formatted_float, "uintBitsToFloat(%uu)", uint_vec[i]);
stream << formatted_float;
if (i < input->type - 1) {
stream << ", ";
}
+1 -1
View File
@@ -645,7 +645,7 @@ void IMB_buffer_float_premultiply(float *buf, int width, int height);
/**
* Change the ordering of the color bytes pointed to by rect from
* rgba to abgr. size * 4 color bytes are reordered.
* RGBA to ABGR. size * 4 color bytes are reordered.
*
* \attention Defined in imageprocess.c
*
@@ -1111,7 +1111,8 @@ typedef enum eChildOf_Flags {
CHILDOF_SET_INVERSE = (1 << 9),
} eChildOf_Flags;
/** Pivot Constraint
/**
* Pivot Constraint
*
* Restrictions for Pivot Constraint axis to consider for enabling constraint.
*/
+14 -7
View File
@@ -1237,8 +1237,10 @@ static int rna_BlenderRNA_structs_lookup_string(PointerRNA *ptr,
/* Default override (and compare) callbacks. */
/* Ensures it makes sense to go inside the pointers to compare their content
* (if they are IDs, or have different names or RNA type, then this would be meaningless). */
/**
* Ensures it makes sense to go inside the pointers to compare their content
* (if they are IDs, or have different names or RNA type, then this would be meaningless).
*/
struct RNACompareOverrideDiffPropPtrContext {
/** General RNA diffing context. */
RNAPropertyOverrideDiffContext &rnadiff_ctx;
@@ -1250,11 +1252,15 @@ struct RNACompareOverrideDiffPropPtrContext {
PointerRNA propptr_b = {0};
PropertyType property_type = PROP_BOOLEAN;
/** Indicates the RNA structure cintaining that RNA pointer does not own the data it points to.
* See also #PROP_PTR_NO_OWNERSHIP documentation. */
/**
* Indicates the RNA structure containing that RNA pointer does not own the data it points to.
* See also #PROP_PTR_NO_OWNERSHIP documentation.
*/
bool no_ownership = false;
/** RNA collection items: do not attempt to get the item property name (i.e. only uses its
* index). */
/**
* RNA collection items: do not attempt to get the item property name
* (i.e. only uses its index).
*/
bool no_prop_name = false;
/** RNA collection items: forcefully get an item property name, even if one of the items is
* null/doesn't have one. Mutually exclusive with `no_prop_name`. */
@@ -1269,7 +1275,8 @@ struct RNACompareOverrideDiffPropPtrContext {
int rna_itemindex_a = -1;
int rna_itemindex_b = -1;
/** Status info, usually set by a call to #rna_property_override_diff_propptr_validate_diffing.
/**
* Status info, usually set by a call to #rna_property_override_diff_propptr_validate_diffing.
*/
/** Indicate whether the two given RNA pointers can be considered 'matching data', i.e. the
* pointers themselves should not be compared, but rather the content of the RNA structs they
@@ -530,7 +530,7 @@ static void initSystem(
if (isValidVertexGroup(lmd, ob, mesh)) {
int *index_anchors = static_cast<int *>(
MEM_malloc_arrayN(verts_num, sizeof(int), __func__)); /* over-alloc */
MEM_malloc_arrayN(verts_num, sizeof(int), __func__)); /* Over-allocate. */
STACK_DECLARE(index_anchors);
@@ -158,7 +158,7 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex
const short mat_ofs_rim = mat_nr_max ? smd->mat_ofs_rim : 0;
/* use for edges */
/* over-alloc new_vert_arr, old_vert_arr */
/* Over-allocate new_vert_arr, old_vert_arr. */
uint *new_vert_arr = nullptr;
STACK_DECLARE(new_vert_arr);
@@ -270,8 +270,8 @@ int imagewrap(Tex *tex,
texres->trgba[3] = 1.0f - texres->trgba[3];
}
/* de-premul, this is being pre-multiplied in shade_input_do_shade()
* do not de-premul for generated alpha, it is already in straight */
/* De-pre-multiply, this is being pre-multiplied in #shade_input_do_shade()
* do not de-pre-multiply for generated alpha, it is already in straight. */
if (texres->trgba[3] != 1.0f && texres->trgba[3] > 1e-4f && !(tex->imaflag & TEX_CALCALPHA)) {
fx = 1.0f / texres->trgba[3];
texres->trgba[0] *= fx;
@@ -3988,7 +3988,7 @@ static void wm_block_file_close_save(bContext *C, void *arg_block, void *arg_dat
if (file_has_been_saved_before) {
if (bmain->has_forward_compatibility_issues) {
/* Need to invoke to get the filebrowser and choose where to save the new file.
/* Need to invoke to get the file-browser and choose where to save the new file.
* This also makes it impossible to keep on going with current operation, which is why
* callback cannot be executed anymore.
*
@@ -71,7 +71,7 @@ typedef struct wmMsgSubscribeKey {
/** Linked list for predictable ordering, otherwise we would depend on #GHash bucketing. */
struct wmMsgSubscribeKey *next, *prev;
ListBase values;
/* over-alloc, eg: wmMsgSubscribeKey_RNA */
/* Over-allocate, eg: #wmMsgSubscribeKey_RNA */
/* Last member will be 'wmMsg_*' */
} wmMsgSubscribeKey;
+1 -1
View File
@@ -90,7 +90,7 @@ bool wm_operator_close_file_dialog_if_needed(bContext *C,
*/
bool wm_file_or_session_data_has_unsaved_changes(const Main *bmain, const wmWindowManager *wm);
/**
* Confirmation dialog when user is about to save the current blend file, and it was prviously
* Confirmation dialog when user is about to save the current blend file, and it was previously
* created by a newer version of Blender.
*
* Important to ask confirmation, as this is a very common scenario of data loss.
@@ -76,6 +76,8 @@ dict_custom = {
"criterium",
"crosshair",
"crosstalk",
"cumulate",
"cumulated",
"customizable",
"deallocate",
"deallocated",