From 78602846e5891ce8dd7a6ee6f9eb5dedf57706a6 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 5 Mar 2024 00:41:55 +0800 Subject: [PATCH] all: fix typos in comments (#20963) --- ROADMAP.md | 2 +- examples/gg/arcs_and_slices.v | 2 +- examples/gg/path_finding_algorithm_visualizer/README.md | 2 +- examples/gg/path_finding_algorithm_visualizer/aStar.v | 2 +- thirdparty/fontstash/stb_truetype.h | 2 +- thirdparty/libgc/gc.c | 4 ++-- thirdparty/mbedtls/include/mbedtls/asn1write.h | 2 +- thirdparty/mbedtls/library/debug.c | 2 +- thirdparty/mbedtls/library/ssl_client.c | 2 +- thirdparty/sokol/util/sokol_gl.h | 2 +- vlib/benchmark/benchmark.v | 2 +- vlib/builtin/js/string.js.v | 6 +++--- vlib/builtin/string.v | 8 ++++---- vlib/builtin/wasm/builtin.v | 4 ++-- vlib/math/stats/stats.v | 2 +- vlib/regex/regex_opt.v | 4 ++-- vlib/regex/regex_util.v | 2 +- vlib/v/ast/types.v | 2 +- vlib/v/checker/checker.v | 2 +- vlib/v2/parser/parser.v | 2 +- vlib/x/vweb/sse/README.md | 2 +- 21 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 4663f59a1..d2a3c0d85 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -46,7 +46,7 @@ - [ ] Custom attributes - [ ] `arr.first() or { }` like `arr[0] or { }` - [ ] ORM migrations -- [ ] Contexts that are passed implicitely (e.g. for custom allocation/memory management) +- [ ] Contexts that are passed implicitly (e.g. for custom allocation/memory management) ## [Version 1.0] diff --git a/examples/gg/arcs_and_slices.v b/examples/gg/arcs_and_slices.v index 6270dc3a9..3c240ae2a 100644 --- a/examples/gg/arcs_and_slices.v +++ b/examples/gg/arcs_and_slices.v @@ -9,7 +9,7 @@ const win_height = 800 const bg_color = gx.white // A transparent color is used to aid in verifying that -// rendering is precise on each of the the arc types (e.g. no overlapping or double rendered slices) +// rendering is precise on each of the arc types (e.g. no overlapping or double rendered slices) const colour = gx.rgba(100, 100, 0, 100) enum Selection { diff --git a/examples/gg/path_finding_algorithm_visualizer/README.md b/examples/gg/path_finding_algorithm_visualizer/README.md index 82dbe9704..a4e39c72c 100644 --- a/examples/gg/path_finding_algorithm_visualizer/README.md +++ b/examples/gg/path_finding_algorithm_visualizer/README.md @@ -24,7 +24,7 @@ $ ./aStar # Demo ![Demo image of the algorithm](screenshot.png) -# 🔴🔴🔴🔴 Area of improvments 🔴🔴🔴🔴🔴 +# 🔴🔴🔴🔴 Area of improvements 🔴🔴🔴🔴🔴 - 🚧 Under Construction: We are using heap, but that is not correctly implemented, since instead of O(log(n)) it takes O(n). For that reason, diff --git a/examples/gg/path_finding_algorithm_visualizer/aStar.v b/examples/gg/path_finding_algorithm_visualizer/aStar.v index 6080146af..645060d97 100644 --- a/examples/gg/path_finding_algorithm_visualizer/aStar.v +++ b/examples/gg/path_finding_algorithm_visualizer/aStar.v @@ -86,7 +86,7 @@ fn main() { init_fn: init_images // run at start of application user_data: app // store user data ) - mut grid := initialise_grid() // initialize the grid varibale and populate the matrix with each cell as empty + mut grid := initialise_grid() // initialize the grid variable and populate the matrix with each cell as empty app.grid = grid // set grid to app attribute so you can access it by just passing app variable or with method of app app.ui.dpi_scale = 1.0 // set scale this is use to make it responsive app.start = &Point{ // set start point to -1, -1 diff --git a/thirdparty/fontstash/stb_truetype.h b/thirdparty/fontstash/stb_truetype.h index c67891da9..e15faa1a9 100644 --- a/thirdparty/fontstash/stb_truetype.h +++ b/thirdparty/fontstash/stb_truetype.h @@ -651,7 +651,7 @@ STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip); // If skip != 0, this tells stb_truetype to skip any codepoints for which // there is no corresponding glyph. If skip=0, which is the default, then -// codepoints without a glyph recived the font's "missing character" glyph, +// codepoints without a glyph received the font's "missing character" glyph, // typically an empty box by convention. STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above diff --git a/thirdparty/libgc/gc.c b/thirdparty/libgc/gc.c index 95c29136b..abf4ea707 100644 --- a/thirdparty/libgc/gc.c +++ b/thirdparty/libgc/gc.c @@ -6592,7 +6592,7 @@ GC_INNER GC_bool GC_collection_in_progress(void); /* Collection is in progress, or was abandoned. */ /* Push contents of the symbol residing in the static roots area */ -/* excluded from scanning by the the collector for a reason. */ +/* excluded from scanning by the collector for a reason. */ /* Note: it should be used only for symbols of relatively small size */ /* (one or several words). */ #define GC_PUSH_ALL_SYM(sym) GC_push_all_eager(&(sym), &(sym) + 1) @@ -7917,7 +7917,7 @@ typedef struct { /* to allow it to be distinguished from a free list */ /* link. This means the plain version must have the least */ /* significant bit of zero. Note that blocks dropped by */ - /* black-listing will also have the the least significant */ + /* black-listing will also have the least significant */ /* bit clear once debugging has started; we are careful */ /* never to overwrite such a value. */ # if ALIGNMENT == 1 diff --git a/thirdparty/mbedtls/include/mbedtls/asn1write.h b/thirdparty/mbedtls/include/mbedtls/asn1write.h index d60ca0daa..e696e8a4c 100644 --- a/thirdparty/mbedtls/include/mbedtls/asn1write.h +++ b/thirdparty/mbedtls/include/mbedtls/asn1write.h @@ -352,7 +352,7 @@ int mbedtls_asn1_write_octet_string( unsigned char **p, const unsigned char *sta * the existing buffer to fit \p val_len. * * \return A pointer to the new / existing entry on success. - * \return \c NULL if if there was a memory allocation error. + * \return \c NULL if there was a memory allocation error. */ mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list, const char *oid, size_t oid_len, diff --git a/thirdparty/mbedtls/library/debug.c b/thirdparty/mbedtls/library/debug.c index fa60d13f3..4c231e961 100644 --- a/thirdparty/mbedtls/library/debug.c +++ b/thirdparty/mbedtls/library/debug.c @@ -121,7 +121,7 @@ void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level, /* * With non-blocking I/O and examples that just retry immediately, * the logs would be quickly flooded with WANT_READ, so ignore that. - * Don't ignore WANT_WRITE however, since is is usually rare. + * Don't ignore WANT_WRITE however, since is usually rare. */ if( ret == MBEDTLS_ERR_SSL_WANT_READ ) return; diff --git a/thirdparty/mbedtls/library/ssl_client.c b/thirdparty/mbedtls/library/ssl_client.c index 20f1aff4b..1e0f2b238 100644 --- a/thirdparty/mbedtls/library/ssl_client.c +++ b/thirdparty/mbedtls/library/ssl_client.c @@ -732,7 +732,7 @@ static int ssl_prepare_client_hello( mbedtls_ssl_context *ssl ) /* * Generate the random bytes, except when responding to a verify request - * where we MUST reuse the previoulsy generated random bytes + * where we MUST reuse the previously generated random bytes * (RFC 6347 4.2.1). */ #if defined(MBEDTLS_SSL_PROTO_DTLS) diff --git a/thirdparty/sokol/util/sokol_gl.h b/thirdparty/sokol/util/sokol_gl.h index d1a3c4e1e..0855312b0 100644 --- a/thirdparty/sokol/util/sokol_gl.h +++ b/thirdparty/sokol/util/sokol_gl.h @@ -453,7 +453,7 @@ sgl_set_context(ctx); - The currently active context will implicitely be used by most sokol-gl functions + The currently active context will implicitly be used by most sokol-gl functions which don't take an explicit context handle as argument. To switch back to the default context, pass the global constant SGL_DEFAULT_CONTEXT: diff --git a/vlib/benchmark/benchmark.v b/vlib/benchmark/benchmark.v index 6103d3c97..58ee4b171 100644 --- a/vlib/benchmark/benchmark.v +++ b/vlib/benchmark/benchmark.v @@ -52,7 +52,7 @@ pub fn new_benchmark_pointer() &Benchmark { } } -// set_total_expected_steps sets the the total amount of steps the benchmark is expected to take. +// set_total_expected_steps sets the total amount of steps the benchmark is expected to take. pub fn (mut b Benchmark) set_total_expected_steps(n int) { b.nexpected_steps = n } diff --git a/vlib/builtin/js/string.js.v b/vlib/builtin/js/string.js.v index 427534c4c..6bf61cf56 100644 --- a/vlib/builtin/js/string.js.v +++ b/vlib/builtin/js/string.js.v @@ -438,7 +438,7 @@ pub fn (mut s []string) sort_ignore_case() { s.sort_with_compare(compare_lower_strings) } -// sort_by_len sorts the the string array by each string's `.len` length. +// sort_by_len sorts the string array by each string's `.len` length. pub fn (mut s []string) sort_by_len() { s.sort_with_compare(compare_strings_by_len) } @@ -749,7 +749,7 @@ fn (s string) index_last_(p string) int { return -1 } -// index_last returns the position of the first character of the *last* occurance of the `needle` string in `s`. +// index_last returns the position of the first character of the *last* occurrence of the `needle` string in `s`. pub fn (s string) index_last(needle string) ?int { idx := s.index_last_(needle) if idx == -1 { @@ -758,7 +758,7 @@ pub fn (s string) index_last(needle string) ?int { return idx } -// last_index returns the position of the first character of the *last* occurance of the `needle` string in `s`. +// last_index returns the position of the first character of the *last* occurrence of the `needle` string in `s`. @[deprecated: 'use `.index_last(needle string)` instead'] @[deprecated_after: '2023-12-18'] @[inline] diff --git a/vlib/builtin/string.v b/vlib/builtin/string.v index 3f835ff75..3ccfce118 100644 --- a/vlib/builtin/string.v +++ b/vlib/builtin/string.v @@ -1205,7 +1205,7 @@ fn (s string) index_(p string) int { return -1 } -// index returns the position of the first character of the first occurance of the `needle` string in `s`. +// index returns the position of the first character of the first occurrence of the `needle` string in `s`. // It will return `none` if the `needle` string can't be found in `s`. pub fn (s string) index(p string) ?int { idx := s.index_(p) @@ -1215,7 +1215,7 @@ pub fn (s string) index(p string) ?int { return idx } -// index_last returns the position of the first character of the *last* occurance of the `needle` string in `s`. +// index_last returns the position of the first character of the *last* occurrence of the `needle` string in `s`. pub fn (s string) index_last(needle string) ?int { idx := s.index_last_(needle) if idx == -1 { @@ -1224,7 +1224,7 @@ pub fn (s string) index_last(needle string) ?int { return idx } -// last_index returns the position of the first character of the *last* occurance of the `needle` string in `s`. +// last_index returns the position of the first character of the *last* occurrence of the `needle` string in `s`. @[deprecated: 'use `.index_last(needle string)` instead'] @[deprecated_after: '2023-12-18'] @[inline] @@ -1805,7 +1805,7 @@ pub fn (mut s []string) sort_ignore_case() { s.sort_with_compare(compare_lower_strings) } -// sort_by_len sorts the the string array by each string's `.len` length. +// sort_by_len sorts the string array by each string's `.len` length. @[inline] pub fn (mut s []string) sort_by_len() { s.sort_with_compare(compare_strings_by_len) diff --git a/vlib/builtin/wasm/builtin.v b/vlib/builtin/wasm/builtin.v index 763f09839..f44c59c83 100644 --- a/vlib/builtin/wasm/builtin.v +++ b/vlib/builtin/wasm/builtin.v @@ -12,7 +12,7 @@ pub fn vwasm_heap_base() voidptr { } // vwasm_heap_size returns the size of the main wasm memory in pages. -// Analagous to the `memory.size` instruction. +// Analogous to the `memory.size` instruction. pub fn vwasm_memory_size() int { mut rval := 0 asm wasm { @@ -24,7 +24,7 @@ pub fn vwasm_memory_size() int { } // vwasm_memory_grow grows the main wasm memory by `size` pages. -// Analagous to the `memory.grow` instruction. +// Analogous to the `memory.grow` instruction. pub fn vwasm_memory_grow(size int) int { mut rval := 0 asm wasm { diff --git a/vlib/math/stats/stats.v b/vlib/math/stats/stats.v index 894509401..7aad706e7 100644 --- a/vlib/math/stats/stats.v +++ b/vlib/math/stats/stats.v @@ -2,7 +2,7 @@ module stats import math -// freq calculates the Measure of Occurance +// freq calculates the Measure of Occurrence // Frequency of a given number // Based on // https://www.mathsisfun.com/data/frequency-distribution.html diff --git a/vlib/regex/regex_opt.v b/vlib/regex/regex_opt.v index e686a0a59..660e06833 100644 --- a/vlib/regex/regex_opt.v +++ b/vlib/regex/regex_opt.v @@ -22,7 +22,7 @@ pub fn new() RE { // init regex mut re := RE{} re.prog = []Token{len: max_code_len + 1} // max program length, can not be longer then the pattern - re.cc = []CharClass{len: max_code_len} // can not be more char class the the length of the pattern + re.cc = []CharClass{len: max_code_len} // can not be more char class the length of the pattern re.group_csave_flag = false // enable continuos group saving re.group_max_nested = 128 // set max 128 group nested re.group_max = max_code_len >> 1 // we can't have more groups than the half of the pattern legth @@ -38,7 +38,7 @@ pub fn regex_opt(pattern string) !RE { // init regex mut re := RE{} re.prog = []Token{len: pattern.len + 1} // max program length, can not be longer then the pattern - re.cc = []CharClass{len: pattern.len} // can not be more char class the the length of the pattern + re.cc = []CharClass{len: pattern.len} // can not be more char class the length of the pattern re.group_csave_flag = false // enable continuos group saving re.group_max_nested = pattern.len >> 1 // set max 128 group nested re.group_max = pattern.len >> 1 // we can't have more groups than the half of the pattern legth diff --git a/vlib/regex/regex_util.v b/vlib/regex/regex_util.v index bb7f0de55..1a982e23a 100644 --- a/vlib/regex/regex_util.v +++ b/vlib/regex/regex_util.v @@ -20,7 +20,7 @@ pub fn regex_base(pattern string) (RE, int, int) { // init regex mut re := RE{} re.prog = []Token{len: pattern.len + 1} // max program length, can not be longer then the pattern - re.cc = []CharClass{len: pattern.len} // can not be more char class the the length of the pattern + re.cc = []CharClass{len: pattern.len} // can not be more char class the length of the pattern re.group_csave_flag = false // enable continuos group saving re.group_max_nested = pattern.len >> 1 // set max 128 group nested re.group_max = pattern.len >> 1 // we can't have more groups than the half of the pattern legth diff --git a/vlib/v/ast/types.v b/vlib/v/ast/types.v index d75ce7025..005ed172e 100644 --- a/vlib/v/ast/types.v +++ b/vlib/v/ast/types.v @@ -776,7 +776,7 @@ pub enum Kind { thread } -// str returns the the internal & source name of the type +// str returns the internal & source name of the type pub fn (t TypeSymbol) str() string { return t.name } diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 2aaf3593f..e035865a6 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -2343,7 +2343,7 @@ fn (mut c Checker) hash_stmt(mut node ast.HashStmt) { node.ct_conds = c.ct_cond_stack.clone() } if c.pref.backend.is_js() || c.pref.backend == .golang { - // consider the the best way to handle the .go.vv files + // consider the best way to handle the .go.vv files if !c.file.path.ends_with('.js.v') && !c.file.path.ends_with('.go.v') && !c.file.path.ends_with('.go.vv') { c.error('hash statements are only allowed in backend specific files such "x.js.v" and "x.go.v"', diff --git a/vlib/v2/parser/parser.v b/vlib/v2/parser/parser.v index 464d36dff..b52fc4f10 100644 --- a/vlib/v2/parser/parser.v +++ b/vlib/v2/parser/parser.v @@ -408,7 +408,7 @@ fn (mut p Parser) expr(min_bp token.BindingPower) ast.Expr { // to currently do this is to check for an ident where the name's first char is a capital, this is not // great at all, and would be the only place in the parser where a capital letter is relied upon, or even // the name at all is relied upon. imo this is context the parser should not need, and we should either - // change the varibale capture syntax, or move the position of the capture list, for example: + // change the variable capture syntax, or move the position of the capture list, for example: // change syntax: `fn [T] () { ... }`, move position: `fn [T] () { ... } [var_a, var_b]` // personally I think `fn [T] () { ... }` is a great option. mut captured_vars := []ast.Expr{} diff --git a/vlib/x/vweb/sse/README.md b/vlib/x/vweb/sse/README.md index 147d3a059..222ce475b 100644 --- a/vlib/x/vweb/sse/README.md +++ b/vlib/x/vweb/sse/README.md @@ -12,7 +12,7 @@ keep sending events to the client. But if we hold the connection open indefinite vweb isn't able to process any other requests. We can let vweb know that it can continue processing other requests and that we will -handle the connection ourself by calling `ctx.takeover_conn()` and and returning an empty result +handle the connection ourself by calling `ctx.takeover_conn()` and returning an empty result with `vweb.no_result()`. Vweb will not close the connection and we can handle the connection in a separate thread. -- 2.39.5