Cleanup: spelling in comments

This commit is contained in:
Campbell Barton 2022-07-04 15:16:24 +10:00
parent faa97de208
commit 148dcb3954
16 changed files with 63 additions and 53 deletions

View File

@ -378,7 +378,7 @@ static eUnicodeBlock unicode_blocks[] = {
{0xFE30, 0xFE4F, 65}, /* CJK Compatibility Forms. */
{0xFE50, 0xFE6F, 66}, /* Small Form Variants. */
{0xFE70, 0xFEFF, 67}, /* Arabic Presentation Forms-B. */
{0xFF00, 0xFFEF, 68}, /* Halfwidth And Fullwidth Forms. */
{0xFF00, 0xFFEF, 68}, /* Half-width And Full-width Forms. */
{0xFFF0, 0xFFFF, 69}, /* Specials. */
{0x10000, 0x1013F, 101}, /* Linear B. */
{0x10140, 0x1018F, 102}, /* Ancient Greek Numbers. */

View File

@ -87,7 +87,7 @@ void BLF_thumb_preview(const char *filepath,
font->pos[1] -= (int)((float)blf_font_ascender(font) * 1.1f);
/* We fallback to default english strings in case not enough chars are available in current
* font for given translated string (useful in non-latin i18n context, like Chinese,
* font for given translated string (useful in non-Latin i18n context, like Chinese,
* since many fonts will then show nothing but ugly 'missing char' in their preview).
* Does not handle all cases, but much better than nothing.
*/

View File

@ -198,7 +198,7 @@ struct Image *BKE_image_add_from_imbuf(struct Main *bmain, struct ImBuf *ibuf, c
* For a non-viewer single-buffer image (single frame file, or generated image) replace its image
* buffer with the given one.
* If an unsupported image type (multi-layer, image sequence, ...) the function will assert in the
* debug mode and will have an underfined behavior in the release mode.
* debug mode and will have an undefined behavior in the release mode.
*/
void BKE_image_replace_imbuf(struct Image *image, struct ImBuf *ibuf);

View File

@ -2839,7 +2839,7 @@ ImBuf *BKE_tracking_get_plane_imbuf(const ImBuf *frame_ibuf,
ImBuf *plane_ibuf = IMB_allocImBuf(
num_samples_x, num_samples_y, 32, frame_ibuf->rect_float ? IB_rectfloat : IB_rect);
/* Calculate corner coordinates in pixel space, as spearate X/Y arrays. */
/* Calculate corner coordinates in pixel space, as separate X/Y arrays. */
const double src_pixel_x[4] = {corners[0][0] * frame_width,
corners[1][0] * frame_width,
corners[2][0] * frame_width,

View File

@ -37,8 +37,8 @@ Node *COM_convert_bnode(bNode *b_node);
bool COM_bnode_is_fast_node(const bNode &b_node);
/**
* \brief This function will add a datetype conversion rule when the to-socket does not support the
* from-socket actual data type.
* \brief This function will add a date-type conversion rule when the to-socket does not support
* the from-socket actual data type.
*/
NodeOperation *COM_convert_data_type(const NodeOperationOutput &from,
const NodeOperationInput &to);

View File

@ -264,7 +264,7 @@ static void txtfmt_lua_format_line(SpaceText *st, TextLine *line, const bool do_
cont = (*str == '"') ? FMT_CONT_QUOTEDOUBLE : FMT_CONT_QUOTESINGLE;
*fmt = FMT_TYPE_STRING;
}
/* White-space (all ws. has been converted to spaces). */
/* White-space (all white-space has been converted to spaces). */
else if (*str == ' ') {
*fmt = FMT_TYPE_WHITESPACE;
}
@ -287,18 +287,19 @@ static void txtfmt_lua_format_line(SpaceText *st, TextLine *line, const bool do_
else if ((*str != '#') && text_check_delim(*str)) {
*fmt = FMT_TYPE_SYMBOL;
}
/* Identifiers and other text (no previous ws. or delims. so text continues) */
/* Identifiers and other text (no previous white-space/delimiters so text continues). */
else if (prev == FMT_TYPE_DEFAULT) {
str += BLI_str_utf8_size_safe(str) - 1;
*fmt = FMT_TYPE_DEFAULT;
}
/* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
/* Not white-space, a digit, punctuation, or continuing text.
* Must be new, check for special words. */
else {
/* Keep aligned args for readability. */
/* Keep aligned arguments for readability. */
/* clang-format off */
/* Special vars(v) or built-in keywords(b) */
/* keep in sync with 'txtfmt_osl_format_identifier()' */
/* Special `vars(v)` or built-in `keywords(b)` */
/* keep in sync with `txtfmt_osl_format_identifier()`. */
if ((i = txtfmt_lua_find_specialvar(str)) != -1) { prev = FMT_TYPE_SPECIAL;
} else if ((i = txtfmt_lua_find_keyword(str)) != -1) { prev = FMT_TYPE_KEYWORD;
}

View File

@ -285,7 +285,7 @@ static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const bool do_
cont = (*str == '"') ? FMT_CONT_QUOTEDOUBLE : FMT_CONT_QUOTESINGLE;
*fmt = FMT_TYPE_STRING;
}
/* White-space (all ws. has been converted to spaces). */
/* White-space (all white-space has been converted to spaces). */
else if (*str == ' ') {
*fmt = FMT_TYPE_WHITESPACE;
}
@ -298,18 +298,19 @@ static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const bool do_
else if ((*str != '#') && text_check_delim(*str)) {
*fmt = FMT_TYPE_SYMBOL;
}
/* Identifiers and other text (no previous ws. or delims. so text continues) */
/* Identifiers and other text (no previous white-space or delimiters. so text continues). */
else if (prev == FMT_TYPE_DEFAULT) {
str += BLI_str_utf8_size_safe(str) - 1;
*fmt = FMT_TYPE_DEFAULT;
}
/* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
/* Not white-space, a digit, punctuation, or continuing text.
* Must be new, check for special words. */
else {
/* Keep aligned args for readability. */
/* Keep aligned arguments for readability. */
/* clang-format off */
/* Special vars(v) or built-in keywords(b) */
/* keep in sync with 'txtfmt_osl_format_identifier()' */
/* keep in sync with `txtfmt_osl_format_identifier()`. */
if ((i = txtfmt_osl_find_specialvar(str)) != -1) { prev = FMT_TYPE_SPECIAL;
} else if ((i = txtfmt_osl_find_builtinfunc(str)) != -1) { prev = FMT_TYPE_KEYWORD;
} else if ((i = txtfmt_osl_find_reserved(str)) != -1) { prev = FMT_TYPE_RESERVED;

View File

@ -857,7 +857,7 @@ static void txtfmt_pov_format_line(SpaceText *st, TextLine *line, const bool do_
cont = (*str == '"') ? FMT_CONT_QUOTEDOUBLE : FMT_CONT_QUOTESINGLE;
*fmt = FMT_TYPE_STRING;
}
/* White-space (all ws. has been converted to spaces). */
/* White-space (all white-space has been converted to spaces). */
else if (*str == ' ') {
*fmt = FMT_TYPE_WHITESPACE;
}
@ -880,18 +880,19 @@ static void txtfmt_pov_format_line(SpaceText *st, TextLine *line, const bool do_
else if (text_check_delim(*str)) {
*fmt = FMT_TYPE_SYMBOL;
}
/* Identifiers and other text (no previous ws. or delims. so text continues) */
/* Identifiers and other text (no previous white-space/delimiters so text continues). */
else if (prev == FMT_TYPE_DEFAULT) {
str += BLI_str_utf8_size_safe(str) - 1;
*fmt = FMT_TYPE_DEFAULT;
}
/* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
/* Not white-space, a digit, punctuation, or continuing text.
* Must be new, check for special words. */
else {
/* Keep aligned args for readability. */
/* Keep aligned arguments for readability. */
/* clang-format off */
/* Special vars(v) or built-in keywords(b) */
/* keep in sync with 'txtfmt_pov_format_identifier()' */
/* keep in sync with `txtfmt_pov_format_identifier()`. */
if ((i = txtfmt_pov_find_specialvar(str)) != -1) { prev = FMT_TYPE_SPECIAL;
} else if ((i = txtfmt_pov_find_keyword(str)) != -1) { prev = FMT_TYPE_KEYWORD;
} else if ((i = txtfmt_pov_find_reserved_keywords(str)) != -1) { prev = FMT_TYPE_RESERVED;

View File

@ -435,7 +435,7 @@ static void txtfmt_pov_ini_format_line(SpaceText *st, TextLine *line, const bool
cont = (*str == '"') ? FMT_CONT_QUOTEDOUBLE : FMT_CONT_QUOTESINGLE;
*fmt = FMT_TYPE_STRING;
}
/* White-space (all ws. has been converted to spaces). */
/* White-space (all white-space has been converted to spaces). */
else if (*str == ' ') {
*fmt = FMT_TYPE_WHITESPACE;
}
@ -458,18 +458,19 @@ static void txtfmt_pov_ini_format_line(SpaceText *st, TextLine *line, const bool
else if ((*str != '#') && text_check_delim(*str)) {
*fmt = FMT_TYPE_SYMBOL;
}
/* Identifiers and other text (no previous ws. or delims. so text continues) */
/* Identifiers and other text (no previous white-space/delimiters so text continues). */
else if (prev == FMT_TYPE_DEFAULT) {
str += BLI_str_utf8_size_safe(str) - 1;
*fmt = FMT_TYPE_DEFAULT;
}
/* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
/* Not white-space, a digit, punctuation, or continuing text.
* Must be new, check for special words */
else {
/* Keep aligned args for readability. */
/* Keep aligned arguments for readability. */
/* clang-format off */
/* Special vars(v) or built-in keywords(b) */
/* keep in sync with 'txtfmt_ini_format_identifier()' */
/* keep in sync with `txtfmt_ini_format_identifier()`. */
if ((i = txtfmt_ini_find_keyword(str)) != -1) { prev = FMT_TYPE_KEYWORD;
} else if ((i = txtfmt_ini_find_reserved(str)) != -1) { prev = FMT_TYPE_RESERVED;
}

View File

@ -425,7 +425,7 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const bool do_n
}
*fmt = FMT_TYPE_STRING;
}
/* White-space (all ws. has been converted to spaces). */
/* White-space (all white-space has been converted to spaces). */
else if (*str == ' ') {
*fmt = FMT_TYPE_WHITESPACE;
}
@ -447,18 +447,19 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const bool do_n
else if ((*str != '@') && text_check_delim(*str)) {
*fmt = FMT_TYPE_SYMBOL;
}
/* Identifiers and other text (no previous ws. or delims. so text continues) */
/* Identifiers and other text (no previous white-space/delimiters so text continues). */
else if (prev == FMT_TYPE_DEFAULT) {
str += BLI_str_utf8_size_safe(str) - 1;
*fmt = FMT_TYPE_DEFAULT;
}
/* Not ws, a digit, punct, or continuing text. Must be new, check for special words */
/* Not white-space, a digit, punctuation, or continuing text.
* Must be new, check for special words. */
else {
/* Keep aligned args for readability. */
/* Keep aligned arguments for readability. */
/* clang-format off */
/* Special vars(v) or built-in keywords(b) */
/* keep in sync with 'txtfmt_py_format_identifier()' */
/* keep in sync with `txtfmt_py_format_identifier()`. */
if ((i = txtfmt_py_find_specialvar(str)) != -1) { prev = FMT_TYPE_SPECIAL;
} else if ((i = txtfmt_py_find_builtinfunc(str)) != -1) { prev = FMT_TYPE_KEYWORD;
} else if ((i = txtfmt_py_find_decorator(str)) != -1) { prev = FMT_TYPE_DIRECTIVE;

View File

@ -411,7 +411,7 @@ static bool uvedit_uv_align_weld(Scene *scene,
return changed;
}
/* Bitwise-or together, then choose MLoopUV with highest value. */
/** Bitwise-or together, then choose #MLoopUV with highest value. */
typedef enum eUVEndPointPrecedence {
UVEP_INVALID = 0,
UVEP_SELECTED = (1 << 0),
@ -427,7 +427,8 @@ static eUVEndPointPrecedence uvedit_line_update_get_precedence(const MLoopUV *lu
return precedence;
}
/* Helper to find two endpoints (`a` and `b`) which have higher precedence, and are far apart.
/**
* Helper to find two endpoints (`a` and `b`) which have higher precedence, and are far apart.
* Note that is only a heuristic and won't always find the best two endpoints.
*/
static bool uvedit_line_update_endpoint(const MLoopUV *luv,
@ -442,7 +443,7 @@ static bool uvedit_line_update_endpoint(const MLoopUV *luv,
float len_sq_b = len_squared_v2v2(uv_b, luv->uv);
/* Caching the value of `len_sq_ab` is unlikely to be faster than recalculating.
* Profile before optmizing. */
* Profile before optimizing. */
float len_sq_ab = len_squared_v2v2(uv_a, uv_b);
if ((*prec_a < flags && 0.0f < len_sq_b) || (*prec_a == flags && len_sq_ab < len_sq_b)) {
@ -460,7 +461,8 @@ static bool uvedit_line_update_endpoint(const MLoopUV *luv,
return false;
}
/* Find two end extreme points to specify a line, then straighten `len` elements
/**
* Find two end extreme points to specify a line, then straighten `len` elements
* by moving UVs on the X-axis, Y-axis, or the closest point on the line segment.
*/
static bool uvedit_uv_straighten_elements(const UvElement *element,
@ -532,7 +534,9 @@ static bool uvedit_uv_straighten_elements(const UvElement *element,
return changed;
}
/* Group selected UVs into islands, then apply uvedit_uv_straighten_elements to each island. */
/**
* Group selected UVs into islands, then apply uvedit_uv_straighten_elements to each island.
*/
static bool uvedit_uv_straighten(Scene *scene, BMesh *bm, eUVWeldAlign tool)
{
const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);

View File

@ -127,7 +127,7 @@ void MTLBackend::render_end()
void MTLBackend::render_step()
{
/* NOTE(Metal): Primarily called from main thread, but below datastructures
/* NOTE(Metal): Primarily called from main thread, but below data-structures
* and operations are thread-safe, and GPUContext rendering coordination
* is also thread-safe. */

View File

@ -10,7 +10,7 @@
#define MTL_MAX_COMMAND_BUFFERS 64
/* Number of frames for which we retain in-flight resources such as scratch buffers.
* Set as number of GPU frames in flight, plus an additioanl value for extra possible CPU frame. */
* Set as number of GPU frames in flight, plus an additional value for extra possible CPU frame. */
#define MTL_NUM_SAFE_FRAMES (MTL_MAX_DRAWABLES + 1)
#endif

View File

@ -16,7 +16,7 @@ using namespace blender::gpu;
namespace blender::gpu {
/* Global memory mamnager */
/* Global memory manager. */
MTLBufferPool MTLContext::global_memory_manager;
/* -------------------------------------------------------------------- */
@ -51,7 +51,7 @@ MTLContext::MTLContext(void *ghost_window) : memory_manager(*this), main_command
this->memory_manager.init();
this->state_manager = new MTLStateManager(this);
/* Ensure global memory manager is initialied */
/* Ensure global memory manager is initialized. */
MTLContext::global_memory_manager.init(this->device);
/* Initialize texture read/update structures. */

View File

@ -23,7 +23,7 @@
* The Metal Backend Memory manager is designed to provide an interface
* for all other MTL_* modules where memory allocation is required.
*
* Different allocation strategies and datastructures are used depending
* Different allocation strategies and data-structures are used depending
* on how the data is used by the backend. These aim to optimally handle
* system memory and abstract away any complexity from the MTL_* modules
* themselves.
@ -107,8 +107,8 @@ class MTLBuffer {
/* Metal resource. */
id<MTLBuffer> metal_buffer_;
/* Host-visible mapped-memory pointer. Behaviour depends on buffer type:
* - Shared buffers: pointer represents base address of MTLBuffer whose data
/* Host-visible mapped-memory pointer. Behavior depends on buffer type:
* - Shared buffers: pointer represents base address of #MTLBuffer whose data
* access has shared access by both the CPU and GPU on
* Unified Memory Architectures (UMA).
* - Managed buffer: Host-side mapped buffer region for CPU (Host) access. Managed buffers
@ -350,14 +350,14 @@ class MTLBufferPool {
bool ensure_initialised_ = false;
id<MTLDevice> device_ = nil;
/* The buffer selection aims to pick a buffer which meets the minimum size requierments.
/* The buffer selection aims to pick a buffer which meets the minimum size requirements.
* To do this, we keep an ordered set of all available buffers. If the buffer is larger than the
* desired allocation size, we check it aginst `mtl_buffer_size_threshold_factor_`, which defines
* what % larger than the original allocation the buffer can be.
* desired allocation size, we check it against `mtl_buffer_size_threshold_factor_`,
* which defines what % larger than the original allocation the buffer can be.
* - A higher value results in greater re-use of previously allocated buffers of similar sizes.
* - A lower value may result in more dynamic allocations, but minimised memory usage for a given
* - A lower value may result in more dynamic allocations, but minimized memory usage for a given
* scenario.
* The current value of 1.26 is calibrated for optimal performance and memory utilisation. */
* The current value of 1.26 is calibrated for optimal performance and memory utilization. */
static constexpr float mtl_buffer_size_threshold_factor_ = 1.26;
/* Buffer pools using MTLResourceOptions as key for allocation type.
@ -453,7 +453,8 @@ class MTLScratchBufferManager {
MTLScratchBufferManager(MTLContext &context) : context_(context){};
~MTLScratchBufferManager();
/* Explicit initialisation and freeing of resources. Init must occur after device creation. */
/* Explicit initialization and freeing of resources.
* Initialization must occur after device creation. */
void init();
void free();

View File

@ -58,7 +58,7 @@ void MTLBufferPool::free()
gpu::MTLBuffer *MTLBufferPool::allocate_buffer(uint64_t size, bool cpu_visible, const void *bytes)
{
/* Allocate buffer with default HW-compatible alignemnt of 256 bytes.
/* Allocate buffer with default HW-compatible alignment of 256 bytes.
* See https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf for more. */
return this->allocate_buffer_aligned(size, 256, cpu_visible, bytes);
}
@ -342,7 +342,7 @@ void MTLBufferPool::insert_buffer_into_pool(MTLResourceOptions options, gpu::MTL
/* Ensure pool exists. */
this->ensure_buffer_pool(options);
/* TODO(Metal): Support purgability - Allow buffer in pool to have its memory taken back by the
/* TODO(Metal): Support purgeability - Allow buffer in pool to have its memory taken back by the
* OS if needed. As we keep allocations around, they may not actually be in use, but we can
* ensure they do not block other apps from using memory. Upon a buffer being needed again, we
* can reset this state.
@ -615,7 +615,7 @@ void MTLScratchBufferManager::init()
if (!this->initialised_) {
BLI_assert(context_.device);
/* Initialise Scratch buffers */
/* Initialize Scratch buffers. */
for (int sb = 0; sb < mtl_max_scratch_buffers_; sb++) {
scratch_buffers_[sb] = new MTLCircularBuffer(
context_, mtl_scratch_buffer_initial_size_, true);