Skip to content

Commit

Permalink
vlib: remove modules/functions/fields, deprecated in 2023 (#22750)
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman authored Nov 17, 2024
1 parent 2390e58 commit 5bba92a
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 668 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ freebsd_task:
./v -exclude @vlib/math/*.c.v test vlib/math
test_zip_modules_script: |
echo 'Test modules using thirdparty/zip'
./v test vlib/compress/ vlib/szip/
./v test vlib/compress/
test_self_script: |
echo 'Run test-self'
VTEST_JUST_ESSENTIAL=1 ./v test-self
1 change: 0 additions & 1 deletion vlib/gg/gg.js.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pub enum DOMEventType {
clipboard_pasted
files_dropped
num
files_droped @[deprecated: 'use files_dropped instead'; deprecated_after: '2023-08-21']
}

pub struct Event {
Expand Down
7 changes: 0 additions & 7 deletions vlib/log/log.v
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ pub fn (mut l Log) set_level(level Level) {
l.level = level
}

// set_output_level sets the internal logging output to `level`.
@[deprecated: 'use .set_level(level) instead']
@[deprecated_after: '2023-09-30']
pub fn (mut l Log) set_output_level(level Level) {
l.level = level
}

// set_full_logpath sets the output label and output path from `full_log_path`.
pub fn (mut l Log) set_full_logpath(full_log_path string) {
rlog_file := os.real_path(full_log_path)
Expand Down
64 changes: 0 additions & 64 deletions vlib/math/const.v
Original file line number Diff line number Diff line change
Expand Up @@ -39,70 +39,6 @@ pub const max_f64 = 1.797693134862315708145274237317043567981e+308 // 2**1023 *

pub const smallest_non_zero_f64 = 4.940656458412465441765687928682213723651e-324

@[deprecated: 'use built-in constant `min_i8` instead']
@[deprecated_after: '2023-12-31']
pub const min_i8 = i8(-128)

@[deprecated: 'use built-in constant `max_i8` instead']
@[deprecated_after: '2023-12-31']
pub const max_i8 = i8(127)

@[deprecated: 'use built-in constant `min_i16` instead']
@[deprecated_after: '2023-12-31']
pub const min_i16 = i16(-32768)

@[deprecated: 'use built-in constant `max_i16` instead']
@[deprecated_after: '2023-12-31']
pub const max_i16 = i16(32767)

@[deprecated: 'use built-in constant `min_i32` instead']
@[deprecated_after: '2023-12-31']
pub const min_i32 = i32(-2147483648)

@[deprecated: 'use built-in constant `max_i32` instead']
@[deprecated_after: '2023-12-31']
pub const max_i32 = i32(2147483647)

// -9223372036854775808 is wrong, because C compilers parse literal values
// without sign first, and 9223372036854775808 overflows i64, hence the
// consecutive subtraction by 1

@[deprecated: 'use built-in constant `min_i64` instead']
@[deprecated_after: '2023-12-31']
pub const min_i64 = i64(-9223372036854775807 - 1)

@[deprecated: 'use built-in constant `max_i64` instead']
@[deprecated_after: '2023-12-31']
pub const max_i64 = i64(9223372036854775807)

@[deprecated: 'use built-in constant `min_u8` instead']
@[deprecated_after: '2023-12-31']
pub const min_u8 = u8(0)

@[deprecated: 'use built-in constant `max_u8` instead']
@[deprecated_after: '2023-12-31']
pub const max_u8 = u8(255)

@[deprecated: 'use built-in constant `min_u16` instead']
@[deprecated_after: '2023-12-31']
pub const min_u16 = u16(0)

@[deprecated: 'use built-in constant `max_u16` instead']
@[deprecated_after: '2023-12-31']
pub const max_u16 = u16(65535)

@[deprecated: 'use built-in constant `min_u32` instead']
@[deprecated_after: '2023-12-31']
pub const min_u32 = u32(0)

@[deprecated: 'use built-in constant `max_u32` instead']
@[deprecated_after: '2023-12-31']
pub const max_u32 = u32(4294967295)

@[deprecated: 'use built-in constant `min_u64` instead']
@[deprecated_after: '2023-12-31']
pub const min_u64 = u64(0)

@[deprecated: 'use built-in constant `max_u64` instead']
@[deprecated_after: '2023-12-31']
pub const max_u64 = u64(18446744073709551615)
42 changes: 0 additions & 42 deletions vlib/net/conv/conv.v
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ mut:
as_double32 f32
}

// htn64 - DON'T USE, use hton64 instead
@[deprecated: 'use hton64() instead']
@[deprecated_after: '2023-12-31']
pub fn htn64(host u64) u64 {
return hton64(host)
}

// htonf32 converts the 32 bit double `host` to the net format
pub fn htonf32(host f32) f32 {
$if little_endian {
Expand Down Expand Up @@ -50,13 +43,6 @@ pub fn hton64(host u64) u64 {
}
}

// htn32 - DON'T USE, use hton32 instead
@[deprecated: 'use hton32() instead']
@[deprecated_after: '2023-12-31']
pub fn htn32(host u32) u32 {
return hton32(host)
}

// hton32 converts the 32 bit value `host` to the net format (htonl)
pub fn hton32(host u32) u32 {
$if little_endian {
Expand All @@ -66,13 +52,6 @@ pub fn hton32(host u32) u32 {
}
}

// htn16 - DON'T USE, use hton16 instead
@[deprecated: 'use hton16() instead']
@[deprecated_after: '2023-12-31']
pub fn htn16(host u16) u16 {
return hton16(host)
}

// hton16 converts the 16 bit value `host` to the net format (htons)
pub fn hton16(host u16) u16 {
$if little_endian {
Expand All @@ -82,37 +61,16 @@ pub fn hton16(host u16) u16 {
}
}

// nth64 - DON'T USE, use ntoh64 instead
@[deprecated: 'use ntoh64() instead']
@[deprecated_after: '2023-12-31']
pub fn nth64(net u64) u64 {
return ntoh64(net)
}

// ntoh64 converts the 64 bit value `net` to the host format (ntohll)
pub fn ntoh64(net u64) u64 {
return hton64(net)
}

// nth32 - DON'T USE, use ntoh32 instead
@[deprecated: 'use ntoh32() instead']
@[deprecated_after: '2023-12-31']
pub fn nth32(net u32) u32 {
return ntoh32(net)
}

// ntoh32 converts the 32 bit value `net` to the host format (ntohl)
pub fn ntoh32(net u32) u32 {
return hton32(net)
}

// nth16 - DON'T USE, use ntoh16 instead
@[deprecated: 'use ntoh16() instead']
@[deprecated_after: '2023-12-31']
pub fn nth16(net u16) u16 {
return ntoh16(net)
}

// ntoh16 converts the 16 bit value `net` to the host format (ntohs)
pub fn ntoh16(net u16) u16 {
return hton16(net)
Expand Down
1 change: 0 additions & 1 deletion vlib/sokol/sapp/enums.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub enum EventType {
clipboard_pasted
files_dropped
num
files_droped @[deprecated: 'use files_dropped instead'; deprecated_after: '2023-08-21']
}

pub enum MouseButton {
Expand Down
45 changes: 8 additions & 37 deletions vlib/strconv/format.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module strconv

import strings

/*
printf/sprintf V implementation
Expand All @@ -9,17 +11,16 @@ that can be found in the LICENSE file.
This file contains the printf/sprintf functions
*/
import strings

// Align_text is used to describe the different ways to align a text - left, right and center
pub enum Align_text {
right = 0
left
center
}

/*
Float conversion utility
*/
// Float conversion utility

// rounding value
const dec_round = [
f64(0.5),
Expand All @@ -44,38 +45,9 @@ const dec_round = [
0.00000000000000000005,
]!

/*
const(
// rounding value
dec_round = [
f64(0.44),
0.044,
0.0044,
0.00044,
0.000044,
0.0000044,
0.00000044,
0.000000044,
0.0000000044,
0.00000000044,
0.000000000044,
0.0000000000044,
0.00000000000044,
0.000000000000044,
0.0000000000000044,
0.00000000000000044,
0.000000000000000044,
0.0000000000000000044,
0.00000000000000000044,
0.000000000000000000044,
]
)
*/
// max float 1.797693134862315708145274237317043567981e+308
// Single format functions

/*
Single format functions
*/
// BF_param is used for describing the formatting options for a single interpolated value
pub struct BF_param {
pub mut:
pad_ch u8 = u8(` `) // padding char
Expand All @@ -84,11 +56,10 @@ pub mut:
positive bool = true // mandatory: the sign of the number passed
sign_flag bool // flag for print sign as prefix in padding
align Align_text = .right // alignment of the string
allign Align_text = .right @[deprecated: 'use align instead'; deprecated_after: '2023-11-30']
rm_tail_zero bool // remove the tail zeros from floats
}

// format_str returns a `string` formatted according to the options set in `p`.
// format_str returns the `s` formatted, according to the options set in `p`.
@[manualfree]
pub fn format_str(s string, p BF_param) string {
if p.len0 <= 0 {
Expand Down
9 changes: 0 additions & 9 deletions vlib/szip/README.md

This file was deleted.

Loading

0 comments on commit 5bba92a

Please sign in to comment.