Cleanup: spelling in comments

This commit is contained in:
Campbell Barton 2021-10-06 14:44:27 +11:00
parent bf35dba7fb
commit df8f507f41
26 changed files with 42 additions and 45 deletions

View File

@ -37,7 +37,7 @@ ccl_device void shader_setup_object_transforms(const KernelGlobals *ccl_restrict
#endif
/* TODO: break this up if it helps reduce register pressure to load data from
* global memory as we write it to shaderdata. */
* global memory as we write it to shader-data. */
ccl_device_inline void shader_setup_from_ray(const KernelGlobals *ccl_restrict kg,
ShaderData *ccl_restrict sd,
const Ray *ccl_restrict ray,

View File

@ -780,8 +780,8 @@ ccl_device_inline void shader_eval_volume(INTEGRATOR_STATE_CONST_ARGS,
break;
}
/* setup shaderdata from stack. it's mostly setup already in
* shader_setup_from_volume, this switching should be quick */
/* Setup shader-data from stack. it's mostly setup already in
* shader_setup_from_volume, this switching should be quick. */
sd->object = entry.object;
sd->lamp = LAMP_NONE;
sd->shader = entry.shader;

View File

@ -190,7 +190,7 @@ enum SamplingPattern {
SAMPLING_NUM_PATTERNS,
};
/* these flags values correspond to raytypes in osl.cpp, so keep them in sync! */
/* These flags values correspond to `raytypes` in `osl.cpp`, so keep them in sync! */
enum PathRayFlag {
/* --------------------------------------------------------------------

View File

@ -142,7 +142,7 @@ const char *GHOST_SystemPathsUnix::getUserSpecialDir(GHOST_TUserSpecialDirTypes
}
static string path = "";
/* Pipe stderr to /dev/null to avoid error prints. We will fail gracefully still. */
/* Pipe `stderr` to `/dev/null` to avoid error prints. We will fail gracefully still. */
string command = string("xdg-user-dir ") + type_str + " 2> /dev/null";
FILE *fstream = popen(command.c_str(), "r");
@ -152,7 +152,7 @@ const char *GHOST_SystemPathsUnix::getUserSpecialDir(GHOST_TUserSpecialDirTypes
std::stringstream path_stream;
while (!feof(fstream)) {
char c = fgetc(fstream);
/* xdg-user-dir ends the path with '\n'. */
/* `xdg-user-dir` ends the path with '\n'. */
if (c == '\n') {
break;
}

View File

@ -1044,7 +1044,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
#ifdef USE_NON_LATIN_KB_WORKAROUND
/* XXX: Code below is kinda awfully convoluted... Issues are:
* - In keyboards like latin ones, numbers need a 'Shift' to be accessed but key_sym
* - In keyboards like Latin ones, numbers need a 'Shift' to be accessed but key_sym
* is unmodified (or anyone swapping the keys with `xmodmap`).
* - #XLookupKeysym seems to always use first defined key-map (see T47228), which generates
* key-codes unusable by ghost_key_from_keysym for non-Latin-compatible key-maps.
@ -1131,7 +1131,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
}
}
#else
/* In keyboards like latin ones,
/* In keyboards like Latin ones,
* numbers needs a 'Shift' to be accessed but key_sym
* is unmodified (or anyone swapping the keys with xmodmap).
*

View File

@ -152,7 +152,7 @@ typedef struct FontBufInfoBLF {
struct ColorManagedDisplay *display;
/* and the color, the alphas is get from the glyph!
* color is srgb space */
* color is sRGB space */
float col_init[4];
/* cached conversion from 'col_init' */
unsigned char col_char[4];

View File

@ -221,7 +221,7 @@ static void bmbvh_tri_from_face(const float *cos[3],
}
}
/* taken from bvhutils.c */
/* Taken from `bvhutils.c`. */
/* -------------------------------------------------------------------- */
/* BKE_bmbvh_ray_cast */

View File

@ -1560,9 +1560,9 @@ bool BKE_imtype_requires_linear_float(const char imtype)
char BKE_imtype_valid_channels(const char imtype, bool write_file)
{
char chan_flag = IMA_CHAN_FLAG_RGB; /* assume all support rgb */
char chan_flag = IMA_CHAN_FLAG_RGB; /* Assume all support RGB. */
/* alpha */
/* Alpha. */
switch (imtype) {
case R_IMF_IMTYPE_BMP:
if (write_file) {
@ -1583,7 +1583,7 @@ char BKE_imtype_valid_channels(const char imtype, bool write_file)
break;
}
/* bw */
/* BW. */
switch (imtype) {
case R_IMF_IMTYPE_BMP:
case R_IMF_IMTYPE_PNG:
@ -3078,8 +3078,7 @@ int BKE_imbuf_write_as(ImBuf *ibuf, const char *name, ImageFormatData *imf, cons
ImBuf ibuf_back = *ibuf;
int ok;
/* all data is rgba anyway,
* this just controls how to save for some formats */
/* All data is RGBA anyway, this just controls how to save for some formats. */
ibuf->planes = imf->planes;
ok = BKE_imbuf_write(ibuf, name, imf);
@ -4611,7 +4610,7 @@ static ImBuf *load_image_single(Image *ima,
image_init_after_load(ima, iuser, ibuf);
*r_assign = true;
/* make packed file for autopack */
/* Make packed file for auto-pack. */
if ((has_packed == false) && (G.fileflags & G_FILE_AUTOPACK)) {
ImagePackedFile *imapf = MEM_mallocN(sizeof(ImagePackedFile), "Image Pack-file");
BLI_addtail(&ima->packedfiles, imapf);

View File

@ -151,7 +151,7 @@ BLI_INLINE unsigned int clampis_uint(const unsigned int v,
}
/* --------------------------------------------------------------------- */
/* local structs for mask rasterizeing */
/* local structs for mask rasterizing */
/* --------------------------------------------------------------------- */
/**

View File

@ -342,12 +342,12 @@ VFont *BKE_vfont_load(Main *bmain, const char *filepath)
vfont->data = vfd;
BLI_strncpy(vfont->filepath, filepath, sizeof(vfont->filepath));
/* if autopack is on store the packedfile in de font structure */
/* if auto-pack is on store the packed-file in de font structure */
if (!is_builtin && (G.fileflags & G_FILE_AUTOPACK)) {
vfont->packedfile = pf;
}
/* Do not add FO_BUILTIN_NAME to temporary listbase */
/* Do not add #FO_BUILTIN_NAME to temporary list-base. */
if (!STREQ(filename, FO_BUILTIN_NAME)) {
vfont->temp_pf = BKE_packedfile_new(NULL, filepath, BKE_main_blendfile_path(bmain));
}
@ -694,7 +694,7 @@ struct TempLineInfo {
float x_min; /* left margin */
float x_max; /* right margin */
int char_nr; /* number of characters */
int wspace_nr; /* number of whitespaces of line */
int wspace_nr; /* number of white-spaces of line */
};
/* -------------------------------------------------------------------- */
@ -803,7 +803,7 @@ static bool vfont_to_curve(Object *ob,
float longest_line_length = 0.0f;
/* Text at the beginning of the last used text-box (use for y-axis alignment).
* We overallocate by one to simplify logic of getting last char. */
* We over-allocate by one to simplify logic of getting last char. */
int *i_textbox_array = MEM_callocN(sizeof(*i_textbox_array) * (cu->totbox + 1),
"TextBox initial char index");
@ -1136,7 +1136,7 @@ static bool vfont_to_curve(Object *ob,
}
}
/* linedata is now: width of line */
/* Line-data is now: width of line. */
if (cu->spacemode != CU_ALIGN_X_LEFT) {
ct = chartransdata;
@ -1500,7 +1500,7 @@ static bool vfont_to_curve(Object *ob,
chartransdata = NULL;
}
else if (mode == FO_EDIT) {
/* make nurbdata */
/* Make NURBS-data. */
BKE_nurbList_free(r_nubase);
ct = chartransdata;

View File

@ -100,7 +100,7 @@ static VChar *freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *
/* Start converting the FT data */
onpoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int), "onpoints");
/* get number of on-curve points for beziertriples (including conic virtual on-points) */
/* Get number of on-curve points for bezier-triples (including conic virtual on-points). */
for (j = 0, contour_prev = -1; j < ftoutline.n_contours; j++) {
const int n = ftoutline.contours[j] - contour_prev;
contour_prev = ftoutline.contours[j];

View File

@ -31,7 +31,7 @@
*
* A main benefit of using Array over Vector is that it expresses the intent of the developer
* better. It indicates that the size of the data structure is not expected to change. Furthermore,
* you can be more certain that an array does not overallocate.
* you can be more certain that an array does not over-allocate.
*
* blender::Array supports small object optimization to improve performance when the size turns out
* to be small at run-time.

View File

@ -2557,7 +2557,7 @@ double ui_but_value_get(uiBut *but)
void ui_but_value_set(uiBut *but, double value)
{
/* value is a hsv value: convert to rgb */
/* Value is a HSV value: convert to RGB. */
if (but->rnaprop) {
PropertyRNA *prop = but->rnaprop;

View File

@ -697,7 +697,7 @@ static bool bake_targets_init_image_textures(const BakeAPIRender *bkr,
}
}
/* Overallocate in case there is more materials than images. */
/* Over-allocate in case there is more materials than images. */
targets->num_materials = num_materials;
targets->images = MEM_callocN(sizeof(BakeImage) * targets->num_materials, "BakeTargets.images");
targets->material_to_image = MEM_callocN(sizeof(int) * targets->num_materials,

View File

@ -1343,7 +1343,7 @@ static ImBuf *icon_preview_imbuf_from_brush(Brush *brush)
BLI_strncpy(path, brush->icon_filepath, sizeof(brush->icon_filepath));
BLI_path_abs(path, ID_BLEND_PATH_FROM_GLOBAL(&brush->id));
/* use default colorspaces for brushes */
/* Use default color-spaces for brushes. */
brush->icon_imbuf = IMB_loadiffname(path, flags, NULL);
/* otherwise lets try to find it in other directories */

View File

@ -780,9 +780,9 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
immUniformThemeColorShadeAlpha(TH_VIEW_OVERLAY, 100, 255);
/* TODO: Was using:
* UI_draw_roundbox_4fv(false, rect.xmin, rect.ymin, rect.xmax, rect.ymax, 2.0f, color);
* We'll probably need a new imm_draw_line_roundbox_dashed dor that - though in practice the
* 2.0f round corner effect was nearly not visible anyway... */
* `UI_draw_roundbox_4fv(false, rect.xmin, rect.ymin, rect.xmax, rect.ymax, 2.0f, color);`
* We'll probably need a new imm_draw_line_roundbox_dashed or that - though in practice the
* 2.0f round corner effect was nearly not visible anyway. */
imm_draw_box_wire_2d(shdr_pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
}

View File

@ -848,7 +848,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
chanel_colormanage_cb = channel_colormanage_noop;
}
else {
/* standard linear-to-srgb conversion if float buffer wasn't managed */
/* standard linear-to-SRGB conversion if float buffer wasn't managed */
chanel_colormanage_cb = linearrgb_to_srgb;
}

View File

@ -221,7 +221,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac
string ics = spec.get_string_attribute("oiio:ColorSpace");
BLI_strncpy(file_colorspace, ics.c_str(), IM_MAX_SPACE);
/* only use colorspaces exis */
/* Only use color-spaces exist. */
if (colormanage_colorspace_get_named(file_colorspace)) {
strcpy(colorspace, file_colorspace);
}

View File

@ -153,7 +153,7 @@ bool imb_savepng(struct ImBuf *ibuf, const char *filepath, int flags)
chanel_colormanage_cb = channel_colormanage_noop;
}
else {
/* standard linear-to-srgb conversion if float buffer wasn't managed */
/* Standard linear-to-SRGB conversion if float buffer wasn't managed. */
chanel_colormanage_cb = linearrgb_to_srgb;
}

View File

@ -895,9 +895,7 @@ bool imb_savetiff(ImBuf *ibuf, const char *filepath, int flags)
copy_v3_v3(rgb, &fromf[from_i]);
}
else {
/* Standard linear-to-srgb conversion if float buffer
* wasn't managed.
*/
/* Standard linear-to-SRGB conversion if float buffer wasn't managed. */
linearrgb_to_srgb_v3_v3(rgb, &fromf[from_i]);
}
if (channels_in_float == 4) {

View File

@ -20,7 +20,7 @@
/** \file
* \ingroup avi
*
* This is external code. Converts rgb-type avi-s.
* This is external code. Converts RGB-type AVI files.
*/
#include <stdlib.h>

View File

@ -260,7 +260,7 @@ typedef struct ColorGpencilModifierData {
int pass_index;
/** Flags. */
int flag;
/** Hsv factors. */
/** HSV factors. */
float hsv[3];
/** Modify stroke, fill or both. */
char modify_color;

View File

@ -205,8 +205,8 @@ static void node_shader_exec_rgbtobw(void *UNUSED(data),
bNodeStack **in,
bNodeStack **out)
{
/* stack order out: bw */
/* stack order in: col */
/* Stack order out: BW. */
/* Stack order in: COL. */
float col[3];
nodestack_get_vec(col, SOCK_VECTOR, in[0]);

View File

@ -7238,7 +7238,7 @@ static PyObject *pyrna_srna_ExternalType(StructRNA *srna)
/* Sanity check, could skip this unless in debug mode. */
if (newclass) {
PyObject *base_compare = pyrna_srna_PyBase(srna);
/* Can't do this because it gets superclasses values! */
/* Can't do this because it gets super-classes values! */
// PyObject *slots = PyObject_GetAttrString(newclass, "__slots__");
/* Can do this, but faster not to. */
// PyObject *bases = PyObject_GetAttrString(newclass, "__bases__");

View File

@ -745,7 +745,7 @@ static int mg_distNoiseTex(const Tex *tex, const float texvec[3], TexResult *tex
/* ------------------------------------------------------------------------- */
/* newnoise: Voronoi texture type
*
* probably the slowest, especially with minkovsky, bumpmapping, could be done another way.
* probably the slowest, especially with minkovsky, bump-mapping, could be done another way.
*/
static int voronoiTex(const Tex *tex, const float texvec[3], TexResult *texres)

View File

@ -164,13 +164,13 @@ struct traits<
* \brief A conjugate gradient solver for sparse self-adjoint problems with additional constraints
*
* This class allows to solve for A.x = b sparse linear problems using a conjugate gradient
* algorithm. The sparse matrix A must be selfadjoint. The vectors x and b can be either dense or
* algorithm. The sparse matrix A must be self-adjoint. The vectors x and b can be either dense or
* sparse.
*
* \tparam _MatrixType the type of the sparse matrix A, can be a dense or a sparse matrix.
* \tparam _UpLo the triangular part that will be used for the computations. It can be Lower
* or Upper. Default is Lower.
* \tparam _Preconditioner the type of the preconditioner. Default is DiagonalPreconditioner
* \tparam _Preconditioner the type of the pre-conditioner. Default is #DiagonalPreconditioner
*
* The maximal number of iterations and tolerance value can be controlled via the
* setMaxIterations() and setTolerance() methods. The defaults are the size of the problem for the