diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e7d832bec..cb1f3c4558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -284,7 +284,7 @@ - Fix msvc build filename, remove temp files (#23890) - Improve the stability of generated code for auto string methods - Fix codegen for array of anon struct (fix #23896) (#23907) -- Make sure to call the overriden `pub fn (mut a []string) free() {` method, NOT the generic `fn (a &array) free() {` one. (#23911) +- Make sure to call the overridden `pub fn (mut a []string) free() {` method, NOT the generic `fn (a &array) free() {` one. (#23911) - Fix generic container init (fix #23910) (#23912) - Fix codegen for generic structinit and generic array return (fix #23916) (#23943) - Implement alias operator overloading for generic struct parent type (fix #23965) (#23967) @@ -1188,7 +1188,7 @@ - net.http: implement http.download_file_with_progress/2, saving each chunk, as it is received, without growing the memory usage (#21633) - veb: update import name in docs (#21668) - Add `m3u8` MIME type `application/vnd.apple.mpegurl` for multimedia playlists (#21688) -- veb.auth: use constant time comparision in compare_password_with_hash (#21693) +- veb.auth: use constant time comparison in compare_password_with_hash (#21693) - net.http: correct `Response.status()` method comment, to indicate returning of a `Status` enum field, instead of struct (#21735) - net: fix TcpConn.peer_ip/0 to only return the ip address, without the port number (#21831) - Add mime type `text/x-vlang`, for `.v` and `.vsh` file extensions (#21851) diff --git a/cmd/tools/vdoc/testdata/multiline/main.comments.out b/cmd/tools/vdoc/testdata/multiline/main.comments.out index 868af5388b..766eaeed46 100644 --- a/cmd/tools/vdoc/testdata/multiline/main.comments.out +++ b/cmd/tools/vdoc/testdata/multiline/main.comments.out @@ -11,37 +11,37 @@ fn a3() fn a4() This should be merged into one paragraph. - Note: this should be it's own paragraph. + Note: this should be its own paragraph. fn a5() This should be its own paragraph. Note: this should also be it own paragraph - Note: this should be it's own paragraph. + Note: this should be its own paragraph. fn a6() A comment - Fixme: this should be it's own paragraph. + Fixme: this should be its own paragraph. - Fixme: this should be it's own paragraph. + Fixme: this should be its own paragraph. - Fixme: this should be it's own paragraph. + Fixme: this should be its own paragraph. fn a7() A comment - Todo: this should be it's own paragraph. + Todo: this should be its own paragraph. - Todo: this should be it's own paragraph. + Todo: this should be its own paragraph. - Todo: this should be it's own paragraph. + Todo: this should be its own paragraph. fn a8() A comment - Todo: this should be it's own paragraph. + Todo: this should be its own paragraph. - Note: this should be it's own paragraph. + Note: this should be its own paragraph. - Fixme: this should be it's own paragraph. + Fixme: this should be its own paragraph. fn a9() normal comment fn foo() diff --git a/cmd/tools/vdoc/testdata/multiline/main.v b/cmd/tools/vdoc/testdata/multiline/main.v index 9e82c0d02b..62cfe67aa4 100644 --- a/cmd/tools/vdoc/testdata/multiline/main.v +++ b/cmd/tools/vdoc/testdata/multiline/main.v @@ -18,38 +18,38 @@ pub fn a3() { // This should be merged // into one paragraph. -// Note: this should be it's own paragraph. +// Note: this should be its own paragraph. pub fn a4() { println('hi') } // This should be its own paragraph. // NOTE: this should also be it own paragraph -// note: this should be it's own paragraph. +// note: this should be its own paragraph. pub fn a5() { println('hi') } // A comment -// Fixme: this should be it's own paragraph. -// fixme: this should be it's own paragraph. -// FIXME: this should be it's own paragraph. +// Fixme: this should be its own paragraph. +// fixme: this should be its own paragraph. +// FIXME: this should be its own paragraph. pub fn a6() { println('hi') } // A comment -// TODO: this should be it's own paragraph. -// todo: this should be it's own paragraph. -// Todo: this should be it's own paragraph. +// TODO: this should be its own paragraph. +// todo: this should be its own paragraph. +// Todo: this should be its own paragraph. pub fn a7() { println('hi') } // A comment -// TODO: this should be it's own paragraph. -// NOTE: this should be it's own paragraph. -// FIXME: this should be it's own paragraph. +// TODO: this should be its own paragraph. +// NOTE: this should be its own paragraph. +// FIXME: this should be its own paragraph. pub fn a8() { println('hi') } diff --git a/cmd/tools/vls.v b/cmd/tools/vls.v index d66b520abd..319a2cf84e 100644 --- a/cmd/tools/vls.v +++ b/cmd/tools/vls.v @@ -212,7 +212,7 @@ fn (upd VlsUpdater) download_prebuilt() ! { } if has_last_updated_at && !upd.is_force && asset_last_updated_at <= last_updated_at { - upd.log("VLS was already updated to it's latest version.") + upd.log('VLS was already updated to its latest version.') return } @@ -265,7 +265,7 @@ fn (upd VlsUpdater) compile_from_source() ! { upd.log('Updating VLS repo...') pull_result := os.execute('${os.quoted_path(vexe)} retry -- ${git} -C ${vls_src_folder} pull') if !upd.is_force && pull_result.output.trim_space() == 'Already up to date.' { - upd.log("VLS was already updated to it's latest version.") + upd.log('VLS was already updated to its latest version.') return } } diff --git a/cmd/tools/vreduce.v b/cmd/tools/vreduce.v index a1582691ec..5f6b622ed5 100644 --- a/cmd/tools/vreduce.v +++ b/cmd/tools/vreduce.v @@ -342,7 +342,7 @@ fn reduce_scope(content string, error_msg string, command string, do_fmt bool, f outer_modified_smth = true println('') show_code_stats(code) - } else { // if can remove it, no need to go though it's children + } else { // if can remove it, no need to go through its children for i in 0 .. item.children.len { stack.insert(0, &item.children[i]) // breadth first search } @@ -421,7 +421,7 @@ fn reduce_scope(content string, error_msg string, command string, do_fmt bool, f outer_modified_smth = true println('') show_code_stats(code) - } else { // if can remove it, can remove it's children + } else { // if can remove it, can remove its children for i in 0 .. item.children.len { stack << &item.children[i] } diff --git a/cmd/tools/vshader.v b/cmd/tools/vshader.v index f1247adf87..df48904b23 100644 --- a/cmd/tools/vshader.v +++ b/cmd/tools/vshader.v @@ -5,7 +5,7 @@ // vshader aids in generating special shader code C headers via sokol-shdc's 'annotated GLSL' format to any // supported target formats that sokol_gfx supports internally. // -// vshader bootstraps itself by downloading it's own dependencies to a system cache directory on first run. +// vshader bootstraps itself by downloading its own dependencies to a system cache directory on first run. // // Please see https://github.com/floooh/sokol-tools/blob/master/docs/sokol-shdc.md#feature-overview // for a more in-depth overview of the specific tool in use. diff --git a/cmd/tools/vtest-parser.v b/cmd/tools/vtest-parser.v index f6f918f8d8..9dcbd88114 100644 --- a/cmd/tools/vtest-parser.v +++ b/cmd/tools/vtest-parser.v @@ -62,7 +62,7 @@ fn main() { exit(0) } else { // The process supervisor should NOT crash/panic, unlike the workers. - // It's job, is to: + // Its job, is to: // 1) start workers // 2) accumulate results // 3) produce a summary at the end diff --git a/doc/docs.md b/doc/docs.md index d93ad4fa65..2647319bfb 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -6072,7 +6072,7 @@ that are substituted at compile time: - `@BUILD_TIME` => replaced with the build time, for example '12:32:07' . - `@BUILD_TIMESTAMP` => replaced with the build timestamp, for example '1726219885' . Note: `@BUILD_DATE`, `@BUILD_TIME`, `@BUILD_TIMESTAMP` represent times in the UTC timezone. -By default, they are based on the current time of the compilation/build. They can be overriden +By default, they are based on the current time of the compilation/build. They can be overridden by setting the environment variable `SOURCE_DATE_EPOCH`. That is also useful while making releases, since you can use the equivalent of this in your build system/script: `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ;` , and then use `@BUILD_DATE` etc., diff --git a/vlib/crypto/ecdsa/ecdsa.v b/vlib/crypto/ecdsa/ecdsa.v index 3f5a12d083..c33ff9e2c2 100644 --- a/vlib/crypto/ecdsa/ecdsa.v +++ b/vlib/crypto/ecdsa/ecdsa.v @@ -7,7 +7,7 @@ import hash // NID constants // -// NIST P-256 is refered to as secp256r1 and prime256v1, defined as #define NID_X9_62_prime256v1 415 +// NIST P-256 is referred to as secp256r1 and prime256v1, defined as #define NID_X9_62_prime256v1 415 // Different names, but they are all the same. // https://www.rfc-editor.org/rfc/rfc4492.html#appendix-A const nid_prime256v1 = C.NID_X9_62_prime256v1 diff --git a/vlib/encoding/utf8/utf8_util_test.v b/vlib/encoding/utf8/utf8_util_test.v index 1c7ea07d65..381a9480f4 100644 --- a/vlib/encoding/utf8/utf8_util_test.v +++ b/vlib/encoding/utf8/utf8_util_test.v @@ -62,7 +62,7 @@ fn test_raw_indexing() { assert utf8.raw_index(a, 7) == 'g' assert utf8.raw_index(a, 8) == '!' - // test differnt utf8 byte lenghts + // test differnt utf8 byte lengths c := 'a©★🚀' assert utf8.raw_index(c, 0) == 'a' // 1 byte assert utf8.raw_index(c, 1) == '©' // 2 bytes diff --git a/vlib/eventbus/README.md b/vlib/eventbus/README.md index 2521395d4a..f3298aff42 100644 --- a/vlib/eventbus/README.md +++ b/vlib/eventbus/README.md @@ -108,7 +108,7 @@ fn do_work() { ### Notes: -1. Each `EventBus` instance has it's own registry (i.e. there is no global event registry +1. Each `EventBus` instance has its own registry (i.e. there is no global event registry so you can't just subscribe to an event wherever you are. 2. Each `EventBus` has a `Subscriber` instance which will need to be either exposed or you can make small public helper functions specific to your module like (`onPress`, `onError`) and etc. diff --git a/vlib/os/debugger_darwin.c.v b/vlib/os/debugger_darwin.c.v index 44dd22c481..89e9555d8d 100644 --- a/vlib/os/debugger_darwin.c.v +++ b/vlib/os/debugger_darwin.c.v @@ -22,7 +22,7 @@ pub fn debugger_present() bool { // no external debugger exit(0) } else { - // an error occured, a external debugger must be present + // an error occurred, a external debugger must be present exit(1) } } else { diff --git a/vlib/os/debugger_freebsd.c.v b/vlib/os/debugger_freebsd.c.v index 60232c9207..38636f4921 100644 --- a/vlib/os/debugger_freebsd.c.v +++ b/vlib/os/debugger_freebsd.c.v @@ -21,7 +21,7 @@ pub fn debugger_present() bool { // no external debugger exit(0) } else { - // an error occured, a external debugger must be present + // an error occurred, a external debugger must be present exit(1) } } else { diff --git a/vlib/os/debugger_linux.c.v b/vlib/os/debugger_linux.c.v index 63f75e369a..d07bbe5abb 100644 --- a/vlib/os/debugger_linux.c.v +++ b/vlib/os/debugger_linux.c.v @@ -25,7 +25,7 @@ pub fn debugger_present() bool { // no external debugger exit(0) } else { - // an error occured, a external debugger must be present + // an error occurred, a external debugger must be present exit(1) } } else { diff --git a/vlib/v/tests/structs/struct_test.v b/vlib/v/tests/structs/struct_test.v index c7dc4a5775..d01e5c41c7 100644 --- a/vlib/v/tests/structs/struct_test.v +++ b/vlib/v/tests/structs/struct_test.v @@ -211,7 +211,7 @@ mut: b int // private mutable c int // (you can list multiple fields with the same access modifier) pub: - d int // public immmutable (readonly) + d int // public immutable (readonly) pub mut: e int // public, but mutable only in parent module f int // public and mutable both inside and outside parent module diff --git a/vlib/v/type_resolver/comptime_resolver.v b/vlib/v/type_resolver/comptime_resolver.v index 9792209c6b..6d3376ed60 100644 --- a/vlib/v/type_resolver/comptime_resolver.v +++ b/vlib/v/type_resolver/comptime_resolver.v @@ -148,7 +148,7 @@ pub fn (t &ResolverInfo) get_ct_type_var(node ast.Expr) ast.ComptimeVarKind { return .no_comptime } -// get_type_from_comptime_var retrives the comptime type related to $for variable +// get_type_from_comptime_var retrieves the comptime type related to $for variable @[inline] pub fn (t &TypeResolver) get_type_from_comptime_var(var ast.Ident) ast.Type { match var.name { diff --git a/vlib/v/util/version/version_test.v b/vlib/v/util/version/version_test.v index 7056740038..83493d9172 100644 --- a/vlib/v/util/version/version_test.v +++ b/vlib/v/util/version/version_test.v @@ -3,7 +3,7 @@ import os fn test_githash() { if os.getenv('GITHUB_JOB') == '' { - eprintln('> skipping test, since it needs GITHUB_JOB to be defined (it is flaky on development machines, with changing repos and v compiled with `./v self` from uncommited changes).') + eprintln('> skipping test, since it needs GITHUB_JOB to be defined (it is flaky on development machines, with changing repos and v compiled with `./v self` from uncommitted changes).') return } if !os.exists(os.join_path(@VMODROOT, '.git')) { diff --git a/vlib/v/util/vmod_value.v b/vlib/v/util/vmod_value.v index e02c7b4851..d30a207a0a 100644 --- a/vlib/v/util/vmod_value.v +++ b/vlib/v/util/vmod_value.v @@ -6,7 +6,7 @@ module util import os import v.vmod -// resolve_vmodroot replaces all occurences of `@VMODROOT` in `str`, with an absolute path, +// resolve_vmodroot replaces all occurrences of `@VMODROOT` in `str`, with an absolute path, // formed by resolving, where the nearest `v.mod` is, given the folder `dir`. pub fn resolve_vmodroot(str string, dir string) !string { mut mcache := vmod.get_cache() diff --git a/vlib/v2/scanner/scanner.v b/vlib/v2/scanner/scanner.v index 4560befbff..62068e5292 100644 --- a/vlib/v2/scanner/scanner.v +++ b/vlib/v2/scanner/scanner.v @@ -124,7 +124,7 @@ pub fn (mut s Scanner) scan() token.Token { s.offset++ // NOTE: I have made `@[` a token instead of using `@` and `[` because `@` // is not currently used as a token, and it is also easier to parse this way. - // if/when `@` becomes used as a token of it's own, then I may change this. + // if/when `@` becomes used as a token of its own, then I may change this. if c == `@` && s.src[s.offset] == `[` { s.offset++ return .attribute diff --git a/vlib/veb/veb.v b/vlib/veb/veb.v index 05965fb5fb..f7a9b0148e 100644 --- a/vlib/veb/veb.v +++ b/vlib/veb/veb.v @@ -411,7 +411,7 @@ fn handle_read[A, X](mut pv picoev.Picoev, mut params RequestParams, fd int) { eprintln('[veb] error reading request body: ${err}') if err is io.Eof { - // we expect more data to be send, but an Eof error occured, meaning + // we expect more data to be send, but an Eof error occurred, meaning // that there is no more data to be read from the socket. // And at this point we expect that there is data to be read for the body. fast_send_resp(mut conn, http.new_response( diff --git a/vlib/x/crypto/chacha20/chacha.v b/vlib/x/crypto/chacha20/chacha.v index 0e147c3021..4ca550cb09 100644 --- a/vlib/x/crypto/chacha20/chacha.v +++ b/vlib/x/crypto/chacha20/chacha.v @@ -437,7 +437,7 @@ pub fn (mut c Cipher) set_counter(ctr u64) { // rekey resets internal Cipher's state and reinitializes state with the provided key and nonce pub fn (mut c Cipher) rekey(key []u8, nonce []u8) ! { unsafe { c.reset() } - // this routine was publicly accesible to user, so we add a check here + // this routine was publicly accessible to user, so we add a check here // to ensure the supplied key and nonce has the correct size. if key.len != key_size { return error('Bad key size provided for rekey') diff --git a/vlib/x/crypto/slhdsa/install-latest-ssl.md b/vlib/x/crypto/slhdsa/install-latest-ssl.md index b6f7f5918f..98a7bfde62 100644 --- a/vlib/x/crypto/slhdsa/install-latest-ssl.md +++ b/vlib/x/crypto/slhdsa/install-latest-ssl.md @@ -1,6 +1,6 @@ This `slhdsa` module requires latest OpenSSL library and development headers. It required minimum of OpenSLL 3.5 version. -Likely most of the linux (unix) distros does not ships with this version on this time +Likely most of the linux (unix) distros do not ship with this version on this time of writing, at March, 2025. You can manually download and install OpenSSL library by your self. This documents acts as a simple @@ -23,7 +23,7 @@ $ ./Configure --prefix=/opt/ssl --openssldir=/opt/ssl $ make $ sudo make install ``` -By succesfully this step, the latest OpenSSL has been built and installed onto +By successfully completing this step, the latest OpenSSL has been built and installed onto configured path. You need to tell the system to add this path.
4. Add `/opt/ssl/lib64` entry onto `/etc/ld.so.conf.d/libcrypto.conf` diff --git a/vlib/x/crypto/slhdsa/slhdsa.v b/vlib/x/crypto/slhdsa/slhdsa.v index 927b2dad7c..716a343714 100644 --- a/vlib/x/crypto/slhdsa/slhdsa.v +++ b/vlib/x/crypto/slhdsa/slhdsa.v @@ -100,7 +100,7 @@ pub fn (pv PrivateKey) dump_key() !string { return output } -// public_key gets the the public part of this private key as a PublicKey. +// public_key gets the public part of this private key as a PublicKey. pub fn (pv PrivateKey) public_key() !PublicKey { pbkey := C.EVP_PKEY_dup(pv.key) // we clears out the private bits from the key diff --git a/vlib/x/encoding/asn1/integer.v b/vlib/x/encoding/asn1/integer.v index 7ba78cd1c5..6e4493b9ce 100644 --- a/vlib/x/encoding/asn1/integer.v +++ b/vlib/x/encoding/asn1/integer.v @@ -197,7 +197,7 @@ pub fn (v Integer) payload() ![]u8 { // - The integer value contains the encoded integer if it is positive, or its two's complement if it is negative. // - If the integer is positive but the high order bit is set to 1, a leading 0x00 is added to the content // to indicate that the number is not negative. -// - If the number is negative after applying two's-complement rules, and the the most-significant-bit of the +// - If the number is negative after applying two's-complement rules, and the most-significant-bit of the // the high order bit of the bytes results isn't set, pad it with 0xff in order to keep the number negative. fn (v Integer) pack_into_twoscomplement_form() !([]u8, int) { match v.value { @@ -226,7 +226,7 @@ fn (v Integer) pack_into_twoscomplement_form() !([]u8, int) { } -1 { // A negative number has to be converted to two's-complement form. - // by invert the number and and then subtract it with big(1), or with other mean + // by invert the number and then subtract it with big(1), or with other mean // Flip all of the bits in the value and then add one to the resulting value. // If the most-significant-bit isn't set then we'll need to pad the // beginning with 0xff in order to keep the number negative. diff --git a/vlib/x/json2/decoder2/decode.v b/vlib/x/json2/decoder2/decode.v index 387c895723..6fb6731081 100644 --- a/vlib/x/json2/decoder2/decode.v +++ b/vlib/x/json2/decoder2/decode.v @@ -553,15 +553,15 @@ fn (mut decoder Decoder) decode_value[T](mut val T) ! { string_info := decoder.current_node.value if string_info.value_kind == .string_ { - buffer_lenght, escape_positions := decoder.calculate_string_space_and_escapes()! + buffer_length, escape_positions := decoder.calculate_string_space_and_escapes()! - string_buffer := []u8{cap: buffer_lenght} + string_buffer := []u8{cap: buffer_length} if escape_positions.len == 0 { if string_info.length != 0 { unsafe { string_buffer.push_many(decoder.json.str + string_info.position + 1, - buffer_lenght) + buffer_length) } } } else {