From 6b92f8fada4e955d7ef9ea8aa93a78accf3087bf Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 16 Jan 2025 08:36:12 -0600 Subject: [PATCH] all: remove ancient deprecations (#23479) --- vlib/builtin/js/string.js.v | 15 ------------ vlib/builtin/string.v | 16 ------------- vlib/crypto/md5/md5.v | 17 ++++---------- vlib/crypto/pem/pem.v | 7 ------ vlib/crypto/sha1/sha1.v | 17 ++++---------- vlib/crypto/sha256/sha256.v | 26 +++++---------------- vlib/crypto/sha512/sha512.v | 38 +++++++------------------------ vlib/math/big/big.js.v | 35 ---------------------------- vlib/math/big/integer.v | 18 --------------- vlib/math/big/special_array_ops.v | 8 ------- vlib/math/fractions/fraction.v | 30 ------------------------ vlib/net/html/dom.v | 18 --------------- vlib/net/http/request.v | 3 ++- vlib/os/file.c.v | 7 ------ vlib/os/os_nix.c.v | 10 -------- vlib/os/os_windows.c.v | 10 -------- vlib/picoev/picoev.v | 10 -------- vlib/semver/README.md | 4 ++-- vlib/semver/semver.v | 30 ------------------------ vlib/sokol/gfx/gfx.c.v | 4 ---- vlib/sokol/gfx/gfx_utils.c.v | 6 ----- vlib/strings/builder.c.v | 8 ------- vlib/time/time.c.v | 7 ------ vlib/time/time.js.v | 7 ------ vlib/time/time.v | 28 ----------------------- vlib/time/time_windows.c.v | 6 ----- vlib/v/util/diff.v | 24 ------------------- 27 files changed, 26 insertions(+), 383 deletions(-) delete mode 100644 vlib/v/util/diff.v diff --git a/vlib/builtin/js/string.js.v b/vlib/builtin/js/string.js.v index fafd7fa7fd0810..157b8b1025d72e 100644 --- a/vlib/builtin/js/string.js.v +++ b/vlib/builtin/js/string.js.v @@ -789,12 +789,6 @@ fn (s string) index_last_(p string) int { return -1 } -// index_last returns the position of the first character of the *last* occurrence of the `needle` string in `s`. -@[deprecated: 'use `.last_index(needle string)` instead'] -pub fn (s string) index_last(needle string) ?int { - return s.last_index(needle) -} - // last_index returns the position of the first character of the *last* occurrence of the `needle` string in `s`. @[inline] pub fn (s string) last_index(needle string) ?int { @@ -805,15 +799,6 @@ pub fn (s string) last_index(needle string) ?int { return idx } -// index_u8_last returns the index of the *last* occurrence of the byte `c` (if found) in the string. -// It returns -1, if `c` is not found. -@[deprecated: 'use `.last_index_u8(c u8)` instead'] -@[deprecated_after: '2024-06-30'] -@[inline] -pub fn (s string) index_u8_last(c u8) int { - return s.last_index_u8(c) -} - // last_index_u8 returns the index of the last occurrence of byte `c` if it was found in the string. @[direct_array_access] pub fn (s string) last_index_u8(c u8) int { diff --git a/vlib/builtin/string.v b/vlib/builtin/string.v index 2056f7c9e42e42..f7a2578deb8ebd 100644 --- a/vlib/builtin/string.v +++ b/vlib/builtin/string.v @@ -1249,13 +1249,6 @@ pub fn (s string) index(p string) ?int { return idx } -// index_last returns the position of the first character of the *last* occurrence of the `needle` string in `s`. -@[deprecated: 'use `.last_index(needle string)` instead'] -@[deprecated_after: '2024-03-27'] -pub fn (s string) index_last(needle string) ?int { - return s.last_index(needle) -} - // last_index returns the position of the first character of the *last* occurrence of the `needle` string in `s`. @[inline] pub fn (s string) last_index(needle string) ?int { @@ -1386,15 +1379,6 @@ pub fn (s string) index_u8(c u8) int { return -1 } -// index_u8_last returns the index of the *last* occurrence of the byte `c` (if found) in the string. -// It returns -1, if `c` is not found. -@[deprecated: 'use `.last_index_u8(c u8)` instead'] -@[deprecated_after: '2024-06-30'] -@[inline] -pub fn (s string) index_u8_last(c u8) int { - return s.last_index_u8(c) -} - // last_index_u8 returns the index of the last occurrence of byte `c` if it was found in the string. @[direct_array_access; inline] pub fn (s string) last_index_u8(c u8) int { diff --git a/vlib/crypto/md5/md5.v b/vlib/crypto/md5/md5.v index ac3b05b3be88e0..39940e265a41c4 100644 --- a/vlib/crypto/md5/md5.v +++ b/vlib/crypto/md5/md5.v @@ -108,7 +108,7 @@ pub fn (mut d Digest) write(p_ []u8) !int { pub fn (d &Digest) sum(b_in []u8) []u8 { // Make a copy of d so that caller can keep writing and summing. mut d0 := d.clone() - hash := d0.checksum_internal() + hash := d0.checksum() mut b_out := b_in.clone() for b in hash { b_out << b @@ -116,9 +116,8 @@ pub fn (d &Digest) sum(b_in []u8) []u8 { return b_out } -// TODO: -// When the deprecated "checksum()" is finally removed, restore this function name as: "checksum()" -fn (mut d Digest) checksum_internal() []u8 { +// checksum returns the byte checksum of the `Digest`, +fn (mut d Digest) checksum() []u8 { // Append 0x80 to the end of the message and then append zeros // until the length is a multiple of 56 bytes. Finally append // 8 bytes representing the message length in bits. @@ -143,19 +142,11 @@ fn (mut d Digest) checksum_internal() []u8 { return digest } -// checksum returns the byte checksum of the `Digest`, -// it is an internal method and is not recommended because its results are not idempotent. -@[deprecated: 'checksum() will be changed to a private method, use sum() instead'] -@[deprecated_after: '2024-04-30'] -pub fn (mut d Digest) checksum() []u8 { - return d.checksum_internal() -} - // sum returns the MD5 checksum of the data. pub fn sum(data []u8) []u8 { mut d := new() d.write(data) or { panic(err) } - return d.checksum_internal() + return d.checksum() } fn block(mut dig Digest, p []u8) { diff --git a/vlib/crypto/pem/pem.v b/vlib/crypto/pem/pem.v index 72fd50dc3a2f44..63dde793516db5 100644 --- a/vlib/crypto/pem/pem.v +++ b/vlib/crypto/pem/pem.v @@ -7,13 +7,6 @@ const pem_end = '\n-----END ' const pem_eol = '-----' const colon = ':' -// new returns a new `Block` with the specified block_type -@[deprecated: 'use Block.new instead'] -@[inline] -pub fn new(block_type string) Block { - return Block.new(block_type) -} - @[params] pub struct EncodeConfig { pub mut: diff --git a/vlib/crypto/sha1/sha1.v b/vlib/crypto/sha1/sha1.v index 073631405966c7..17ee2b8f3512e0 100644 --- a/vlib/crypto/sha1/sha1.v +++ b/vlib/crypto/sha1/sha1.v @@ -115,7 +115,7 @@ pub fn (mut d Digest) write(p_ []u8) !int { pub fn (d &Digest) sum(b_in []u8) []u8 { // Make a copy of d so that caller can keep writing and summing. mut d0 := d.clone() - hash := d0.checksum_internal() + hash := d0.checksum() mut b_out := b_in.clone() for b in hash { b_out << b @@ -123,9 +123,8 @@ pub fn (d &Digest) sum(b_in []u8) []u8 { return b_out } -// TODO: -// When the deprecated "checksum()" is finally removed, restore this function name as: "checksum()" -fn (mut d Digest) checksum_internal() []u8 { +// checksum returns the current byte checksum of the `Digest`, +fn (mut d Digest) checksum() []u8 { mut len := d.len // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. mut tmp := []u8{len: (64)} @@ -148,19 +147,11 @@ fn (mut d Digest) checksum_internal() []u8 { return digest } -// checksum returns the current byte checksum of the `Digest`, -// it is an internal method and is not recommended because its results are not idempotent. -@[deprecated: 'checksum() will be changed to a private method, use sum() instead'] -@[deprecated_after: '2024-04-30'] -pub fn (mut d Digest) checksum() []u8 { - return d.checksum_internal() -} - // sum returns the SHA-1 checksum of the bytes passed in `data`. pub fn sum(data []u8) []u8 { mut d := new() d.write(data) or { panic(err) } - return d.checksum_internal() + return d.checksum() } fn block(mut dig Digest, p []u8) { diff --git a/vlib/crypto/sha256/sha256.v b/vlib/crypto/sha256/sha256.v index 290bad38a5a32f..bc70a7a319f77b 100644 --- a/vlib/crypto/sha256/sha256.v +++ b/vlib/crypto/sha256/sha256.v @@ -149,7 +149,7 @@ pub fn (mut d Digest) write(p_ []u8) !int { pub fn (d &Digest) sum(b_in []u8) []u8 { // Make a copy of d so that caller can keep writing and summing. mut d0 := d.clone() - hash := d0.checksum_internal() + hash := d0.checksum() mut b_out := b_in.clone() if d0.is224 { for b in hash[..size224] { @@ -163,9 +163,9 @@ pub fn (d &Digest) sum(b_in []u8) []u8 { return b_out } -// TODO: -// When the deprecated "checksum()" is finally removed, restore this function name as: "checksum()" -fn (mut d Digest) checksum_internal() []u8 { +// checksum returns the current byte checksum of the Digest, +// it is an internal method and is not recommended because its results are not idempotent. +fn (mut d Digest) checksum() []u8 { mut len := d.len // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. mut tmp := []u8{len: (64)} @@ -196,20 +196,6 @@ fn (mut d Digest) checksum_internal() []u8 { return digest } -// checksum returns the current byte checksum of the Digest, -// it is an internal method and is not recommended because its results are not idempotent. -@[deprecated: 'checksum() will be changed to a private method, use sum() instead'] -@[deprecated_after: '2024-04-30'] -pub fn (mut d Digest) checksum() []u8 { - out := d.checksum_internal() - // if this digest has `size224` length, return the correct `size224` checksum - if d.is224 { - return out[0..size224] - } - // otherwise, returns a normal size - return out -} - // sum returns the SHA256 checksum of the bytes in `data`. // Example: assert sha256.sum('V'.bytes()).len > 0 == true pub fn sum(data []u8) []u8 { @@ -220,14 +206,14 @@ pub fn sum(data []u8) []u8 { pub fn sum256(data []u8) []u8 { mut d := new() d.write(data) or { panic(err) } - return d.checksum_internal() + return d.checksum() } // sum224 returns the SHA224 checksum of the data. pub fn sum224(data []u8) []u8 { mut d := new224() d.write(data) or { panic(err) } - sum := d.checksum_internal() + sum := d.checksum() mut sum224 := []u8{len: size224} copy(mut sum224, sum[..size224]) return sum224 diff --git a/vlib/crypto/sha512/sha512.v b/vlib/crypto/sha512/sha512.v index c6764b7cf1eeae..e6b7cd4f67bc71 100644 --- a/vlib/crypto/sha512/sha512.v +++ b/vlib/crypto/sha512/sha512.v @@ -208,7 +208,7 @@ pub fn (mut d Digest) write(p_ []u8) !int { pub fn (d &Digest) sum(b_in []u8) []u8 { // Make a copy of d so that caller can keep writing and summing. mut d0 := d.clone() - hash := d0.checksum_internal() + hash := d0.checksum() mut b_out := b_in.clone() match d0.function { .sha384 { @@ -235,9 +235,9 @@ pub fn (d &Digest) sum(b_in []u8) []u8 { return b_out } -// TODO: -// When the deprecated "checksum()" is finally removed, restore this function name as: "checksum()" -fn (mut d Digest) checksum_internal() []u8 { +// checksum returns the current byte checksum of the Digest, +// it is an internal method and is not recommended because its results are not idempotent. +fn (mut d Digest) checksum() []u8 { // Padding. Add a 1 bit and 0 bits until 112 bytes mod 128. mut len := d.len mut tmp := []u8{len: (128)} @@ -269,40 +269,18 @@ fn (mut d Digest) checksum_internal() []u8 { return digest } -// checksum returns the current byte checksum of the Digest, -// it is an internal method and is not recommended because its results are not idempotent. -@[deprecated: 'checksum() will be changed to a private method, use sum() instead'] -@[deprecated_after: '2024-04-30'] -pub fn (mut d Digest) checksum() []u8 { - out := d.checksum_internal() - match d.function { - .sha384 { - return out[0..size384] - } - .sha512_224 { - return out[0..size224] - } - .sha512_256 { - return out[0..size256] - } - else { - return out - } - } -} - // sum512 returns the SHA512 checksum of the data. pub fn sum512(data []u8) []u8 { mut d := new_digest(.sha512) d.write(data) or { panic(err) } - return d.checksum_internal() + return d.checksum() } // sum384 returns the SHA384 checksum of the data. pub fn sum384(data []u8) []u8 { mut d := new_digest(.sha384) d.write(data) or { panic(err) } - sum := d.checksum_internal() + sum := d.checksum() mut sum384 := []u8{len: size384} copy(mut sum384, sum[..size384]) return sum384 @@ -312,7 +290,7 @@ pub fn sum384(data []u8) []u8 { pub fn sum512_224(data []u8) []u8 { mut d := new_digest(.sha512_224) d.write(data) or { panic(err) } - sum := d.checksum_internal() + sum := d.checksum() mut sum224 := []u8{len: size224} copy(mut sum224, sum[..size224]) return sum224 @@ -322,7 +300,7 @@ pub fn sum512_224(data []u8) []u8 { pub fn sum512_256(data []u8) []u8 { mut d := new_digest(.sha512_256) d.write(data) or { panic(err) } - sum := d.checksum_internal() + sum := d.checksum() mut sum256 := []u8{len: size256} copy(mut sum256, sum[..size256]) return sum256 diff --git a/vlib/math/big/big.js.v b/vlib/math/big/big.js.v index ea18a700c1088c..ee5485bd916b38 100644 --- a/vlib/math/big/big.js.v +++ b/vlib/math/big/big.js.v @@ -97,11 +97,6 @@ pub fn div_mod(a &Number, b &Number) (Number, Number) { return c, d } -@[deprecated: 'use div_mod(a, b) instead'] -pub fn divmod(a &Number, b &Number) (Number, Number) { - return div_mod(a, b) -} - pub fn cmp(a &Number, b &Number) int { res := 0 @@ -142,21 +137,6 @@ pub fn (a &Number) isqrt() Number { return b } -@[deprecated: 'use bitwise_and(a, b) instead'] -pub fn b_and(a &Number, b &Number) Number { - return bitwise_and(a, b) -} - -@[deprecated: 'use bitwise_or(a, b) instead'] -pub fn b_or(a &Number, b &Number) Number { - return bitwise_or(a, b) -} - -@[deprecated: 'use bitwise_xor(a, b) instead'] -pub fn b_xor(a &Number, b &Number) Number { - return bitwise_xor(a, b) -} - pub fn bitwise_and(a &Number, b &Number) Number { c := Number{} #c.value = a.val.value & b.val.value @@ -178,16 +158,6 @@ pub fn bitwise_xor(a &Number, b &Number) Number { return c } -@[deprecated: 'use a.left_shift(amount) instead'] -pub fn (a &Number) lshift(amount int) Number { - return a.left_shift(amount) -} - -@[deprecated: 'use a.right_shift(amount) instead'] -pub fn (a &Number) rshift(amount int) Number { - return a.right_shift(amount) -} - pub fn (a &Number) left_shift(amount int) Number { c := Number{} #c.value = a.val.value << BigInt(+amount) @@ -223,11 +193,6 @@ pub fn factorial(nn &Number) Number { return a } -@[deprecated: 'use factorial_int instead'] -pub fn fact(n int) Number { - return factorial_int(n) -} - pub fn factorial_int(n int) Number { return factorial(from_int(n)) } diff --git a/vlib/math/big/integer.v b/vlib/math/big/integer.v index 2ee6ee6ed900f7..836b4024320237 100644 --- a/vlib/math/big/integer.v +++ b/vlib/math/big/integer.v @@ -754,12 +754,6 @@ pub fn (a Integer) bitwise_xor(b Integer) Integer { } } -// lshift returns the integer `a` shifted left by `amount` bits. -@[deprecated: 'use a.Integer.left_shift(amount) instead'] -pub fn (a Integer) lshift(amount u32) Integer { - return a.left_shift(amount) -} - // left_shift returns the integer `a` shifted left by `amount` bits. @[direct_array_access] pub fn (a Integer) left_shift(amount u32) Integer { @@ -784,12 +778,6 @@ pub fn (a Integer) left_shift(amount u32) Integer { } } -// rshift returns the integer `a` shifted right by `amount` bits. -@[deprecated: 'use a.Integer.right_shift(amount) instead'] -pub fn (a Integer) rshift(amount u32) Integer { - return a.right_shift(amount) -} - // right_shift returns the integer `a` shifted right by `amount` bits. @[direct_array_access] pub fn (a Integer) right_shift(amount u32) Integer { @@ -817,12 +805,6 @@ pub fn (a Integer) right_shift(amount u32) Integer { } } -// binary_str returns the binary string representation of the integer `a`. -@[deprecated: 'use integer.bin_str() instead'] -pub fn (integer Integer) binary_str() string { - return integer.bin_str() -} - // bin_str returns the binary string representation of the integer `a`. @[direct_array_access] pub fn (integer Integer) bin_str() string { diff --git a/vlib/math/big/special_array_ops.v b/vlib/math/big/special_array_ops.v index f26f8fa07effad..d38c0a40ce3b16 100644 --- a/vlib/math/big/special_array_ops.v +++ b/vlib/math/big/special_array_ops.v @@ -1,6 +1,5 @@ module big -import math.bits import strings @[direct_array_access; inline] @@ -62,13 +61,6 @@ fn newton_divide_array_by_array(operand_a []u32, operand_b []u32, mut quotient [ shrink_tail_zeros(mut remainder) } -// bit_length returns the number of bits needed to represent the absolute value of the integer a. -@[deprecated: 'use a.bit_len() instead'] -@[inline] -pub fn bit_length(a Integer) int { - return a.digits.len * 32 - bits.leading_zeros_32(a.digits.last()) -} - @[direct_array_access; inline] fn debug_u32_str(a []u32) string { mut sb := strings.new_builder(30) diff --git a/vlib/math/fractions/fraction.v b/vlib/math/fractions/fraction.v index 261cd0c9c4c55b..c0347d62e15c85 100644 --- a/vlib/math/fractions/fraction.v +++ b/vlib/math/fractions/fraction.v @@ -234,41 +234,11 @@ fn cmp(f1 Fraction, f2 Fraction) int { // | Public comparison functions | // +-----------------------------+ -// equals returns true if both the Fractions are equal -@[deprecated: 'use f1 == f2 instead'] -pub fn (f1 Fraction) equals(f2 Fraction) bool { - return cmp(f1, f2) == 0 -} - // return true if f1 == f2 pub fn (f1 Fraction) == (f2 Fraction) bool { return cmp(f1, f2) == 0 } -// ge returns true if f1 >= f2 -@[deprecated: 'use f1 >= f2 instead'] -pub fn (f1 Fraction) ge(f2 Fraction) bool { - return cmp(f1, f2) >= 0 -} - -// gt returns true if f1 > f2 -@[deprecated: 'use f1 > f2 instead'] -pub fn (f1 Fraction) gt(f2 Fraction) bool { - return cmp(f1, f2) > 0 -} - -// le returns true if f1 <= f2 -@[deprecated: 'use f1 <= f2 instead'] -pub fn (f1 Fraction) le(f2 Fraction) bool { - return cmp(f1, f2) <= 0 -} - -// lt returns true if f1 < f2 -@[deprecated: 'use f1 < f2 instead'] -pub fn (f1 Fraction) lt(f2 Fraction) bool { - return cmp(f1, f2) < 0 -} - // return true if f1 < f2 pub fn (f1 Fraction) < (f2 Fraction) bool { return cmp(f1, f2) < 0 diff --git a/vlib/net/html/dom.v b/vlib/net/html/dom.v index 3cc0e2e2c2ac0e..e84bf14708c9da 100644 --- a/vlib/net/html/dom.v +++ b/vlib/net/html/dom.v @@ -174,12 +174,6 @@ pub fn (dom &DocumentObjectModel) get_root() &Tag { return dom.root } -// get_tag retrieves all tags in the document that have the given tag name. -@[deprecated: 'use get_tags instead'] -pub fn (dom &DocumentObjectModel) get_tag(name string) []&Tag { - return dom.get_tags(name: name) -} - // get_tags returns all tags stored in the document. pub fn (dom &DocumentObjectModel) get_tags(options GetTagsOptions) []&Tag { if options.name != '' { @@ -197,12 +191,6 @@ pub fn (dom &DocumentObjectModel) get_tags_by_class_name(names ...string) []&Tag return dom.root.get_tags_by_class_name(...names) } -// get_tag_by_attribute retrieves all tags in the document that have the given attribute name. -@[deprecated: 'use get_tags_by_attribute instead'] -pub fn (dom &DocumentObjectModel) get_tag_by_attribute(name string) []&Tag { - return dom.get_tags_by_attribute(name) -} - // get_tags_by_attribute retrieves all tags in the document that have the given attribute name. pub fn (dom &DocumentObjectModel) get_tags_by_attribute(name string) []&Tag { return if name in dom.all_attributes { unsafe { dom.all_attributes[name] } } else { []&Tag{} } @@ -217,9 +205,3 @@ pub fn (mut dom DocumentObjectModel) get_tags_by_attribute_value(name string, va } return [] } - -// get_tag_by_attribute_value retrieves all tags in the document that have the given attribute name and value. -@[deprecated: 'use get_tags_by_attribute_value instead'] -pub fn (mut dom DocumentObjectModel) get_tag_by_attribute_value(name string, value string) []&Tag { - return dom.get_tags_by_attribute_value(name, value) -} diff --git a/vlib/net/http/request.v b/vlib/net/http/request.v index e734d2edb1d077..e7c8a33bbfac20 100644 --- a/vlib/net/http/request.v +++ b/vlib/net/http/request.v @@ -21,12 +21,13 @@ pub type RequestFinishFn = fn (request &Request, final_size u64) ! // Request holds information about an HTTP request (either received by // a server or to be sent by a client) pub struct Request { +mut: + cookies map[string]string pub mut: version Version = .v1_1 method Method = .get header Header host string - cookies map[string]string @[deprecated: 'use req.cookie(name) and req.add_cookie(name) instead'] data string url string user_agent string = 'v.http' diff --git a/vlib/os/file.c.v b/vlib/os/file.c.v index 8eecc0e593db94..303652050ecc9b 100644 --- a/vlib/os/file.c.v +++ b/vlib/os/file.c.v @@ -438,13 +438,6 @@ pub fn (f &File) read_bytes_at(size int, pos u64) []u8 { return arr[0..nreadbytes] } -// read_bytes_into_newline reads from the current position of the file into the provided buffer. -@[deprecated: 'use read_bytes_with_newline instead'] -@[deprecated_after: '2024-05-04'] -pub fn (f &File) read_bytes_into_newline(mut buf []u8) !int { - return f.read_bytes_with_newline(mut buf) -} - // read_bytes_with_newline reads from the current position of the file into the provided buffer. // Each consecutive call on the same file, continues reading, from where it previously ended. // A read call is either stopped, if the buffer is full, a newline was read or EOF. diff --git a/vlib/os/os_nix.c.v b/vlib/os/os_nix.c.v index b2492e9bb6ca2c..681b88e98cbdbf 100644 --- a/vlib/os/os_nix.c.v +++ b/vlib/os/os_nix.c.v @@ -272,16 +272,6 @@ pub fn loginname() !string { return error(posix_get_error_msg(C.errno)) } -@[deprecated: 'os.args now uses arguments()'] -@[deprecated_after: '2024-07-30'] -fn init_os_args(argc int, argv &&u8) []string { - mut args_ := []string{len: argc} - for i in 0 .. argc { - args_[i] = unsafe { tos_clone(argv[i]) } - } - return args_ -} - // ls returns ![]string of the files and dirs in the given `path` ( os.ls uses C.readdir ). Symbolic links are returned to be files. For recursive list see os.walk functions. // See also: `os.walk`, `os.walk_ext`, `os.is_dir`, `os.is_file` // Example: https://github.com/vlang/v/blob/master/examples/readdir.v diff --git a/vlib/os/os_windows.c.v b/vlib/os/os_windows.c.v index 69498c5b6ffcc1..e36a30d4e52486 100644 --- a/vlib/os/os_windows.c.v +++ b/vlib/os/os_windows.c.v @@ -103,16 +103,6 @@ pub struct C._utimbuf { fn C._utime(&char, voidptr) int -@[deprecated: 'os.args now uses arguments()'] -@[deprecated_after: '2024-07-30'] -fn init_os_args_wide(argc int, argv &&u8) []string { - mut args_ := []string{len: argc} - for i in 0 .. argc { - args_[i] = unsafe { string_from_wide(&u16(argv[i])) } - } - return args_ -} - fn native_glob_pattern(pattern string, mut matches []string) ! { $if debug { // FindFirstFile() and FindNextFile() both have a globbing function. diff --git a/vlib/picoev/picoev.v b/vlib/picoev/picoev.v index eb24dfc9d8d801..0dab5bb86255a3 100644 --- a/vlib/picoev/picoev.v +++ b/vlib/picoev/picoev.v @@ -68,9 +68,6 @@ pub struct Picoev { max_headers int = 100 max_read int = 4096 max_write int = 8192 - - err_cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response, IError) = default_error_callback @[deprecated: 'use `error_callback` instead'] - raw_cb fn (mut Picoev, int, int) = unsafe { nil } @[deprecated: 'use `raw_callback` instead'] mut: loop &LoopType = unsafe { nil } file_descriptors [max_fds]&Target @@ -116,13 +113,6 @@ pub fn (mut pv Picoev) add(fd int, events int, timeout int, callback voidptr) in return 0 } -// del remove a file descriptor from the event loop -@[deprecated: 'use delete() instead'] -@[direct_array_access] -pub fn (mut pv Picoev) del(fd int) int { - return pv.delete(fd) -} - // remove a file descriptor from the event loop @[direct_array_access] pub fn (mut pv Picoev) delete(fd int) int { diff --git a/vlib/semver/README.md b/vlib/semver/README.md index ef213410486b64..bba9c55140c741 100644 --- a/vlib/semver/README.md +++ b/vlib/semver/README.md @@ -16,8 +16,8 @@ fn main() { println('Invalid version') return } - println(ver1.gt(ver2)) - println(ver2.gt(ver1)) + println(ver1 > ver2) + println(ver2 > ver1) println(ver1.satisfies('>=1.1.0 <2.0.0')) println(ver2.satisfies('>=1.1.0 <2.0.0')) println(ver2.satisfies('>=1.1.0 <2.0.0 || >2.2.0')) diff --git a/vlib/semver/semver.v b/vlib/semver/semver.v index 4110d7e55219dd..818662dbda39ac 100644 --- a/vlib/semver/semver.v +++ b/vlib/semver/semver.v @@ -69,46 +69,16 @@ pub fn (ver Version) satisfies(input string) bool { return version_satisfies(ver, input) } -// eq returns `true` if `v1` is equal to `v2`. -@[deprecated: 'use v1 == v2 instead'] -pub fn (v1 Version) eq(v2 Version) bool { - return compare_eq(v1, v2) -} - // == checks if `v1` is equal to `v2` pub fn (v1 Version) == (v2 Version) bool { return compare_eq(v1, v2) } -// gt returns `true` if `v1` is greater than `v2`. -@[deprecated: 'use v1 > v2 instead'] -pub fn (v1 Version) gt(v2 Version) bool { - return compare_gt(v1, v2) -} - // < checks if `v1` is less than `v2`. pub fn (v1 Version) < (v2 Version) bool { return compare_lt(v1, v2) } -// lt returns `true` if `v1` is less than `v2`. -@[deprecated: 'use v1 < v2 instead'] -pub fn (v1 Version) lt(v2 Version) bool { - return compare_lt(v1, v2) -} - -// ge returns `true` if `v1` is greater than or equal to `v2`. -@[deprecated: 'use v1 >= v2 instead'] -pub fn (v1 Version) ge(v2 Version) bool { - return compare_ge(v1, v2) -} - -// le returns `true` if `v1` is less than or equal to `v2` -@[deprecated: 'use v1 <= v2 instead'] -pub fn (v1 Version) le(v2 Version) bool { - return compare_le(v1, v2) -} - // str returns the `string` representation of the `Version`. pub fn (ver Version) str() string { common_string := '${ver.major}.${ver.minor}.${ver.patch}' diff --git a/vlib/sokol/gfx/gfx.c.v b/vlib/sokol/gfx/gfx.c.v index f3c7e220a542fb..3ba426009d6d0c 100644 --- a/vlib/sokol/gfx/gfx.c.v +++ b/vlib/sokol/gfx/gfx.c.v @@ -124,10 +124,6 @@ pub fn query_buffer_overflow(buf Buffer) bool { // rendering functions -@[deprecated: 'use begin_pass instead, please see examples/sokol/* for how to utilize new unified begin_pass'] -@[inline] -pub fn begin_default_pass(actions &PassAction, width int, height int) {} - // begin_pass begins a rendering pass. // See also: documentation at the top of thirdparty/sokol/sokol_gfx.h @[inline] diff --git a/vlib/sokol/gfx/gfx_utils.c.v b/vlib/sokol/gfx/gfx_utils.c.v index 4c7b2da3ebcc71..ba1306ce652412 100644 --- a/vlib/sokol/gfx/gfx_utils.c.v +++ b/vlib/sokol/gfx/gfx_utils.c.v @@ -1,11 +1,5 @@ module gfx -@[deprecated: 'use create_clear_pass_action instead'] -@[deprecated_after: '2024-09-03'] -pub fn create_clear_pass(r f32, g f32, b f32, a f32) PassAction { - return create_clear_pass_action(r, g, b, a) -} - // create_clear_pass_action returns a *clearing* `PassAction` that clears the `Pass` // with the color defined by the color components `r`ed,`g`reen, `b`lue and `a`lpha. pub fn create_clear_pass_action(r f32, g f32, b f32, a f32) PassAction { diff --git a/vlib/strings/builder.c.v b/vlib/strings/builder.c.v index 56996f49e1636c..8069e8d2686d8d 100644 --- a/vlib/strings/builder.c.v +++ b/vlib/strings/builder.c.v @@ -154,14 +154,6 @@ pub fn (mut b Builder) write_string2(s1 string, s2 string) { } } -// writeln_string appends the string `s`+`\n` to the buffer -@[deprecated: 'use writeln() instead'] -@[deprecated_after: '2024-03-21'] -@[inline] -pub fn (mut b Builder) writeln_string(s string) { - b.writeln(s) -} - // go_back discards the last `n` bytes from the buffer pub fn (mut b Builder) go_back(n int) { b.trim(b.len - n) diff --git a/vlib/time/time.c.v b/vlib/time/time.c.v index 40dab29c3ad173..83d06862a2f58a 100644 --- a/vlib/time/time.c.v +++ b/vlib/time/time.c.v @@ -56,13 +56,6 @@ pub fn utc() Time { return linux_utc() } -// new_time returns a time struct with the calculated Unix time. -@[deprecated: 'use `new()` instead'] -@[deprecated_after: '2024-05-31'] -pub fn new_time(t Time) Time { - return time_with_unix(t) -} - fn time_with_unix(t Time) Time { if t.unix != 0 { return t diff --git a/vlib/time/time.js.v b/vlib/time/time.js.v index e035051a562c2d..dcd1c547d54756 100644 --- a/vlib/time/time.js.v +++ b/vlib/time/time.js.v @@ -44,13 +44,6 @@ pub fn sleep(dur Duration) { #while (new Date().getTime() < now + Number(toWait)) {} } -// new_time returns a time struct with the calculated Unix time. -@[deprecated: 'use `new()` instead'] -@[deprecated_after: '2024-05-31'] -pub fn new_time(t Time) Time { - return time_with_unix(t) -} - fn time_with_unix(t Time) Time { if t.unix != 0 { return t diff --git a/vlib/time/time.v b/vlib/time/time.v index 29433c4ac15da2..7b44ae7569815a 100644 --- a/vlib/time/time.v +++ b/vlib/time/time.v @@ -127,34 +127,6 @@ pub fn (t Time) unix_nano() i64 { return t.unix() * 1_000_000_000 + i64(t.nanosecond) } -// unix_time returns the UNIX time with second resolution. -@[deprecated: 'use `t.unix()` instead'] -@[deprecated_after: '2024-05-31'] -pub fn (t Time) unix_time() i64 { - return t.unix() -} - -// unix_time_milli returns the UNIX time with millisecond resolution. -@[deprecated: 'use `t.unix_milli()` instead'] -@[deprecated_after: '2024-05-31'] -pub fn (t Time) unix_time_milli() i64 { - return t.unix_milli() -} - -// unix_time_micro returns the UNIX time with microsecond resolution. -@[deprecated: 'use `t.unix_micro()` instead'] -@[deprecated_after: '2024-05-31'] -pub fn (t Time) unix_time_micro() i64 { - return t.unix_micro() -} - -// unix_time_nano returns the UNIX time with nanosecond resolution. -@[deprecated: 'use `t.unix_nano()` instead'] -@[deprecated_after: '2024-05-31'] -pub fn (t Time) unix_time_nano() i64 { - return t.unix_nano() -} - // add returns a new time with the given duration added. pub fn (t Time) add(duration_in_nanosecond Duration) Time { // This expression overflows i64 for big years (and we do not have i128 yet): diff --git a/vlib/time/time_windows.c.v b/vlib/time/time_windows.c.v index c4b2e0665fef37..3d64b91b050f47 100644 --- a/vlib/time/time_windows.c.v +++ b/vlib/time/time_windows.c.v @@ -174,12 +174,6 @@ fn win_utc() Time { return t } -// unix_time returns Unix time. -@[deprecated: 'use `st.unix()` instead'] -fn (st SystemTime) unix_time() i64 { - return st.unix() -} - // unix returns Unix time. fn (st SystemTime) unix() i64 { tt := C.tm{ diff --git a/vlib/v/util/diff.v b/vlib/v/util/diff.v deleted file mode 100644 index 95cddca36e68f8..00000000000000 --- a/vlib/v/util/diff.v +++ /dev/null @@ -1,24 +0,0 @@ -module util - -import v.util.diff - -// find_working_diff_command returns the first available command from a list of known diff cli tools. -@[deprecated_after: '2024-06-30'] -@[deprecated] -pub fn find_working_diff_command() !string { - return diff.find_working_diff_command() -} - -// color_compare_files returns a colored diff between two files. -@[deprecated: 'use `diff.compare_files` instead'] -@[deprecated_after: '2024-06-30'] -pub fn color_compare_files(diff_cmd string, path1 string, path2 string) string { - return diff.color_compare_files(diff_cmd, path1, path2) -} - -// color_compare_strings returns a colored diff between two strings. -@[deprecated: 'use `diff.compare_text` instead'] -@[deprecated_after: '2024-06-30'] -pub fn color_compare_strings(diff_cmd string, unique_prefix string, expected string, found string) string { - return diff.color_compare_strings(diff_cmd, unique_prefix, expected, found) -}