cleanup: remove remaining deprecated size aliases (#31203)
* cleanup: remove deprecated {i,u}size from vlib
* strconv: preserve legacy signed formatting and compatibility coverage
---------
Co-authored-by: Alexander Medvednikov <alexander@medvednikov.com>
This commit is contained in:
1 parent
8e45736561
commit
3f41e4bfd7
7 files changed
+12
-11
No files matched your search
+2
-2
@@ -1858,7 +1858,7 @@ fn durable_git_child_failure(message string, code int) {
|
||||
mut offset := 0
|
||||
for offset < message.len {
|
||||
remaining := unsafe { message.str + offset }
|
||||
written := C.write(2, voidptr(remaining), usize(message.len - offset))
|
||||
written := C.write(2, voidptr(remaining), uint(message.len - offset))
|
||||
if written > 0 {
|
||||
offset += written
|
||||
continue
|
||||
@@ -2109,7 +2109,7 @@ fn durable_git_read_pipe(fd int, mut output []u8, eof bool, limit int,
|
||||
$if linux || macos || freebsd || openbsd {
|
||||
mut buffer := [8192]u8{}
|
||||
mut observed_combined := combined
|
||||
read := C.read(fd, voidptr(&buffer[0]), usize(buffer.len))
|
||||
read := C.read(fd, voidptr(&buffer[0]), uint(buffer.len))
|
||||
if read > 0 {
|
||||
observed_combined += read
|
||||
if output.len + read > limit || observed_combined > limit + durable_git_stderr_max_bytes {
|
||||
|
||||
@@ -97,7 +97,7 @@ $if test {
|
||||
window: window
|
||||
// render.Context has no int id; its own address is a stable identity
|
||||
// for the lifetime of the context, and is never nil here.
|
||||
context_id: unsafe { u64(usize(voidptr(context))) }
|
||||
context_id: unsafe { u64(uint(voidptr(context))) }
|
||||
target_key: target_key
|
||||
}
|
||||
multiwindow_sgl_load_proof.count++
|
||||
|
||||
@@ -125,7 +125,7 @@ pub fn new_context(desc Desc) &Context {
|
||||
|
||||
if gfx.is_valid() {
|
||||
buf_desc := gfx.BufferDesc{
|
||||
size: usize(max_v) * usize(sizeof(Vertex))
|
||||
size: uint(max_v) * uint(sizeof(Vertex))
|
||||
type: .vertexbuffer
|
||||
usage: .stream
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ pub fn (ctx &Context) draw() {
|
||||
if st.update_frame_id != st.frame_id {
|
||||
st.update_frame_id = st.frame_id
|
||||
if gfx.is_valid() {
|
||||
rng := gfx.Range{ ptr: &st.verts[0], size: usize(st.vertex_count) * usize(sizeof(Vertex)) }
|
||||
rng := gfx.Range{ ptr: &st.verts[0], size: uint(st.vertex_count) * uint(sizeof(Vertex)) }
|
||||
gfx.update_buffer(st.vbuf, &rng)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@ pub fn new_ssl_server_conn(mut tcp_conn net.TcpConn, config SSLConnectConfig) !&
|
||||
|
||||
if config.in_memory_verification {
|
||||
mut res := C.v_net_openssl_SSL_CTX_use_certificate_chain_memory(sslctx,
|
||||
config.cert.str, usize(config.cert.len))
|
||||
config.cert.str, uint(config.cert.len))
|
||||
if res != 1 {
|
||||
C.SSL_CTX_free(sslctx)
|
||||
return error('net.openssl new_ssl_server_conn, could not load certificate from memory')
|
||||
}
|
||||
res = C.v_net_openssl_SSL_CTX_use_PrivateKey_memory(sslctx, config.cert_key.str,
|
||||
usize(config.cert_key.len))
|
||||
uint(config.cert_key.len))
|
||||
if res != 1 {
|
||||
C.SSL_CTX_free(sslctx)
|
||||
return error('net.openssl new_ssl_server_conn, could not load private key from memory')
|
||||
|
||||
@@ -102,4 +102,5 @@ fn test_format_thousands_float_non_finite() {
|
||||
|
||||
fn test_format_legacy_signed_integer() {
|
||||
assert format_thousands(isize(-1234567), ',') == '-1,234,567'
|
||||
assert grouped(isize(-1234567)) == '-1,234,567'
|
||||
}
|
||||
@@ -4,9 +4,9 @@ $if darwin {
|
||||
import macos
|
||||
import math
|
||||
|
||||
fn C.strlen(s &char) usize
|
||||
fn C.calloc(n usize, size usize) voidptr
|
||||
fn C.memcpy(dest voidptr, src voidptr, n usize) voidptr
|
||||
fn C.strlen(s &char) uint
|
||||
fn C.calloc(n uint, size uint) voidptr
|
||||
fn C.memcpy(dest voidptr, src voidptr, n uint) voidptr
|
||||
|
||||
@[export: 'v_multiwindow_appkit_string']
|
||||
fn v_multiwindow_appkit_string(value &char) voidptr {
|
||||
@@ -51,7 +51,7 @@ $if darwin {
|
||||
if value == unsafe { nil } {
|
||||
return unsafe { nil }
|
||||
}
|
||||
len := usize(C.strlen(value))
|
||||
len := uint(C.strlen(value))
|
||||
copy := &char(C.calloc(len + 1, 1))
|
||||
if copy == unsafe { nil } {
|
||||
return unsafe { nil }
|
||||
|
||||
Reference in new issue
Block a user