From a87a4d73b9ab25cfff0822f4e94cf2a2d9e64323 Mon Sep 17 00:00:00 2001 From: kbkpbot Date: Sat, 7 Feb 2026 13:46:34 +0800 Subject: [PATCH] all: replace `int` with `i32` in `fn C.name(x int) int` declarations (#26522) --- cmd/v2/test.v | 2 +- examples/1brc/solution/main.v | 4 +- examples/c_interop_wkhtmltopdf.v | 8 +- examples/call_c_from_v/main.c.v | 2 +- examples/minimal_c_like_program_using_puts.v | 2 +- vlib/builtin/backtraces_nix.c.v | 2 +- vlib/builtin/backtraces_windows.c.v | 8 +- vlib/builtin/builtin.c.v | 6 +- vlib/builtin/builtin_backtraces_nix.c.v | 6 +- vlib/builtin/builtin_d_gcboehm.c.v | 8 +- vlib/builtin/builtin_d_use_libbacktrace.c.v | 6 +- vlib/builtin/builtin_windows.c.v | 2 +- vlib/builtin/cfns.c.v | 310 +++++++++--------- vlib/clipboard/clipboard_windows.c.v | 8 +- vlib/clipboard/x11/clipboard.c.v | 32 +- vlib/compress/compress.c.v | 6 +- vlib/compress/szip/szip.c.v | 26 +- vlib/compress/zstd/zstd.c.v | 16 +- vlib/coroutines/coroutines.c.v | 12 +- vlib/crypto/ecdsa/ecdsa.c.v | 100 +++--- vlib/crypto/rand/rand_darwin.c.v | 2 +- vlib/crypto/rand/rand_solaris.c.v | 2 +- vlib/db/mysql/_cdefs.c.v | 28 +- vlib/db/mysql/stmt.c.v | 12 +- vlib/db/pg/pg.c.v | 36 +- vlib/db/sqlite/sqlite.c.v | 34 +- vlib/db/sqlite/stmt.c.v | 10 +- vlib/db/sqlite/vfs_lowlevel.c.v | 6 +- vlib/dl/dl_nix.c.v | 4 +- vlib/dlmalloc/dlmalloc_sys_nix.c.v | 4 +- vlib/encoding/iconv/iconv_nix.c.v | 2 +- vlib/encoding/iconv/iconv_windows.c.v | 8 +- vlib/fasthttp/fasthttp.v | 16 +- vlib/fasthttp/fasthttp_darwin.v | 8 +- vlib/fasthttp/fasthttp_linux.v | 12 +- vlib/fontstash/fontstash_funcs.c.v | 20 +- vlib/gg/gg.c.v | 8 +- vlib/gg/gg_darwin.c.v | 6 +- vlib/math/bits/bits.c.v | 20 +- vlib/math/exp.c.v | 2 +- vlib/net/aasocket.c.v | 56 ++-- vlib/net/mbedtls/mbedtls.c.v | 44 +-- vlib/net/net_nix.c.v | 2 +- vlib/net/openssl/openssl.c.v | 42 +-- vlib/net/unix/common.c.v | 2 +- vlib/os/debugger_darwin.c.v | 2 +- vlib/os/debugger_freebsd.c.v | 2 +- vlib/os/debugger_openbsd.c.v | 2 +- vlib/os/environment.c.v | 2 +- vlib/os/fd.c.v | 6 +- vlib/os/file.c.v | 6 +- vlib/os/file_buffering.c.v | 2 +- vlib/os/filelock/lib_nix.c.v | 6 +- vlib/os/notify/backend_darwin.c.v | 6 +- vlib/os/notify/backend_linux.c.v | 6 +- vlib/os/os.c.v | 24 +- vlib/os/os_android_outside_termux.c.v | 6 +- vlib/os/os_nix.c.v | 22 +- vlib/os/os_windows.c.v | 8 +- vlib/os/pipe.c.v | 8 +- vlib/os/process_nix.c.v | 2 +- vlib/os/process_windows.c.v | 2 +- vlib/os/signal.c.v | 2 +- vlib/os/signal_darwin.c.v | 4 +- vlib/os/signal_linux.c.v | 4 +- vlib/os/sleeping.c.v | 2 +- vlib/picoev/loop_freebsd.c.v | 6 +- vlib/picoev/loop_linux.c.v | 6 +- vlib/picoev/loop_macos.c.v | 6 +- vlib/picoev/loop_openbsd.c.v | 6 +- vlib/picoev/loop_termux.c.v | 6 +- vlib/picohttpparser/response.c.v | 2 +- vlib/readline/readline_nix.c.v | 4 +- vlib/runtime/free_memory_impl_darwin.c.v | 6 +- vlib/runtime/free_memory_impl_freebsd.c.v | 2 +- vlib/runtime/runtime_nix.c.v | 2 +- vlib/runtime/used_memory_darwin.c.v | 2 +- vlib/runtime/used_memory_freebsd.c.v | 4 +- vlib/runtime/used_memory_openbsd.c.v | 2 +- vlib/runtime/used_memory_windows.c.v | 2 +- vlib/sokol/audio/audio.c.v | 10 +- vlib/sokol/gfx/gfx_funcs.c.v | 10 +- vlib/sokol/sapp/sapp_funcs.c.v | 16 +- vlib/sokol/sapp/sapp_v.c.v | 2 +- vlib/sokol/sgl/sgl_funcs.c.v | 4 +- vlib/stbi/stbi.c.v | 28 +- vlib/sync/stdatomic/1.declarations.c.v | 6 +- vlib/sync/sync_darwin.c.v | 44 +-- vlib/sync/sync_default.c.v | 42 +-- vlib/sync/sync_freebsd.c.v | 42 +-- vlib/sync/sync_windows.c.v | 6 +- vlib/sync/tls_default.c.v | 6 +- vlib/term/term_nix.c.v | 2 +- vlib/term/term_windows.c.v | 4 +- vlib/term/termios/termios_android.c.v | 6 +- vlib/term/termios/termios_darwin.c.v | 6 +- vlib/term/termios/termios_dragonfly.c.v | 6 +- vlib/term/termios/termios_freebsd.c.v | 6 +- vlib/term/termios/termios_linux.c.v | 6 +- vlib/term/termios/termios_netbsd.c.v | 6 +- vlib/term/termios/termios_openbsd.c.v | 6 +- vlib/term/termios/termios_qnx.c.v | 6 +- vlib/term/termios/termios_solaris.c.v | 6 +- vlib/time/time_darwin.c.v | 2 +- vlib/time/time_nix.c.v | 4 +- vlib/time/time_windows.c.v | 2 +- .../c/testdata/multiple_c_cources/sources.v | 4 +- vlib/v/slow_tests/keep_args_alive_test.c.v | 2 +- vlib/v/tests/c_array_test.c.v | 4 +- vlib/v/tests/c_structs/cstruct_alias_test.v | 2 +- .../tests/cflags/vmodroot_and_vroot_test.c.v | 2 +- vlib/v/tests/fns/fn_test.c.v | 4 +- vlib/v/tests/interop_test.c.v | 2 +- vlib/v/tests/project_with_c_code/main.v | 2 +- vlib/v/tests/project_with_c_code/main1_test.v | 2 +- .../project_with_c_code/mod1/wrapper.c.v | 2 +- .../project_with_c_code_2/modc/wrapper.c.v | 6 +- ...p_files_with_a_cplusplus_compiler_test.c.v | 2 +- vlib/v/trace_calls/tracing_calls_nix.c.v | 2 +- vlib/veb/sendfile_freebsd.c.v | 2 +- vlib/veb/sendfile_linux.c.v | 2 +- vlib/x/crypto/slhdsa/slhdsa.c.v | 48 +-- 122 files changed, 752 insertions(+), 752 deletions(-) diff --git a/cmd/v2/test.v b/cmd/v2/test.v index 58ce24572..98a43d9a7 100644 --- a/cmd/v2/test.v +++ b/cmd/v2/test.v @@ -354,7 +354,7 @@ fn print_str(s string) { } // C function with keyword name (tests parser allowing keywords after C.) -fn C.select(ndfs int, readfds voidptr, writefds voidptr, exceptfds voidptr, timeout voidptr) int +fn C.select(ndfs i32, readfds voidptr, writefds voidptr, exceptfds voidptr, timeout voidptr) i32 fn nested_return(x int) int { if x < 10 { diff --git a/examples/1brc/solution/main.v b/examples/1brc/solution/main.v index 6b2a7352c..e8b7af09e 100644 --- a/examples/1brc/solution/main.v +++ b/examples/1brc/solution/main.v @@ -5,8 +5,8 @@ import os #include -fn C.mmap(addr voidptr, len u64, prot int, flags int, fd int, offset i64) voidptr -fn C.munmap(addr voidptr, len u64) int +fn C.mmap(addr voidptr, len u64, prot i32, flags i32, fd i32, offset i64) voidptr +fn C.munmap(addr voidptr, len u64) i32 struct MemoryMappedFile { size u64 diff --git a/examples/c_interop_wkhtmltopdf.v b/examples/c_interop_wkhtmltopdf.v index 61a7778f7..384e0a8b9 100644 --- a/examples/c_interop_wkhtmltopdf.v +++ b/examples/c_interop_wkhtmltopdf.v @@ -19,9 +19,9 @@ pub struct C.wkhtmltopdf_object_settings {} pub struct C.wkhtmltopdf_converter {} -fn C.wkhtmltopdf_init(use_graphics bool) int +fn C.wkhtmltopdf_init(use_graphics bool) i32 -fn C.wkhtmltopdf_deinit() int +fn C.wkhtmltopdf_deinit() i32 fn C.wkhtmltopdf_version() &char @@ -46,9 +46,9 @@ fn C.wkhtmltopdf_add_object(converter &C.wkhtmltopdf_converter, object_settings fn C.wkhtmltopdf_convert(converter &C.wkhtmltopdf_converter) bool -fn C.wkhtmltopdf_http_error_code(converter &C.wkhtmltopdf_converter) int +fn C.wkhtmltopdf_http_error_code(converter &C.wkhtmltopdf_converter) i32 -fn C.wkhtmltopdf_get_output(converter &C.wkhtmltopdf_converter, data &&char) int +fn C.wkhtmltopdf_get_output(converter &C.wkhtmltopdf_converter, data &&char) i32 fn main() { // init diff --git a/examples/call_c_from_v/main.c.v b/examples/call_c_from_v/main.c.v index fd66439b1..8e6a45b56 100644 --- a/examples/call_c_from_v/main.c.v +++ b/examples/call_c_from_v/main.c.v @@ -1,6 +1,6 @@ #include -fn C.puts(&char) int +fn C.puts(&char) i32 fn main() { C.puts(c'V can call C functions like `puts` too.') diff --git a/examples/minimal_c_like_program_using_puts.v b/examples/minimal_c_like_program_using_puts.v index aa1712162..c6f269870 100644 --- a/examples/minimal_c_like_program_using_puts.v +++ b/examples/minimal_c_like_program_using_puts.v @@ -6,7 +6,7 @@ module no_main // With clang-10, on Ubuntu 20.04, it produces an executable with a size of 2331 bytes, after stripping. // Note: the above uses sstrip 2.1 (from https://git.sr.ht/~breadbox/ELFkickers) and mold 2.32.0 (from https://github.com/rui314/mold). -fn C.puts(const_msg &char) int +fn C.puts(const_msg &char) i32 @[export: 'main'] fn hello() int { diff --git a/vlib/builtin/backtraces_nix.c.v b/vlib/builtin/backtraces_nix.c.v index 24debfb67..51c25456b 100644 --- a/vlib/builtin/backtraces_nix.c.v +++ b/vlib/builtin/backtraces_nix.c.v @@ -37,7 +37,7 @@ fn print_backtrace_skipping_top_frames_bsd(skipframes int) bool { } } -fn C.tcc_backtrace(fmt &char) int +fn C.tcc_backtrace(fmt &char) i32 @[direct_array_access] fn print_backtrace_skipping_top_frames_linux(skipframes int) bool { $if android { diff --git a/vlib/builtin/backtraces_windows.c.v b/vlib/builtin/backtraces_windows.c.v index f8074dc48..69ff1600c 100644 --- a/vlib/builtin/backtraces_windows.c.v +++ b/vlib/builtin/backtraces_windows.c.v @@ -44,13 +44,13 @@ fn C.SymSetOptions(symoptions u32) u32 // returns handle fn C.GetCurrentProcess() voidptr -fn C.SymInitialize(h_process voidptr, p_user_search_path &u8, b_invade_process int) int +fn C.SymInitialize(h_process voidptr, p_user_search_path &u8, b_invade_process i32) i32 fn C.CaptureStackBackTrace(frames_to_skip u32, frames_to_capture u32, p_backtrace voidptr, p_backtrace_hash voidptr) u16 -fn C.SymFromAddr(h_process voidptr, address u64, p_displacement voidptr, p_symbol voidptr) int +fn C.SymFromAddr(h_process voidptr, address u64, p_displacement voidptr, p_symbol voidptr) i32 -fn C.SymGetLineFromAddr64(h_process voidptr, address u64, p_displacement voidptr, p_line &Line64) int +fn C.SymGetLineFromAddr64(h_process voidptr, address u64, p_displacement voidptr, p_line &Line64) i32 // Ref - https://docs.microsoft.com/en-us/windows/win32/api/dbghelp/nf-dbghelp-symsetoptions const symopt_undname = 0x00000002 @@ -157,7 +157,7 @@ fn print_backtrace_skipping_top_frames_mingw(skipframes int) bool { return false } -fn C.tcc_backtrace(fmt &char) int +fn C.tcc_backtrace(fmt &char) i32 fn print_backtrace_skipping_top_frames_tcc(skipframes int) bool { $if tinyc && !native { diff --git a/vlib/builtin/builtin.c.v b/vlib/builtin/builtin.c.v index 730f8c9b4..f7a90340e 100644 --- a/vlib/builtin/builtin.c.v +++ b/vlib/builtin/builtin.c.v @@ -16,12 +16,12 @@ __global g_live_reload_info voidptr pub type FnExitCb = fn () -fn C.atexit(f FnExitCb) int -fn C.strerror(int) &char +fn C.atexit(f FnExitCb) i32 +fn C.strerror(i32) &char // These functions (_vinit, and _vcleanup), are generated by V, and if you have a `module no_main` program, // you should ensure to call them when appropriate. -fn C._vinit(argc int, argv &&char) +fn C._vinit(argc i32, argv &&char) fn C._vcleanup() diff --git a/vlib/builtin/builtin_backtraces_nix.c.v b/vlib/builtin/builtin_backtraces_nix.c.v index 74d1f258c..d53660953 100644 --- a/vlib/builtin/builtin_backtraces_nix.c.v +++ b/vlib/builtin/builtin_backtraces_nix.c.v @@ -1,6 +1,6 @@ module builtin // -fn C.backtrace(a &voidptr, size int) int -fn C.backtrace_symbols(a &voidptr, size int) &&char -fn C.backtrace_symbols_fd(a &voidptr, size int, fd int) +fn C.backtrace(a &voidptr, size i32) i32 +fn C.backtrace_symbols(a &voidptr, size i32) &&char +fn C.backtrace_symbols_fd(a &voidptr, size i32, fd i32) diff --git a/vlib/builtin/builtin_d_gcboehm.c.v b/vlib/builtin/builtin_d_gcboehm.c.v index d0ebf08cb..731a4bf75 100644 --- a/vlib/builtin/builtin_d_gcboehm.c.v +++ b/vlib/builtin/builtin_d_gcboehm.c.v @@ -164,7 +164,7 @@ fn C.GC_disable() fn C.GC_enable() // returns non-zero if GC is disabled -fn C.GC_is_disabled() int +fn C.GC_is_disabled() i32 // protect memory block from being freed before this call fn C.GC_reachable_here(voidptr) @@ -215,9 +215,9 @@ pub struct C.GC_stack_base { // reg_base voidptr } -fn C.GC_get_stack_base(voidptr) int -fn C.GC_register_my_thread(voidptr) int -fn C.GC_unregister_my_thread() int +fn C.GC_get_stack_base(voidptr) i32 +fn C.GC_register_my_thread(voidptr) i32 +fn C.GC_unregister_my_thread() i32 // fn C.GC_get_my_stackbottom(voidptr) voidptr fn C.GC_set_stackbottom(voidptr, voidptr) diff --git a/vlib/builtin/builtin_d_use_libbacktrace.c.v b/vlib/builtin/builtin_d_use_libbacktrace.c.v index 530388ecc..79c11df59 100644 --- a/vlib/builtin/builtin_d_use_libbacktrace.c.v +++ b/vlib/builtin/builtin_d_use_libbacktrace.c.v @@ -14,9 +14,9 @@ type BacktraceErrorCallback = fn (data voidptr, msg &char, errnum int) voidptr type BacktraceFullCallback = fn (data voidptr, pc voidptr, filename &char, lineno int, func &char) &int -fn C.backtrace_create_state(filename &char, threaded int, error_callback BacktraceErrorCallback, data voidptr) &C.backtrace_state -fn C.backtrace_full(state &C.backtrace_state, skip int, cb BacktraceFullCallback, err_cb BacktraceErrorCallback, - data voidptr) int +fn C.backtrace_create_state(filename &char, threaded i32, error_callback BacktraceErrorCallback, data voidptr) &C.backtrace_state +fn C.backtrace_full(state &C.backtrace_state, skip i32, cb BacktraceFullCallback, err_cb BacktraceErrorCallback, + data voidptr) i32 __global bt_state = init_bt_state() diff --git a/vlib/builtin/builtin_windows.c.v b/vlib/builtin/builtin_windows.c.v index 2b769366c..1ad4675d8 100644 --- a/vlib/builtin/builtin_windows.c.v +++ b/vlib/builtin/builtin_windows.c.v @@ -114,7 +114,7 @@ pub: type VectoredExceptionHandler = fn (&ExceptionPointers) int -fn C.AddVectoredExceptionHandler(int, voidptr) +fn C.AddVectoredExceptionHandler(i32, voidptr) fn add_vectored_exception_handler(handler VectoredExceptionHandler) { C.AddVectoredExceptionHandler(1, voidptr(handler)) diff --git a/vlib/builtin/cfns.c.v b/vlib/builtin/cfns.c.v index 9a7ad27fc..6de56fdaa 100644 --- a/vlib/builtin/cfns.c.v +++ b/vlib/builtin/cfns.c.v @@ -6,13 +6,13 @@ pub struct C.FILE {} // fn C.memcpy(dest voidptr, const_src voidptr, n usize) voidptr -fn C.memcmp(const_s1 voidptr, const_s2 voidptr, n usize) int +fn C.memcmp(const_s1 voidptr, const_s2 voidptr, n usize) i32 fn C.memmove(dest voidptr, const_src voidptr, n usize) voidptr -fn C.memset(str voidptr, c int, n usize) voidptr +fn C.memset(str voidptr, c i32, n usize) voidptr -fn C.memchr(str voidptr, c int, n usize) voidptr +fn C.memchr(str voidptr, c i32, n usize) voidptr fn C.memmem(haystack voidptr, haystacklen usize, needle voidptr, needlelen usize) voidptr @@ -21,7 +21,7 @@ fn C.mempcpy(dest voidptr, src voidptr, n usize) voidptr @[trusted] fn C.calloc(usize, usize) voidptr -fn C.atoi(&char) int +fn C.atoi(&char) i32 fn C.malloc(usize) voidptr @@ -29,8 +29,8 @@ fn C.realloc(a voidptr, b usize) voidptr fn C.free(ptr voidptr) -fn C.mmap(addr_length voidptr, length usize, prot int, flags int, fd int, offset isize) voidptr -fn C.mprotect(addr_length voidptr, len usize, prot int) int +fn C.mmap(addr_length voidptr, length usize, prot i32, flags i32, fd i32, offset isize) voidptr +fn C.mprotect(addr_length voidptr, len usize, prot i32) i32 fn C.aligned_alloc(align usize, size usize) voidptr @@ -47,75 +47,75 @@ fn C.VirtualAlloc(voidptr, isize, u32, u32) voidptr fn C.VirtualProtect(voidptr, isize, u32, &u32) bool @[noreturn; trusted] -fn C.exit(code int) +fn C.exit(code i32) fn C.qsort(base voidptr, items usize, item_size usize, cb C.qsort_callback_func) -fn C.strlen(s &char) int +fn C.strlen(s &char) i32 @[trusted] -fn C.isdigit(c int) bool +fn C.isdigit(c i32) bool // stdio.h fn C.popen(c &char, t &char) voidptr // -fn C.proc_pidpath(int, voidptr, int) int +fn C.proc_pidpath(i32, voidptr, i32) i32 fn C.realpath(const_path &char, resolved_path &char) &char // fn C.chmod(byteptr, mode_t) int -fn C.chmod(path &char, mode u32) int +fn C.chmod(path &char, mode u32) i32 -fn C.printf(const_format &char, opt ...voidptr) int -fn C.dprintf(fd int, const_format &char, opt ...voidptr) int -fn C.fprintf(fstream &C.FILE, const_format &char, opt ...voidptr) int -fn C.sprintf(str &char, const_format &char, opt ...voidptr) int -fn C.snprintf(str &char, size usize, const_format &char, opt ...voidptr) int -fn C.wprintf(const_format &u16, opt ...voidptr) int +fn C.printf(const_format &char, opt ...voidptr) i32 +fn C.dprintf(fd i32, const_format &char, opt ...voidptr) i32 +fn C.fprintf(fstream &C.FILE, const_format &char, opt ...voidptr) i32 +fn C.sprintf(str &char, const_format &char, opt ...voidptr) i32 +fn C.snprintf(str &char, size usize, const_format &char, opt ...voidptr) i32 +fn C.wprintf(const_format &u16, opt ...voidptr) i32 // used by Android for (e)println to output to the Android log system / logcat pub fn C.android_print(fstream voidptr, format &char, opt ...voidptr) -fn C.sscanf(str &char, const_format &char, opt ...voidptr) int -fn C.scanf(const_format &char, opt ...voidptr) int +fn C.sscanf(str &char, const_format &char, opt ...voidptr) i32 +fn C.scanf(const_format &char, opt ...voidptr) i32 -fn C.puts(msg &char) int +fn C.puts(msg &char) i32 @[trusted] fn C.abs(f64) f64 -fn C.fputs(msg &char, fstream &C.FILE) int +fn C.fputs(msg &char, fstream &C.FILE) i32 -fn C.fflush(fstream &C.FILE) int +fn C.fflush(fstream &C.FILE) i32 // TODO: define args in these functions -fn C.fseek(stream &C.FILE, offset int, whence int) int +fn C.fseek(stream &C.FILE, offset i32, whence i32) i32 fn C.fopen(filename &char, mode &char) &C.FILE -fn C.fileno(&C.FILE) int +fn C.fileno(&C.FILE) i32 fn C.fread(ptr voidptr, item_size usize, items usize, stream &C.FILE) usize fn C.fwrite(ptr voidptr, item_size usize, items usize, stream &C.FILE) usize -fn C.fclose(stream &C.FILE) int +fn C.fclose(stream &C.FILE) i32 -fn C.pclose(stream &C.FILE) int +fn C.pclose(stream &C.FILE) i32 -fn C.open(path &char, flags int, mode ...int) int -fn C.close(fd int) int +fn C.open(path &char, flags i32, mode ...int) i32 +fn C.close(fd i32) i32 -fn C.strrchr(s &char, c int) &char -fn C.strchr(s &char, c int) &char +fn C.strrchr(s &char, c i32) &char +fn C.strchr(s &char, c i32) &char // process execution, os.process: @[trusted] fn C.GetCurrentProcessId() u32 @[trusted] -fn C._getpid() int +fn C._getpid() i32 @[trusted] -fn C.getpid() int +fn C.getpid() i32 @[trusted] fn C.GetCurrentThreadId() u32 @@ -123,81 +123,81 @@ fn C.GetCurrentThreadId() u32 fn C.gettid() u32 @[trusted] -fn C.getuid() int +fn C.getuid() i32 @[trusted] -fn C.geteuid() int +fn C.geteuid() i32 -fn C.system(cmd &char) int +fn C.system(cmd &char) i32 -fn C.posix_spawn(child_pid &int, path &char, file_actions voidptr, attrp voidptr, argv &&char, envp &&char) int +fn C.posix_spawn(child_pid &int, path &char, file_actions voidptr, attrp voidptr, argv &&char, envp &&char) i32 -fn C.posix_spawnp(child_pid &int, exefile &char, file_actions voidptr, attrp voidptr, argv &&char, envp &&char) int +fn C.posix_spawnp(child_pid &int, exefile &char, file_actions voidptr, attrp voidptr, argv &&char, envp &&char) i32 -fn C.execve(cmd_path &char, args voidptr, envs voidptr) int +fn C.execve(cmd_path &char, args voidptr, envs voidptr) i32 -fn C.execvp(cmd_path &char, args &&char) int +fn C.execvp(cmd_path &char, args &&char) i32 -fn C._execve(cmd_path &char, args voidptr, envs voidptr) int +fn C._execve(cmd_path &char, args voidptr, envs voidptr) i32 -fn C._execvp(cmd_path &char, args &&char) int +fn C._execvp(cmd_path &char, args &&char) i32 -fn C.strcmp(s1 &char, s2 &char) int +fn C.strcmp(s1 &char, s2 &char) i32 @[trusted] -fn C.fork() int +fn C.fork() i32 -fn C.wait(status &int) int +fn C.wait(status &int) i32 -fn C.waitpid(pid int, status &int, options int) int +fn C.waitpid(pid i32, status &int, options i32) i32 @[trusted] -fn C.kill(pid int, sig int) int +fn C.kill(pid i32, sig i32) i32 -fn C.setenv(&char, &char, int) int +fn C.setenv(&char, &char, i32) i32 -fn C.unsetenv(&char) int +fn C.unsetenv(&char) i32 -fn C.access(path &char, amode int) int +fn C.access(path &char, amode i32) i32 -fn C.remove(filename &char) int +fn C.remove(filename &char) i32 -fn C.rmdir(path &char) int +fn C.rmdir(path &char) i32 -fn C.chdir(path &char) int +fn C.chdir(path &char) i32 -fn C.rewind(stream &C.FILE) int +fn C.rewind(stream &C.FILE) i32 fn C.ftell(&C.FILE) isize -fn C.stat(&char, voidptr) int +fn C.stat(&char, voidptr) i32 -fn C.lstat(path &char, buf &C.stat) int +fn C.lstat(path &char, buf &C.stat) i32 -fn C.statvfs(const_path &char, buf &C.statvfs) int +fn C.statvfs(const_path &char, buf &C.statvfs) i32 -fn C.rename(old_filename &char, new_filename &char) int +fn C.rename(old_filename &char, new_filename &char) i32 -fn C.fgets(str &char, n int, stream &C.FILE) int +fn C.fgets(str &char, n i32, stream &C.FILE) i32 -fn C.fgetpos(&C.FILE, voidptr) int +fn C.fgetpos(&C.FILE, voidptr) i32 @[trusted] -fn C.sigemptyset() int +fn C.sigemptyset() i32 fn C.getcwd(buf &char, size usize) &char @[trusted] -fn C.mktime() int +fn C.mktime() i32 -fn C.gettimeofday(tv &C.timeval, tz &C.timezone) int +fn C.gettimeofday(tv &C.timeval, tz &C.timezone) i32 @[trusted] fn C.sleep(seconds u32) u32 // fn C.usleep(usec useconds_t) int @[trusted] -fn C.usleep(usec u32) int +fn C.usleep(usec u32) i32 @[typedef] pub struct C.DIR { @@ -205,14 +205,14 @@ pub struct C.DIR { fn C.opendir(&char) &C.DIR -fn C.closedir(dirp &C.DIR) int +fn C.closedir(dirp &C.DIR) i32 // fn C.mkdir(path &char, mode mode_t) int -fn C.mkdir(path &char, mode u32) int +fn C.mkdir(path &char, mode u32) i32 // C.rand returns a pseudorandom integer from 0 (inclusive) to C.RAND_MAX (exclusive) @[trusted] -fn C.rand() int +fn C.rand() i32 // C.srand seeds the internal PRNG with the given value. @[trusted] @@ -221,58 +221,58 @@ fn C.srand(seed u32) fn C.atof(str &char) f64 @[trusted] -fn C.tolower(c int) int +fn C.tolower(c i32) i32 @[trusted] -fn C.toupper(c int) int +fn C.toupper(c i32) i32 @[trusted] -fn C.isspace(c int) int +fn C.isspace(c i32) i32 -fn C.strchr(s &char, c int) &char +fn C.strchr(s &char, c i32) &char @[trusted] -fn C.getchar() int +fn C.getchar() i32 @[trusted] -fn C.putchar(int) int +fn C.putchar(i32) i32 fn C.strdup(s &char) &char -fn C.strncasecmp(s &char, s2 &char, n int) int +fn C.strncasecmp(s &char, s2 &char, n i32) i32 -fn C.strcasecmp(s &char, s2 &char) int +fn C.strcasecmp(s &char, s2 &char) i32 -fn C.strncmp(s &char, s2 &char, n int) int +fn C.strncmp(s &char, s2 &char, n i32) i32 @[trusted] -fn C.strerror(int) &char +fn C.strerror(i32) &char @[trusted] -fn C.WIFEXITED(status int) bool +fn C.WIFEXITED(status i32) bool @[trusted] -fn C.WEXITSTATUS(status int) int +fn C.WEXITSTATUS(status i32) i32 @[trusted] -fn C.WIFSIGNALED(status int) bool +fn C.WIFSIGNALED(status i32) bool @[trusted] -fn C.WTERMSIG(status int) int +fn C.WTERMSIG(status i32) i32 @[trusted] -fn C.isatty(fd int) int +fn C.isatty(fd i32) i32 -fn C.syscall(number int, va ...voidptr) int +fn C.syscall(number i32, va ...voidptr) i32 -fn C.sysctl(name &int, namelen u32, oldp voidptr, oldlenp voidptr, newp voidptr, newlen usize) int +fn C.sysctl(name &int, namelen u32, oldp voidptr, oldlenp voidptr, newp voidptr, newlen usize) i32 @[trusted] -fn C._fileno(int) int +fn C._fileno(i32) i32 pub type C.intptr_t = voidptr -fn C._get_osfhandle(fd int) C.intptr_t +fn C._get_osfhandle(fd i32) C.intptr_t fn C.GetModuleFileName(hModule voidptr, lpFilename &u16, nSize u32) u32 @@ -309,19 +309,19 @@ fn C.ReadFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToRead u32, lpNumbe fn C.GetFileAttributesW(lpFileName &u8) u32 -fn C.RegQueryValueEx(hKey voidptr, lpValueName &u16, lp_reserved &u32, lpType &u32, lpData &u8, lpcbData &u32) int +fn C.RegQueryValueEx(hKey voidptr, lpValueName &u16, lp_reserved &u32, lpType &u32, lpData &u8, lpcbData &u32) i32 -fn C.RegQueryValueExW(hKey voidptr, lpValueName &u16, lp_reserved &u32, lpType &u32, lpData &u8, lpcbData &u32) int +fn C.RegQueryValueExW(hKey voidptr, lpValueName &u16, lp_reserved &u32, lpType &u32, lpData &u8, lpcbData &u32) i32 -fn C.RegOpenKeyEx(hKey voidptr, lpSubKey &u16, ulOptions u32, samDesired u32, phkResult voidptr) int +fn C.RegOpenKeyEx(hKey voidptr, lpSubKey &u16, ulOptions u32, samDesired u32, phkResult voidptr) i32 -fn C.RegOpenKeyExW(hKey voidptr, lpSubKey &u16, ulOptions u32, samDesired u32, phkResult voidptr) int +fn C.RegOpenKeyExW(hKey voidptr, lpSubKey &u16, ulOptions u32, samDesired u32, phkResult voidptr) i32 -fn C.RegSetValueEx(hKey voidptr, lpValueName &u16, dwType u32, lpData &u16, cbData u32) int +fn C.RegSetValueEx(hKey voidptr, lpValueName &u16, dwType u32, lpData &u16, cbData u32) i32 -fn C.RegSetValueExW(hKey voidptr, lpValueName &u16, reserved u32, dwType u32, const_lpData &u8, cbData u32) int +fn C.RegSetValueExW(hKey voidptr, lpValueName &u16, reserved u32, dwType u32, const_lpData &u8, cbData u32) i32 -fn C.RegCloseKey(hKey voidptr) int +fn C.RegCloseKey(hKey voidptr) i32 fn C.RemoveDirectory(lpPathName &u16) bool @@ -341,34 +341,34 @@ fn C.setbuf(voidptr, &char) fn C.SymCleanup(hProcess voidptr) -fn C.MultiByteToWideChar(codePage u32, dwFlags u32, lpMultiMyteStr &char, cbMultiByte int, lpWideCharStr &u16, - cchWideChar int) int +fn C.MultiByteToWideChar(codePage u32, dwFlags u32, lpMultiMyteStr &char, cbMultiByte i32, lpWideCharStr &u16, + cchWideChar i32) i32 fn C.wcslen(str voidptr) usize -fn C.WideCharToMultiByte(codePage u32, dwFlags u32, lpWideCharStr &u16, cchWideChar int, lpMultiByteStr &char, - cbMultiByte int, lpDefaultChar &char, lpUsedDefaultChar &int) int +fn C.WideCharToMultiByte(codePage u32, dwFlags u32, lpWideCharStr &u16, cchWideChar i32, lpMultiByteStr &char, + cbMultiByte i32, lpDefaultChar &char, lpUsedDefaultChar &int) i32 -fn C._wstat(path &u16, buffer &C._stat) int +fn C._wstat(path &u16, buffer &C._stat) i32 -fn C._wrename(oldname &u16, newname &u16) int +fn C._wrename(oldname &u16, newname &u16) i32 fn C._wfopen(filename &u16, mode &u16) voidptr fn C._wpopen(command &u16, mode &u16) voidptr -fn C._pclose(stream &C.FILE) int +fn C._pclose(stream &C.FILE) i32 -fn C._wsystem(command &u16) int +fn C._wsystem(command &u16) i32 fn C._wgetenv(varname &u16) voidptr -fn C._putenv(envstring &char) int -fn C._wputenv(envstring &u16) int +fn C._putenv(envstring &char) i32 +fn C._wputenv(envstring &u16) i32 -fn C._waccess(path &u16, mode int) int +fn C._waccess(path &u16, mode i32) i32 -fn C._wremove(path &u16) int +fn C._wremove(path &u16) i32 fn C.ReadConsole(in_input_handle voidptr, out_buffer voidptr, in_chars_to_read u32, out_read_chars &u32, in_input_control voidptr) bool @@ -377,11 +377,11 @@ fn C.WriteConsole() voidptr fn C.WriteFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToWrite u32, lpNumberOfBytesWritten &u32, lpOverlapped voidptr) bool -fn C._wchdir(dirname &u16) int +fn C._wchdir(dirname &u16) i32 -fn C._wgetcwd(buffer &u16, maxlen int) int +fn C._wgetcwd(buffer &u16, maxlen i32) i32 -fn C._fullpath() int +fn C._fullpath() i32 fn C.GetFullPathName(voidptr, u32, voidptr, voidptr) u32 @@ -394,17 +394,17 @@ fn C.FindFirstFileW(lpFileName &u16, lpFindFileData voidptr) voidptr fn C.FindFirstFile(lpFileName &u8, lpFindFileData voidptr) voidptr -fn C.FindNextFile(hFindFile voidptr, lpFindFileData voidptr) int +fn C.FindNextFile(hFindFile voidptr, lpFindFileData voidptr) i32 fn C.FindClose(hFindFile voidptr) // macro -fn C.MAKELANGID(lgid voidptr, srtid voidptr) int +fn C.MAKELANGID(lgid voidptr, srtid voidptr) i32 fn C.FormatMessageW(dwFlags u32, lpSource voidptr, dwMessageId u32, dwLanguageId u32, lpBuffer voidptr, nSize u32, arguments ...voidptr) u32 -fn C.CloseHandle(voidptr) int +fn C.CloseHandle(voidptr) i32 fn C.GetExitCodeProcess(hProcess voidptr, lpExitCode &u32) @@ -414,43 +414,43 @@ fn C.GetTickCount() i64 @[trusted] fn C.Sleep(dwMilliseconds u32) -fn C.WSAStartup(u16, &voidptr) int +fn C.WSAStartup(u16, &voidptr) i32 @[trusted] -fn C.WSAGetLastError() int +fn C.WSAGetLastError() i32 -fn C.closesocket(int) int +fn C.closesocket(i32) i32 fn C.vschannel_init(&C.TlsContext) -fn C.request(&C.TlsContext, int, &u16, &u8, u32, &&u8, fn (voidptr, isize) voidptr) int +fn C.request(&C.TlsContext, i32, &u16, &u8, u32, &&u8, fn (voidptr, isize) voidptr) i32 fn C.vschannel_cleanup(&C.TlsContext) -fn C.URLDownloadToFile(int, &u16, &u16, int, int) +fn C.URLDownloadToFile(i32, &u16, &u16, i32, i32) @[trusted] fn C.GetLastError() u32 -fn C.CreateDirectory(&u8, int) bool +fn C.CreateDirectory(&u8, i32) bool // win crypto -fn C.BCryptGenRandom(int, voidptr, int, int) int +fn C.BCryptGenRandom(i32, voidptr, i32, i32) i32 // win synchronization -fn C.CreateMutex(int, bool, &u8) voidptr +fn C.CreateMutex(i32, bool, &u8) voidptr -fn C.WaitForSingleObject(voidptr, int) int +fn C.WaitForSingleObject(voidptr, i32) i32 fn C.ReleaseMutex(voidptr) bool -fn C.CreateEvent(int, bool, bool, &u8) voidptr +fn C.CreateEvent(i32, bool, bool, &u8) voidptr -fn C.SetEvent(voidptr) int +fn C.SetEvent(voidptr) i32 -fn C.CreateSemaphore(voidptr, int, int, voidptr) voidptr +fn C.CreateSemaphore(voidptr, i32, i32, voidptr) voidptr -fn C.ReleaseSemaphore(voidptr, int, voidptr) voidptr +fn C.ReleaseSemaphore(voidptr, i32, voidptr) voidptr fn C.InitializeSRWLock(voidptr) @@ -464,55 +464,55 @@ fn C.ReleaseSRWLockExclusive(voidptr) // pthread.h fn C.pthread_self() usize -fn C.pthread_mutex_init(voidptr, voidptr) int +fn C.pthread_mutex_init(voidptr, voidptr) i32 -fn C.pthread_mutex_lock(voidptr) int +fn C.pthread_mutex_lock(voidptr) i32 -fn C.pthread_mutex_unlock(voidptr) int +fn C.pthread_mutex_unlock(voidptr) i32 -fn C.pthread_mutex_destroy(voidptr) int +fn C.pthread_mutex_destroy(voidptr) i32 -fn C.pthread_rwlockattr_init(voidptr) int +fn C.pthread_rwlockattr_init(voidptr) i32 -fn C.pthread_rwlockattr_setkind_np(voidptr, int) int +fn C.pthread_rwlockattr_setkind_np(voidptr, i32) i32 -fn C.pthread_rwlockattr_setpshared(voidptr, int) int +fn C.pthread_rwlockattr_setpshared(voidptr, i32) i32 -fn C.pthread_rwlock_init(voidptr, voidptr) int +fn C.pthread_rwlock_init(voidptr, voidptr) i32 -fn C.pthread_rwlock_rdlock(voidptr) int +fn C.pthread_rwlock_rdlock(voidptr) i32 -fn C.pthread_rwlock_wrlock(voidptr) int +fn C.pthread_rwlock_wrlock(voidptr) i32 -fn C.pthread_rwlock_unlock(voidptr) int +fn C.pthread_rwlock_unlock(voidptr) i32 -fn C.pthread_condattr_init(voidptr) int +fn C.pthread_condattr_init(voidptr) i32 -fn C.pthread_condattr_setpshared(voidptr, int) int +fn C.pthread_condattr_setpshared(voidptr, i32) i32 -fn C.pthread_condattr_destroy(voidptr) int +fn C.pthread_condattr_destroy(voidptr) i32 -fn C.pthread_cond_init(voidptr, voidptr) int +fn C.pthread_cond_init(voidptr, voidptr) i32 -fn C.pthread_cond_signal(voidptr) int +fn C.pthread_cond_signal(voidptr) i32 -fn C.pthread_cond_wait(voidptr, voidptr) int +fn C.pthread_cond_wait(voidptr, voidptr) i32 -fn C.pthread_cond_timedwait(voidptr, voidptr, voidptr) int +fn C.pthread_cond_timedwait(voidptr, voidptr, voidptr) i32 -fn C.pthread_cond_destroy(voidptr) int +fn C.pthread_cond_destroy(voidptr) i32 -fn C.sem_init(voidptr, int, u32) int +fn C.sem_init(voidptr, i32, u32) i32 -fn C.sem_post(voidptr) int +fn C.sem_post(voidptr) i32 -fn C.sem_wait(voidptr) int +fn C.sem_wait(voidptr) i32 -fn C.sem_trywait(voidptr) int +fn C.sem_trywait(voidptr) i32 -fn C.sem_timedwait(voidptr, voidptr) int +fn C.sem_timedwait(voidptr, voidptr) i32 -fn C.sem_destroy(voidptr) int +fn C.sem_destroy(voidptr) i32 // MacOS semaphore functions @[trusted] @@ -528,16 +528,16 @@ fn C.dispatch_time(u64, i64) u64 fn C.dispatch_release(voidptr) // file descriptor based reading/writing -fn C.read(fd int, buf voidptr, count usize) int +fn C.read(fd i32, buf voidptr, count usize) i32 -fn C.write(fd int, buf voidptr, count usize) int +fn C.write(fd i32, buf voidptr, count usize) i32 -fn C.close(fd int) int +fn C.close(fd i32) i32 // pipes -fn C.pipe(pipefds &int) int +fn C.pipe(pipefds &int) i32 -fn C.dup2(oldfd int, newfd int) int +fn C.dup2(oldfd i32, newfd i32) i32 // used by gl, stbi, freetype fn C.glTexImage2D() @@ -547,13 +547,13 @@ fn C.WrappedNSLog(str &u8) // absolute value @[trusted] -fn C.abs(number int) int +fn C.abs(number i32) i32 fn C.GetDiskFreeSpaceExA(const_path &char, free_bytes_available_to_caller &u64, total_number_of_bytes &u64, total_number_of_free_bytes &u64) bool fn C.GetNativeSystemInfo(voidptr) -fn C.sysconf(name int) int +fn C.sysconf(name i32) i32 // C.SYSTEM_INFO contains information about the current computer system. This includes the architecture and type of the processor, the number of processors in the system, the page size, and other such information. @[typedef] diff --git a/vlib/clipboard/clipboard_windows.c.v b/vlib/clipboard/clipboard_windows.c.v index 9f34cde70..fc4dacb0b 100644 --- a/vlib/clipboard/clipboard_windows.c.v +++ b/vlib/clipboard/clipboard_windows.c.v @@ -20,12 +20,12 @@ struct WndClassEx { h_icon_sm &u16 = unsafe { nil } } -fn C.RegisterClassEx(class &WndClassEx) int +fn C.RegisterClassEx(class &WndClassEx) i32 fn C.GetClipboardOwner() C.HWND -fn C.CreateWindowEx(dwExStyle i64, lpClassName &u16, lpWindowName &u16, dwStyle i64, x int, y int, nWidth int, - nHeight int, hWndParent i64, hMenu voidptr, h_instance voidptr, lpParam voidptr) C.HWND +fn C.CreateWindowEx(dwExStyle i64, lpClassName &u16, lpWindowName &u16, dwStyle i64, x i32, y i32, nWidth i32, + nHeight i32, hWndParent i64, hMenu voidptr, h_instance voidptr, lpParam voidptr) C.HWND // fn C.MultiByteToWideChar(CodePage u32, dw_flags u16, lpMultiByteStr byteptr, cbMultiByte int, lpWideCharStr u16, cchWideChar int) int fn C.EmptyClipboard() @@ -48,7 +48,7 @@ fn C.DefWindowProc(hwnd C.HWND, msg u32, wParam C.WPARAM, lParam C.LPARAM) C.LRE fn C.SetLastError(error i64) -fn C.OpenClipboard(hwnd C.HWND) int +fn C.OpenClipboard(hwnd C.HWND) i32 fn C.DestroyWindow(hwnd C.HWND) diff --git a/vlib/clipboard/x11/clipboard.c.v b/vlib/clipboard/x11/clipboard.c.v index c5af1b022..274cbaf34 100644 --- a/vlib/clipboard/x11/clipboard.c.v +++ b/vlib/clipboard/x11/clipboard.c.v @@ -27,7 +27,7 @@ fn (d &C.Display) str() string { type Window = u64 type Atom = u64 -fn C.XInitThreads() int +fn C.XInitThreads() i32 fn C.XCloseDisplay(d &C.Display) @@ -37,38 +37,38 @@ fn C.XDestroyWindow(d &C.Display, w Window) fn C.XNextEvent(d &C.Display, e &C.XEvent) -fn C.XSetSelectionOwner(d &C.Display, a Atom, w Window, time int) +fn C.XSetSelectionOwner(d &C.Display, a Atom, w Window, time i32) fn C.XGetSelectionOwner(d &C.Display, a Atom) Window -fn C.XChangeProperty(d &C.Display, requestor Window, property Atom, typ Atom, format int, mode int, data voidptr, - nelements int) int +fn C.XChangeProperty(d &C.Display, requestor Window, property Atom, typ Atom, format i32, mode i32, data voidptr, + nelements i32) i32 -fn C.XSendEvent(d &C.Display, requestor Window, propagate int, mask i64, event &C.XEvent) +fn C.XSendEvent(d &C.Display, requestor Window, propagate i32, mask i64, event &C.XEvent) -fn C.XInternAtom(d &C.Display, typ &u8, only_if_exists int) Atom +fn C.XInternAtom(d &C.Display, typ &u8, only_if_exists i32) Atom -fn C.XCreateSimpleWindow(d &C.Display, root Window, x int, y int, width u32, height u32, border_width u32, +fn C.XCreateSimpleWindow(d &C.Display, root Window, x i32, y i32, width u32, height u32, border_width u32, border u64, background u64) Window fn C.XOpenDisplay(name &u8) &C.Display -fn C.XConvertSelection(d &C.Display, selection Atom, target Atom, property Atom, requestor Window, time int) int +fn C.XConvertSelection(d &C.Display, selection Atom, target Atom, property Atom, requestor Window, time i32) i32 -fn C.XSync(d &C.Display, discard int) int +fn C.XSync(d &C.Display, discard i32) i32 -fn C.XGetWindowProperty(d &C.Display, w Window, property Atom, offset i64, length i64, delete int, req_type Atom, - actual_type_return &Atom, actual_format_return &int, nitems &u64, bytes_after_return &u64, prop_return &&u8) int +fn C.XGetWindowProperty(d &C.Display, w Window, property Atom, offset i64, length i64, delete i32, req_type Atom, + actual_type_return &Atom, actual_format_return &int, nitems &u64, bytes_after_return &u64, prop_return &&u8) i32 -fn C.XDeleteProperty(d &C.Display, w Window, property Atom) int +fn C.XDeleteProperty(d &C.Display, w Window, property Atom) i32 -fn C.DefaultScreen(display &C.Display) int +fn C.DefaultScreen(display &C.Display) i32 -fn C.RootWindow(display &C.Display, screen_number int) Window +fn C.RootWindow(display &C.Display, screen_number i32) Window -fn C.BlackPixel(display &C.Display, screen_number int) u32 +fn C.BlackPixel(display &C.Display, screen_number i32) u32 -fn C.WhitePixel(display &C.Display, screen_number int) u32 +fn C.WhitePixel(display &C.Display, screen_number i32) u32 fn C.XFree(data voidptr) diff --git a/vlib/compress/compress.c.v b/vlib/compress/compress.c.v index c4321d828..46a26895e 100644 --- a/vlib/compress/compress.c.v +++ b/vlib/compress/compress.c.v @@ -5,8 +5,8 @@ module compress pub const max_size = u64(1 << 31) -fn C.tdefl_compress_mem_to_heap(source_buf voidptr, source_buf_len usize, out_len &usize, flags int) voidptr -fn C.tinfl_decompress_mem_to_heap(source_buf voidptr, source_buf_len usize, out_len &usize, flags int) voidptr +fn C.tdefl_compress_mem_to_heap(source_buf voidptr, source_buf_len usize, out_len &usize, flags i32) voidptr +fn C.tinfl_decompress_mem_to_heap(source_buf voidptr, source_buf_len usize, out_len &usize, flags i32) voidptr // compresses an array of bytes based on providing flags and returns the compressed bytes in a new array // NB: this is a low level api, a high level implementation like zlib/gzip should be preferred @@ -97,4 +97,4 @@ fn c_cb_for_decompress_mem(buf &char, len int, pdcbd voidptr) int { type DecompressCallback = fn (const_buffer voidptr, len int, userdata voidptr) int -fn C.tinfl_decompress_mem_to_callback(const_input_buffer voidptr, psize &usize, put_buf_cb DecompressCallback, userdata voidptr, flags int) int +fn C.tinfl_decompress_mem_to_callback(const_input_buffer voidptr, psize &usize, put_buf_cb DecompressCallback, userdata voidptr, flags i32) i32 diff --git a/vlib/compress/szip/szip.c.v b/vlib/compress/szip/szip.c.v index b0a515f5e..8c68c659e 100644 --- a/vlib/compress/szip/szip.c.v +++ b/vlib/compress/szip/szip.c.v @@ -18,39 +18,39 @@ pub type Zip = C.zip_t pub type Fn_on_extract_entry = fn (&&char, &&char) int -fn C.zip_open(&char, int, char) &Zip +fn C.zip_open(&char, i32, char) &Zip fn C.zip_close(&Zip) -fn C.zip_entry_open(&Zip, &u8) int +fn C.zip_entry_open(&Zip, &u8) i32 -fn C.zip_entry_openbyindex(&Zip, usize) int +fn C.zip_entry_openbyindex(&Zip, usize) i32 -fn C.zip_entry_close(&Zip) int +fn C.zip_entry_close(&Zip) i32 fn C.zip_entry_name(&Zip) &u8 -fn C.zip_entry_index(&Zip) int +fn C.zip_entry_index(&Zip) i32 -fn C.zip_entry_isdir(&Zip) int +fn C.zip_entry_isdir(&Zip) i32 fn C.zip_entry_size(&Zip) u64 fn C.zip_entry_crc32(&Zip) u32 -fn C.zip_entry_write(&Zip, voidptr, usize) int +fn C.zip_entry_write(&Zip, voidptr, usize) i32 -fn C.zip_entry_fwrite(&Zip, &char) int +fn C.zip_entry_fwrite(&Zip, &char) i32 -fn C.zip_entry_read(&Zip, &voidptr, &usize) int +fn C.zip_entry_read(&Zip, &voidptr, &usize) i32 -fn C.zip_entry_noallocread(&Zip, voidptr, usize) int +fn C.zip_entry_noallocread(&Zip, voidptr, usize) i32 -fn C.zip_entry_fread(&Zip, &char) int +fn C.zip_entry_fread(&Zip, &char) i32 -fn C.zip_entries_total(&Zip) int +fn C.zip_entries_total(&Zip) i32 -fn C.zip_extract(&char, &char, Fn_on_extract_entry, voidptr) int +fn C.zip_extract(&char, &char, Fn_on_extract_entry, voidptr) i32 fn cb_zip_extract(filename &&char, arg &&char) int { return 0 diff --git a/vlib/compress/zstd/zstd.c.v b/vlib/compress/zstd/zstd.c.v index 915e38b4e..4ea2ffa93 100644 --- a/vlib/compress/zstd/zstd.c.v +++ b/vlib/compress/zstd/zstd.c.v @@ -18,19 +18,19 @@ const buf_out_size = 1024 * 1024 fn C.ZSTD_versionNumber() u32 fn C.ZSTD_versionString() charptr -fn C.ZSTD_compress(voidptr, usize, voidptr, usize, int) usize +fn C.ZSTD_compress(voidptr, usize, voidptr, usize, i32) usize fn C.ZSTD_decompress(voidptr, usize, voidptr, usize) usize fn C.ZSTD_getFrameContentSize(voidptr, usize) u64 fn C.ZSTD_findFrameCompressedSize(voidptr, usize) usize fn C.ZSTD_compressBound(usize) usize fn C.ZSTD_isError(usize) u32 fn C.ZSTD_getErrorName(usize) charptr -fn C.ZSTD_minCLevel() int -fn C.ZSTD_maxCLevel() int -fn C.ZSTD_defaultCLevel() int +fn C.ZSTD_minCLevel() i32 +fn C.ZSTD_maxCLevel() i32 +fn C.ZSTD_defaultCLevel() i32 fn C.ZSTD_createCCtx() &C.ZSTD_CCtx fn C.ZSTD_freeCCtx(voidptr) usize -fn C.ZSTD_compressCCtx(voidptr, voidptr, usize, voidptr, usize, int) usize +fn C.ZSTD_compressCCtx(voidptr, voidptr, usize, voidptr, usize, i32) usize fn C.ZSTD_createDCtx() &C.ZSTD_DCtx fn C.ZSTD_freeDCtx(voidptr) usize fn C.ZSTD_decompressDCtx(voidptr, voidptr, usize, voidptr, usize) usize @@ -268,7 +268,7 @@ pub: } fn C.ZSTD_cParam_getBounds(CParameter) Bounds -fn C.ZSTD_CCtx_setParameter(voidptr, CParameter, int) usize +fn C.ZSTD_CCtx_setParameter(voidptr, CParameter, i32) usize fn C.ZSTD_CCtx_setPledgedSrcSize(voidptr, u64) usize pub enum ResetDirective { @@ -307,7 +307,7 @@ pub enum DParameter { } fn C.ZSTD_dParam_getBounds(DParameter) Bounds -fn C.ZSTD_DCtx_setParameter(voidptr, DParameter, int) usize +fn C.ZSTD_DCtx_setParameter(voidptr, DParameter, i32) usize fn C.ZSTD_DCtx_reset(voidptr, ResetDirective) usize // streaming compression @@ -347,7 +347,7 @@ pub enum EndDirective { fn C.ZSTD_compressStream2(voidptr, &OutBuffer, &InBuffer, EndDirective) usize fn C.ZSTD_CStreamInSize() usize fn C.ZSTD_CStreamOutSize() usize -fn C.ZSTD_initCStream(voidptr, int) usize +fn C.ZSTD_initCStream(voidptr, i32) usize fn C.ZSTD_compressStream(voidptr, &OutBuffer, &InBuffer) usize fn C.ZSTD_flushStream(voidptr, &OutBuffer) usize fn C.ZSTD_endStream(voidptr, &OutBuffer) usize diff --git a/vlib/coroutines/coroutines.c.v b/vlib/coroutines/coroutines.c.v index a6277e489..8afeb93e2 100644 --- a/vlib/coroutines/coroutines.c.v +++ b/vlib/coroutines/coroutines.c.v @@ -22,21 +22,21 @@ fn C.set_photon_thread_stack_allocator(fn (voidptr, int) voidptr, fn (voidptr, v // fn C.default_photon_thread_stack_alloc(voidptr, int) voidptr // fn C.default_photon_thread_stack_dealloc(voidptr, voidptr, int) -fn C.new_photon_work_pool(int) voidptr +fn C.new_photon_work_pool(i32) voidptr fn C.delete_photon_work_pool() -fn C.init_photon_work_pool(int) +fn C.init_photon_work_pool(i32) fn C.photon_set_log_output_stdout() fn C.photon_set_log_output_stderr() fn C.photon_set_log_output_null() -fn C.photon_join_current_thread_into_workpool() int +fn C.photon_join_current_thread_into_workpool() i32 fn C.photon_thread_create_and_migrate_to_work_pool(f voidptr, arg voidptr) fn C.photon_thread_create(f voidptr, arg voidptr, stack_size u64) fn C.photon_thread_migrate() // fn C.photon_thread_migrate(work_pool voidptr) -fn C.photon_init_default() int -fn C.photon_sleep_s(n int) -fn C.photon_sleep_ms(n int) +fn C.photon_init_default() i32 +fn C.photon_sleep_s(n i32) +fn C.photon_sleep_ms(n i32) fn C.sp_corrector(voidptr, voidptr) diff --git a/vlib/crypto/ecdsa/ecdsa.c.v b/vlib/crypto/ecdsa/ecdsa.c.v index c48b3214b..d6995f6de 100644 --- a/vlib/crypto/ecdsa/ecdsa.c.v +++ b/vlib/crypto/ecdsa/ecdsa.c.v @@ -49,57 +49,57 @@ struct C.EVP_PKEY {} fn C.EVP_PKEY_new() &C.EVP_PKEY fn C.EVP_PKEY_free(key &C.EVP_PKEY) -fn C.EVP_PKEY_base_id(key &C.EVP_PKEY) int -fn C.EVP_PKEY_bits(pkey &C.EVP_PKEY) int -fn C.EVP_PKEY_size(key &C.EVP_PKEY) int -fn C.EVP_PKEY_eq(a &C.EVP_PKEY, b &C.EVP_PKEY) int -fn C.EVP_PKEY_check(ctx &C.EVP_PKEY_CTX) int -fn C.EVP_PKEY_public_check(ctx &C.EVP_PKEY_CTX) int +fn C.EVP_PKEY_base_id(key &C.EVP_PKEY) i32 +fn C.EVP_PKEY_bits(pkey &C.EVP_PKEY) i32 +fn C.EVP_PKEY_size(key &C.EVP_PKEY) i32 +fn C.EVP_PKEY_eq(a &C.EVP_PKEY, b &C.EVP_PKEY) i32 +fn C.EVP_PKEY_check(ctx &C.EVP_PKEY_CTX) i32 +fn C.EVP_PKEY_public_check(ctx &C.EVP_PKEY_CTX) i32 fn C.EVP_PKEY_dup(key &C.EVP_PKEY) &C.EVP_PKEY -fn C.EVP_PKEY_set_bn_param(pkey &C.EVP_PKEY, key_name &char, bn &C.BIGNUM) int +fn C.EVP_PKEY_set_bn_param(pkey &C.EVP_PKEY, key_name &char, bn &C.BIGNUM) i32 -fn C.EVP_PKEY_get_group_name(pkey &C.EVP_PKEY, gname &u8, gname_sz u32, gname_len &usize) int -fn C.EVP_PKEY_get1_encoded_public_key(pkey &C.EVP_PKEY, ppub &&u8) int -fn C.EVP_PKEY_get_bn_param(pkey &C.EVP_PKEY, key_name &u8, bn &&C.BIGNUM) int -fn C.EVP_PKEY_fromdata_init(ctx &C.EVP_PKEY_CTX) int -fn C.EVP_PKEY_fromdata(ctx &C.EVP_PKEY_CTX, ppkey &&C.EVP_PKEY, selection int, params &C.OSSL_PARAM) int +fn C.EVP_PKEY_get_group_name(pkey &C.EVP_PKEY, gname &u8, gname_sz u32, gname_len &usize) i32 +fn C.EVP_PKEY_get1_encoded_public_key(pkey &C.EVP_PKEY, ppub &&u8) i32 +fn C.EVP_PKEY_get_bn_param(pkey &C.EVP_PKEY, key_name &u8, bn &&C.BIGNUM) i32 +fn C.EVP_PKEY_fromdata_init(ctx &C.EVP_PKEY_CTX) i32 +fn C.EVP_PKEY_fromdata(ctx &C.EVP_PKEY_CTX, ppkey &&C.EVP_PKEY, selection i32, params &C.OSSL_PARAM) i32 // no-prehash signing (verifying) -fn C.EVP_PKEY_sign(ctx &C.EVP_PKEY_CTX, sig &u8, siglen &usize, tbs &u8, tbslen int) int -fn C.EVP_PKEY_sign_init(ctx &C.EVP_PKEY_CTX) int -fn C.EVP_PKEY_verify_init(ctx &C.EVP_PKEY_CTX) int -fn C.EVP_PKEY_verify(ctx &C.EVP_PKEY_CTX, sig &u8, siglen int, tbs &u8, tbslen int) int +fn C.EVP_PKEY_sign(ctx &C.EVP_PKEY_CTX, sig &u8, siglen &usize, tbs &u8, tbslen i32) i32 +fn C.EVP_PKEY_sign_init(ctx &C.EVP_PKEY_CTX) i32 +fn C.EVP_PKEY_verify_init(ctx &C.EVP_PKEY_CTX) i32 +fn C.EVP_PKEY_verify(ctx &C.EVP_PKEY_CTX, sig &u8, siglen i32, tbs &u8, tbslen i32) i32 // single shoot digest signing (verifying) routine -fn C.EVP_DigestSign(ctx &C.EVP_MD_CTX, sig &u8, siglen &usize, tbs &u8, tbslen int) int -fn C.EVP_DigestVerify(ctx &C.EVP_MD_CTX, sig &u8, siglen int, tbs &u8, tbslen int) int +fn C.EVP_DigestSign(ctx &C.EVP_MD_CTX, sig &u8, siglen &usize, tbs &u8, tbslen i32) i32 +fn C.EVP_DigestVerify(ctx &C.EVP_MD_CTX, sig &u8, siglen i32, tbs &u8, tbslen i32) i32 // Message digest routines -fn C.EVP_DigestInit(ctx &C.EVP_MD_CTX, md &C.EVP_MD) int -fn C.EVP_DigestUpdate(ctx &C.EVP_MD_CTX, d voidptr, cnt int) int -fn C.EVP_DigestFinal(ctx &C.EVP_MD_CTX, md &u8, s &u32) int +fn C.EVP_DigestInit(ctx &C.EVP_MD_CTX, md &C.EVP_MD) i32 +fn C.EVP_DigestUpdate(ctx &C.EVP_MD_CTX, d voidptr, cnt i32) i32 +fn C.EVP_DigestFinal(ctx &C.EVP_MD_CTX, md &u8, s &u32) i32 // Recommended hashed signing/verifying routines -fn C.EVP_DigestSignInit(ctx &C.EVP_MD_CTX, pctx &&C.EVP_PKEY_CTX, tipe &C.EVP_MD, e voidptr, pkey &C.EVP_PKEY) int -fn C.EVP_DigestSignUpdate(ctx &C.EVP_MD_CTX, d voidptr, cnt int) int -fn C.EVP_DigestSignFinal(ctx &C.EVP_MD_CTX, sig &u8, siglen &usize) int -fn C.EVP_DigestVerifyInit(ctx &C.EVP_MD_CTX, pctx &&C.EVP_PKEY_CTX, tipe &C.EVP_MD, e voidptr, pkey &C.EVP_PKEY) int -fn C.EVP_DigestVerifyUpdate(ctx &C.EVP_MD_CTX, d voidptr, cnt int) int -fn C.EVP_DigestVerifyFinal(ctx &C.EVP_MD_CTX, sig &u8, siglen int) int +fn C.EVP_DigestSignInit(ctx &C.EVP_MD_CTX, pctx &&C.EVP_PKEY_CTX, tipe &C.EVP_MD, e voidptr, pkey &C.EVP_PKEY) i32 +fn C.EVP_DigestSignUpdate(ctx &C.EVP_MD_CTX, d voidptr, cnt i32) i32 +fn C.EVP_DigestSignFinal(ctx &C.EVP_MD_CTX, sig &u8, siglen &usize) i32 +fn C.EVP_DigestVerifyInit(ctx &C.EVP_MD_CTX, pctx &&C.EVP_PKEY_CTX, tipe &C.EVP_MD, e voidptr, pkey &C.EVP_PKEY) i32 +fn C.EVP_DigestVerifyUpdate(ctx &C.EVP_MD_CTX, d voidptr, cnt i32) i32 +fn C.EVP_DigestVerifyFinal(ctx &C.EVP_MD_CTX, sig &u8, siglen i32) i32 // EVP_PKEY Context @[typedef] struct C.EVP_PKEY_CTX {} fn C.EVP_PKEY_CTX_new(pkey &C.EVP_PKEY, e voidptr) &C.EVP_PKEY_CTX -fn C.EVP_PKEY_CTX_new_id(id int, e voidptr) &C.EVP_PKEY_CTX -fn C.EVP_PKEY_keygen_init(ctx &C.EVP_PKEY_CTX) int -fn C.EVP_PKEY_keygen(ctx &C.EVP_PKEY_CTX, ppkey &&C.EVP_PKEY) int -fn C.EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx &C.EVP_PKEY_CTX, nid int) int -fn C.EVP_PKEY_CTX_set_ec_param_enc(ctx &C.EVP_PKEY_CTX, param_enc int) int +fn C.EVP_PKEY_CTX_new_id(id i32, e voidptr) &C.EVP_PKEY_CTX +fn C.EVP_PKEY_keygen_init(ctx &C.EVP_PKEY_CTX) i32 +fn C.EVP_PKEY_keygen(ctx &C.EVP_PKEY_CTX, ppkey &&C.EVP_PKEY) i32 +fn C.EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx &C.EVP_PKEY_CTX, nid i32) i32 +fn C.EVP_PKEY_CTX_set_ec_param_enc(ctx &C.EVP_PKEY_CTX, param_enc i32) i32 fn C.EVP_PKEY_CTX_free(ctx &C.EVP_PKEY_CTX) -fn C.EVP_PKEY_get_bits(pkey &C.EVP_PKEY) int +fn C.EVP_PKEY_get_bits(pkey &C.EVP_PKEY) i32 // BIO input output declarations. @[typedef] @@ -111,12 +111,12 @@ pub struct C.BIO {} fn C.BIO_new(t &C.BIO_METHOD) &C.BIO fn C.BIO_free_all(a &C.BIO) fn C.BIO_s_mem() &C.BIO_METHOD -fn C.BIO_write(b &C.BIO, buf &u8, length int) int -fn C.PEM_read_bio_PrivateKey(bp &C.BIO, x &&C.EVP_PKEY, cb int, u &voidptr) &C.EVP_PKEY -fn C.PEM_read_bio_PUBKEY(bp &C.BIO, x &&C.EVP_PKEY, cb int, u &voidptr) &C.EVP_PKEY -fn C.PEM_write_bio_PUBKEY(bp &C.BIO, x &C.EVP_PKEY) int +fn C.BIO_write(b &C.BIO, buf &u8, length i32) i32 +fn C.PEM_read_bio_PrivateKey(bp &C.BIO, x &&C.EVP_PKEY, cb i32, u &voidptr) &C.EVP_PKEY +fn C.PEM_read_bio_PUBKEY(bp &C.BIO, x &&C.EVP_PKEY, cb i32, u &voidptr) &C.EVP_PKEY +fn C.PEM_write_bio_PUBKEY(bp &C.BIO, x &C.EVP_PKEY) i32 fn C.d2i_PUBKEY(k &&C.EVP_PKEY, pp &&u8, length u32) &C.EVP_PKEY -fn C.i2d_PUBKEY_bio(bo &C.BIO, pkey &C.EVP_PKEY) int +fn C.i2d_PUBKEY_bio(bo &C.BIO, pkey &C.EVP_PKEY) i32 fn C.d2i_PUBKEY_bio(bo &C.BIO, key &&C.EVP_PKEY) &C.EVP_PKEY // Elliptic curve point related declarations. @@ -124,8 +124,8 @@ fn C.d2i_PUBKEY_bio(bo &C.BIO, key &&C.EVP_PKEY) &C.EVP_PKEY struct C.EC_POINT {} fn C.EC_POINT_new(group &C.EC_GROUP) &C.EC_POINT -fn C.EC_POINT_mul(group &C.EC_GROUP, r &C.EC_POINT, n &C.BIGNUM, q &C.EC_POINT, m &C.BIGNUM, ctx &C.BN_CTX) int -fn C.EC_POINT_point2buf(group &C.EC_GROUP, point &C.EC_POINT, form int, pbuf &&u8, ctx &C.BN_CTX) int +fn C.EC_POINT_mul(group &C.EC_GROUP, r &C.EC_POINT, n &C.BIGNUM, q &C.EC_POINT, m &C.BIGNUM, ctx &C.BN_CTX) i32 +fn C.EC_POINT_point2buf(group &C.EC_GROUP, point &C.EC_POINT, form i32, pbuf &&u8, ctx &C.BN_CTX) i32 fn C.EC_POINT_free(point &C.EC_POINT) // Elliptic group (curve) related declarations. @@ -133,18 +133,18 @@ fn C.EC_POINT_free(point &C.EC_POINT) struct C.EC_GROUP {} fn C.EC_GROUP_free(group &C.EC_GROUP) -fn C.EC_GROUP_new_by_curve_name(nid int) &C.EC_GROUP +fn C.EC_GROUP_new_by_curve_name(nid i32) &C.EC_GROUP // Elliptic BIGNUM related declarations. @[typedef] struct C.BIGNUM {} fn C.BN_new() &C.BIGNUM -fn C.BN_num_bits(a &C.BIGNUM) int -fn C.BN_bn2bin(a &C.BIGNUM, to &u8) int -fn C.BN_bn2binpad(a &C.BIGNUM, to &u8, tolen int) int -fn C.BN_cmp(a &C.BIGNUM, b &C.BIGNUM) int -fn C.BN_bin2bn(s &u8, len int, ret &C.BIGNUM) &C.BIGNUM +fn C.BN_num_bits(a &C.BIGNUM) i32 +fn C.BN_bn2bin(a &C.BIGNUM, to &u8) i32 +fn C.BN_bn2binpad(a &C.BIGNUM, to &u8, tolen i32) i32 +fn C.BN_cmp(a &C.BIGNUM, b &C.BIGNUM) i32 +fn C.BN_bin2bn(s &u8, len i32, ret &C.BIGNUM) &C.BIGNUM fn C.BN_free(a &C.BIGNUM) // BIGNUM context @@ -167,7 +167,7 @@ struct C.EVP_MD {} fn C.EVP_sha256() &C.EVP_MD fn C.EVP_sha384() &C.EVP_MD fn C.EVP_sha512() &C.EVP_MD -fn C.EVP_MD_get_size(md &C.EVP_MD) int // -1 failure +fn C.EVP_MD_get_size(md &C.EVP_MD) i32 // -1 failure fn C.OPENSSL_free(addr voidptr) @@ -180,7 +180,7 @@ struct C.OSSL_PARAM_BLD {} fn C.OSSL_PARAM_free(params &C.OSSL_PARAM) fn C.OSSL_PARAM_BLD_free(param_bld &C.OSSL_PARAM_BLD) fn C.OSSL_PARAM_BLD_new() &C.OSSL_PARAM_BLD -fn C.OSSL_PARAM_BLD_push_utf8_string(bld &C.OSSL_PARAM_BLD, key &char, buf &char, bsize int) int -fn C.OSSL_PARAM_BLD_push_BN(bld &C.OSSL_PARAM_BLD, key &u8, bn &C.BIGNUM) int -fn C.OSSL_PARAM_BLD_push_octet_string(bld &C.OSSL_PARAM_BLD, key &u8, buf voidptr, bsize int) int +fn C.OSSL_PARAM_BLD_push_utf8_string(bld &C.OSSL_PARAM_BLD, key &char, buf &char, bsize i32) i32 +fn C.OSSL_PARAM_BLD_push_BN(bld &C.OSSL_PARAM_BLD, key &u8, bn &C.BIGNUM) i32 +fn C.OSSL_PARAM_BLD_push_octet_string(bld &C.OSSL_PARAM_BLD, key &u8, buf voidptr, bsize i32) i32 fn C.OSSL_PARAM_BLD_to_param(bld &C.OSSL_PARAM_BLD) &C.OSSL_PARAM diff --git a/vlib/crypto/rand/rand_darwin.c.v b/vlib/crypto/rand/rand_darwin.c.v index 60158af31..5b66e3ebf 100644 --- a/vlib/crypto/rand/rand_darwin.c.v +++ b/vlib/crypto/rand/rand_darwin.c.v @@ -6,7 +6,7 @@ module rand #include -fn C.getentropy(buf voidptr, buflen usize) int +fn C.getentropy(buf voidptr, buflen usize) i32 // read returns an array of `bytes_needed` random bytes read from the OS. pub fn read(bytes_needed int) ![]u8 { diff --git a/vlib/crypto/rand/rand_solaris.c.v b/vlib/crypto/rand/rand_solaris.c.v index 58dfeda88..9552fce91 100644 --- a/vlib/crypto/rand/rand_solaris.c.v +++ b/vlib/crypto/rand/rand_solaris.c.v @@ -6,7 +6,7 @@ module rand #include -fn C.getrandom(p &u8, n usize, flags u32) int +fn C.getrandom(p &u8, n usize, flags u32) i32 const read_batch_size = 256 diff --git a/vlib/db/mysql/_cdefs.c.v b/vlib/db/mysql/_cdefs.c.v index 36841a605..f08cc3b55 100644 --- a/vlib/db/mysql/_cdefs.c.v +++ b/vlib/db/mysql/_cdefs.c.v @@ -40,7 +40,7 @@ fn C.mysql_real_connect(mysql &C.MYSQL, host &char, user &char, passwd &char, db client_flag ConnectionFlag) &C.MYSQL // C.mysql_query executes the SQL statement pointed to by the null-terminated string `stmt_str`. -fn C.mysql_query(mysql &C.MYSQL, const_q charptr) int +fn C.mysql_query(mysql &C.MYSQL, const_q charptr) i32 // C.mysql_use_result initiates a result set retrieval but does not actually read // the result set into the client like `mysql_store_result()` does. @@ -48,11 +48,11 @@ fn C.mysql_use_result(mysql &C.MYSQL) // C.mysql_real_query executes the SQL statement pointed to by `stmt_str`, // a string length bytes long. -fn C.mysql_real_query(mysql &C.MYSQL, q &u8, len u32) int +fn C.mysql_real_query(mysql &C.MYSQL, q &u8, len u32) i32 // C.mysql_select_db causes the database specified by `db` to become // the default (current) database on the connection specified by mysql. -fn C.mysql_select_db(mysql &C.MYSQL, db &u8) int +fn C.mysql_select_db(mysql &C.MYSQL, db &u8) i32 // C.mysql_change_user changes the user and causes the database specified by `db` to become // the default (current) database on the connection specified by `mysql`. @@ -63,10 +63,10 @@ fn C.mysql_change_user(mysql &C.MYSQL, user &u8, password &u8, db &u8) bool fn C.mysql_affected_rows(mysql &C.MYSQL) u64 // C.mysql_options sets extra connect options and affects behavior for a connection. -fn C.mysql_options(mysql &C.MYSQL, option int, arg voidptr) int +fn C.mysql_options(mysql &C.MYSQL, option i32, arg voidptr) i32 // C.mysql_get_option returns the current value of an option settable using `mysql_options()`. -fn C.mysql_get_option(mysql &C.MYSQL, option int, arg voidptr) int +fn C.mysql_get_option(mysql &C.MYSQL, option i32, arg voidptr) i32 // C.mysql_list_tables returns a result set consisting of table names in the current database // that match the simple regular expression specified by the `wild` parameter. @@ -75,29 +75,29 @@ fn C.mysql_get_option(mysql &C.MYSQL, option int, arg voidptr) int fn C.mysql_list_tables(mysql &C.MYSQL, wild &u8) &C.MYSQL_RES // C.mysql_num_fields returns the number of columns in a result set. -fn C.mysql_num_fields(res &C.MYSQL_RES) int +fn C.mysql_num_fields(res &C.MYSQL_RES) i32 // C.mysql_num_rows returns the number of rows in the result set. fn C.mysql_num_rows(res &C.MYSQL_RES) u64 // C.mysql_autocommit sets autocommit mode on if `mode` is 1, off if `mode` is 0. -fn C.mysql_autocommit(mysql &C.MYSQL, mode bool) int +fn C.mysql_autocommit(mysql &C.MYSQL, mode bool) i32 // C.mysql_commit commits the current transaction. -fn C.mysql_commit(mysql &C.MYSQL) int +fn C.mysql_commit(mysql &C.MYSQL) i32 // C.mysql_rollback rollback the current transaction. -fn C.mysql_rollback(mysql &C.MYSQL) int +fn C.mysql_rollback(mysql &C.MYSQL) i32 // C.mysql_refresh flush tables or caches, or resets replication server information. -fn C.mysql_refresh(mysql &C.MYSQL, options u32) int +fn C.mysql_refresh(mysql &C.MYSQL, options u32) i32 // C.mysql_reset_connection resets the connection to clear the session state. -fn C.mysql_reset_connection(mysql &C.MYSQL) int +fn C.mysql_reset_connection(mysql &C.MYSQL) i32 // C.mysql_ping checks whether the connection to the server is working. // Returns zero if the connection to the server is active. Nonzero if an error occurred. -fn C.mysql_ping(mysql &C.MYSQL) int +fn C.mysql_ping(mysql &C.MYSQL) i32 // C.mysql_store_result reads the entire result of a query to the client, // allocates a `MYSQL_RES` structure, and places the result into this structure. @@ -157,10 +157,10 @@ fn C.mysql_get_client_info() &u8 fn C.mysql_error(mysql &C.MYSQL) &u8 // C.mysql_errno returns the error code for the most recently invoked API function that can succeed or fail. -fn C.mysql_errno(mysql &C.MYSQL) int +fn C.mysql_errno(mysql &C.MYSQL) i32 // C.mysql_dump_debug_info instructs the server to write debugging information to the error log. -fn C.mysql_dump_debug_info(mysql &C.MYSQL) int +fn C.mysql_dump_debug_info(mysql &C.MYSQL) i32 // C.mysql_debug does a `DBUG_PUSH` with the given string. fn C.mysql_debug(debug &u8) diff --git a/vlib/db/mysql/stmt.c.v b/vlib/db/mysql/stmt.c.v index 10a927c60..07ae04304 100644 --- a/vlib/db/mysql/stmt.c.v +++ b/vlib/db/mysql/stmt.c.v @@ -47,9 +47,9 @@ const mysql_type_geometry = C.MYSQL_TYPE_GEOMETRY const mysql_no_data = C.MYSQL_NO_DATA fn C.mysql_stmt_init(&C.MYSQL) &C.MYSQL_STMT -fn C.mysql_stmt_prepare(&C.MYSQL_STMT, const_query charptr, u32) int +fn C.mysql_stmt_prepare(&C.MYSQL_STMT, const_query charptr, u32) i32 fn C.mysql_stmt_bind_param(&C.MYSQL_STMT, &C.MYSQL_BIND) bool -fn C.mysql_stmt_execute(&C.MYSQL_STMT) int +fn C.mysql_stmt_execute(&C.MYSQL_STMT) i32 fn C.mysql_stmt_close(&C.MYSQL_STMT) bool fn C.mysql_stmt_free_result(&C.MYSQL_STMT) bool fn C.mysql_stmt_error(&C.MYSQL_STMT) &char @@ -57,10 +57,10 @@ fn C.mysql_stmt_result_metadata(&C.MYSQL_STMT) &C.MYSQL_RES fn C.mysql_stmt_field_count(&C.MYSQL_STMT) u16 fn C.mysql_stmt_bind_result(&C.MYSQL_STMT, &C.MYSQL_BIND) bool -fn C.mysql_stmt_fetch(&C.MYSQL_STMT) int -fn C.mysql_stmt_next_result(&C.MYSQL_STMT) int -fn C.mysql_stmt_store_result(&C.MYSQL_STMT) int -fn C.mysql_stmt_fetch_column(&C.MYSQL_STMT, &C.MYSQL_BIND, u32, u64) int +fn C.mysql_stmt_fetch(&C.MYSQL_STMT) i32 +fn C.mysql_stmt_next_result(&C.MYSQL_STMT) i32 +fn C.mysql_stmt_store_result(&C.MYSQL_STMT) i32 +fn C.mysql_stmt_fetch_column(&C.MYSQL_STMT, &C.MYSQL_BIND, u32, u64) i32 pub struct Stmt { stmt &C.MYSQL_STMT = &C.MYSQL_STMT(unsafe { nil }) diff --git a/vlib/db/pg/pg.c.v b/vlib/db/pg/pg.c.v index b41c53e5f..2683e6cfe 100644 --- a/vlib/db/pg/pg.c.v +++ b/vlib/db/pg/pg.c.v @@ -152,9 +152,9 @@ pub enum ExecStatusType { fn C.PQconnectdb(const_conninfo &char) &C.PGconn -fn C.PQstatus(const_conn &C.PGconn) int +fn C.PQstatus(const_conn &C.PGconn) i32 -fn C.PQtransactionStatus(const_conn &C.PGconn) int +fn C.PQtransactionStatus(const_conn &C.PGconn) i32 fn C.PQerrorMessage(const_conn &C.PGconn) &char @@ -162,36 +162,36 @@ fn C.PQexec(res &C.PGconn, const_query &char) &C.PGresult // -fn C.PQgetisnull(const_res &C.PGresult, int, int) int +fn C.PQgetisnull(const_res &C.PGresult, i32, i32) i32 -fn C.PQgetvalue(const_res &C.PGresult, int, int) &char +fn C.PQgetvalue(const_res &C.PGresult, i32, i32) &char -fn C.PQresultStatus(const_res &C.PGresult) int +fn C.PQresultStatus(const_res &C.PGresult) i32 -fn C.PQntuples(const_res &C.PGresult) int +fn C.PQntuples(const_res &C.PGresult) i32 -fn C.PQnfields(const_res &C.PGresult) int +fn C.PQnfields(const_res &C.PGresult) i32 -fn C.PQfname(const_res &C.PGresult, int) &char +fn C.PQfname(const_res &C.PGresult, i32) &char // Params: // const Oid *paramTypes // const char *const *paramValues // const int *paramLengths // const int *paramFormats -fn C.PQexecParams(conn &C.PGconn, const_command &char, nParams int, const_paramTypes &int, const_paramValues &char, - const_paramLengths &int, const_paramFormats &int, resultFormat int) &C.PGresult +fn C.PQexecParams(conn &C.PGconn, const_command &char, nParams i32, const_paramTypes &int, const_paramValues &char, + const_paramLengths &int, const_paramFormats &int, resultFormat i32) &C.PGresult -fn C.PQputCopyData(conn &C.PGconn, const_buffer &char, nbytes int) int +fn C.PQputCopyData(conn &C.PGconn, const_buffer &char, nbytes i32) i32 -fn C.PQputCopyEnd(conn &C.PGconn, const_errmsg &char) int +fn C.PQputCopyEnd(conn &C.PGconn, const_errmsg &char) i32 -fn C.PQgetCopyData(conn &C.PGconn, buffer &&char, async int) int +fn C.PQgetCopyData(conn &C.PGconn, buffer &&char, async i32) i32 -fn C.PQprepare(conn &C.PGconn, const_stmtName &char, const_query &char, nParams int, const_param_types &&char) &C.PGresult +fn C.PQprepare(conn &C.PGconn, const_stmtName &char, const_query &char, nParams i32, const_param_types &&char) &C.PGresult -fn C.PQexecPrepared(conn &C.PGconn, const_stmtName &char, nParams int, const_paramValues &char, - const_paramLengths &int, const_paramFormats &int, resultFormat int) &C.PGresult +fn C.PQexecPrepared(conn &C.PGconn, const_stmtName &char, nParams i32, const_paramValues &char, + const_paramLengths &int, const_paramFormats &int, resultFormat i32) &C.PGresult // cleanup @@ -204,9 +204,9 @@ fn C.PQfinish(conn &C.PGconn) // LISTEN/NOTIFY support fn C.PQnotifies(conn &C.PGconn) &C.PGnotify -fn C.PQconsumeInput(conn &C.PGconn) int +fn C.PQconsumeInput(conn &C.PGconn) i32 -fn C.PQsocket(conn &C.PGconn) int +fn C.PQsocket(conn &C.PGconn) i32 fn C.PQescapeLiteral(conn &C.PGconn, str &char, length usize) &char diff --git a/vlib/db/sqlite/sqlite.c.v b/vlib/db/sqlite/sqlite.c.v index 75f2eb9d9..6ef6857cd 100644 --- a/vlib/db/sqlite/sqlite.c.v +++ b/vlib/db/sqlite/sqlite.c.v @@ -94,48 +94,48 @@ pub mut: pub type Params = []string | [][]string // -fn C.sqlite3_open(&char, &&C.sqlite3) int +fn C.sqlite3_open(&char, &&C.sqlite3) i32 -fn C.sqlite3_close(&C.sqlite3) int +fn C.sqlite3_close(&C.sqlite3) i32 -fn C.sqlite3_busy_timeout(db &C.sqlite3, ms int) int +fn C.sqlite3_busy_timeout(db &C.sqlite3, ms i32) i32 fn C.sqlite3_last_insert_rowid(&C.sqlite3) i64 // -fn C.sqlite3_prepare_v2(&C.sqlite3, &char, int, &&C.sqlite3_stmt, &&char) int +fn C.sqlite3_prepare_v2(&C.sqlite3, &char, i32, &&C.sqlite3_stmt, &&char) i32 -fn C.sqlite3_step(&C.sqlite3_stmt) int +fn C.sqlite3_step(&C.sqlite3_stmt) i32 -fn C.sqlite3_reset(&C.sqlite3_stmt) int +fn C.sqlite3_reset(&C.sqlite3_stmt) i32 -fn C.sqlite3_finalize(&C.sqlite3_stmt) int +fn C.sqlite3_finalize(&C.sqlite3_stmt) i32 // -fn C.sqlite3_column_name(&C.sqlite3_stmt, int) &char +fn C.sqlite3_column_name(&C.sqlite3_stmt, i32) &char -fn C.sqlite3_column_text(&C.sqlite3_stmt, int) &u8 +fn C.sqlite3_column_text(&C.sqlite3_stmt, i32) &u8 -fn C.sqlite3_column_int(&C.sqlite3_stmt, int) int +fn C.sqlite3_column_int(&C.sqlite3_stmt, i32) i32 -fn C.sqlite3_column_int64(&C.sqlite3_stmt, int) i64 +fn C.sqlite3_column_int64(&C.sqlite3_stmt, i32) i64 -fn C.sqlite3_column_double(&C.sqlite3_stmt, int) f64 +fn C.sqlite3_column_double(&C.sqlite3_stmt, i32) f64 -fn C.sqlite3_column_count(&C.sqlite3_stmt) int +fn C.sqlite3_column_count(&C.sqlite3_stmt) i32 -fn C.sqlite3_column_type(&C.sqlite3_stmt, int) int +fn C.sqlite3_column_type(&C.sqlite3_stmt, i32) i32 -fn C.sqlite3_column_bytes(&C.sqlite3_stmt, int) int +fn C.sqlite3_column_bytes(&C.sqlite3_stmt, i32) i32 // -fn C.sqlite3_errstr(int) &char +fn C.sqlite3_errstr(i32) &char fn C.sqlite3_errmsg(&C.sqlite3) &char fn C.sqlite3_free(voidptr) -fn C.sqlite3_changes(&C.sqlite3) int +fn C.sqlite3_changes(&C.sqlite3) i32 // connect Opens the connection with a database. pub fn connect(path string) !DB { diff --git a/vlib/db/sqlite/stmt.c.v b/vlib/db/sqlite/stmt.c.v index f321b7349..07c987d59 100644 --- a/vlib/db/sqlite/stmt.c.v +++ b/vlib/db/sqlite/stmt.c.v @@ -1,10 +1,10 @@ module sqlite -fn C.sqlite3_bind_null(&C.sqlite3_stmt, int) int -fn C.sqlite3_bind_double(&C.sqlite3_stmt, int, f64) int -fn C.sqlite3_bind_int(&C.sqlite3_stmt, int, int) int -fn C.sqlite3_bind_int64(&C.sqlite3_stmt, int, i64) int -fn C.sqlite3_bind_text(&C.sqlite3_stmt, int, &char, int, voidptr) int +fn C.sqlite3_bind_null(&C.sqlite3_stmt, i32) i32 +fn C.sqlite3_bind_double(&C.sqlite3_stmt, i32, f64) i32 +fn C.sqlite3_bind_int(&C.sqlite3_stmt, i32, i32) i32 +fn C.sqlite3_bind_int64(&C.sqlite3_stmt, i32, i64) i32 +fn C.sqlite3_bind_text(&C.sqlite3_stmt, i32, &char, i32, voidptr) i32 // Only for V ORM fn (db &DB) init_stmt(query string) (&C.sqlite3_stmt, int) { diff --git a/vlib/db/sqlite/vfs_lowlevel.c.v b/vlib/db/sqlite/vfs_lowlevel.c.v index cd8d1c97c..4ffdec8b1 100644 --- a/vlib/db/sqlite/vfs_lowlevel.c.v +++ b/vlib/db/sqlite/vfs_lowlevel.c.v @@ -82,8 +82,8 @@ pub mut: // https://www.sqlite.org/c3ref/vfs_find.html fn C.sqlite3_vfs_find(&char) &C.sqlite3_vfs -fn C.sqlite3_vfs_register(&C.sqlite3_vfs, int) int -fn C.sqlite3_vfs_unregister(&C.sqlite3_vfs) int +fn C.sqlite3_vfs_register(&C.sqlite3_vfs, i32) i32 +fn C.sqlite3_vfs_unregister(&C.sqlite3_vfs) i32 // get_vfs Requests sqlite to return instance of VFS with given name. // when such vfs is not known, `none` is returned @@ -124,7 +124,7 @@ pub fn (mut v Sqlite3_vfs) unregister() ! { } // https://www.sqlite.org/c3ref/open.html -fn C.sqlite3_open_v2(&char, &&C.sqlite3, int, &char) int +fn C.sqlite3_open_v2(&char, &&C.sqlite3, i32, &char) i32 // https://www.sqlite.org/c3ref/c_open_autoproxy.html pub enum OpenModeFlag { diff --git a/vlib/dl/dl_nix.c.v b/vlib/dl/dl_nix.c.v index d24ca0fc2..74a75eef5 100644 --- a/vlib/dl/dl_nix.c.v +++ b/vlib/dl/dl_nix.c.v @@ -13,11 +13,11 @@ pub const rtld_local = C.RTLD_LOCAL pub const rtld_nodelete = C.RTLD_NODELETE pub const rtld_noload = C.RTLD_NOLOAD -fn C.dlopen(filename &char, flags int) voidptr +fn C.dlopen(filename &char, flags i32) voidptr fn C.dlsym(handle voidptr, symbol &char) voidptr -fn C.dlclose(handle voidptr) int +fn C.dlclose(handle voidptr) i32 fn C.dlerror() &char diff --git a/vlib/dlmalloc/dlmalloc_sys_nix.c.v b/vlib/dlmalloc/dlmalloc_sys_nix.c.v index 5a6fded41..b5e884968 100644 --- a/vlib/dlmalloc/dlmalloc_sys_nix.c.v +++ b/vlib/dlmalloc/dlmalloc_sys_nix.c.v @@ -4,9 +4,9 @@ $if !freestanding { #include #include } -fn C.munmap(ptr voidptr, size usize) int +fn C.munmap(ptr voidptr, size usize) i32 fn C.mremap(ptr voidptr, old usize, new usize, flags usize) voidptr -fn C.mmap(base voidptr, len usize, prot int, flags int, fd int, offset i64) voidptr +fn C.mmap(base voidptr, len usize, prot i32, flags i32, fd i32, offset i64) voidptr pub enum Mm_prot { prot_read = 0x1 diff --git a/vlib/encoding/iconv/iconv_nix.c.v b/vlib/encoding/iconv/iconv_nix.c.v index 59d54f9eb..65a142dee 100644 --- a/vlib/encoding/iconv/iconv_nix.c.v +++ b/vlib/encoding/iconv/iconv_nix.c.v @@ -12,7 +12,7 @@ module iconv #flag termux -L/data/data/com.termux/files/usr/lib -liconv fn C.iconv_open(tocode charptr, fromcode charptr) voidptr -fn C.iconv_close(cd voidptr) int +fn C.iconv_close(cd voidptr) i32 fn C.iconv(cd voidptr, inbuf &charptr, inbytesleft &usize, outbuf &charptr, outbytesleft &usize) usize // conv convert `fromcode` encoding string to `tocode` encoding string diff --git a/vlib/encoding/iconv/iconv_windows.c.v b/vlib/encoding/iconv/iconv_windows.c.v index 40d7d66ab..183cc5e19 100644 --- a/vlib/encoding/iconv/iconv_windows.c.v +++ b/vlib/encoding/iconv/iconv_windows.c.v @@ -4,10 +4,10 @@ module iconv // iconv implementation using Win32 API to convert // Idear from https://github.com/win-iconv/win-iconv -fn C.GetACP() int -fn C.GetOEMCP() int -fn C.WideCharToMultiByte(codepage u32, dwflags u32, src &u8, src_len int, dst &u8, dst_len int, default_char &u8, used_default_char &bool) int -fn C.MultiByteToWideChar(codepage u32, dwflags u32, src &u8, src_len int, dst &u8, dst_len int) int +fn C.GetACP() i32 +fn C.GetOEMCP() i32 +fn C.WideCharToMultiByte(codepage u32, dwflags u32, src &u8, src_len i32, dst &u8, dst_len i32, default_char &u8, used_default_char &bool) i32 +fn C.MultiByteToWideChar(codepage u32, dwflags u32, src &u8, src_len i32, dst &u8, dst_len i32) i32 struct Codepage_Alias { codepage int diff --git a/vlib/fasthttp/fasthttp.v b/vlib/fasthttp/fasthttp.v index 53cf0ab34..1eb2cf323 100644 --- a/vlib/fasthttp/fasthttp.v +++ b/vlib/fasthttp/fasthttp.v @@ -22,25 +22,25 @@ const tiny_bad_request_response = 'HTTP/1.1 400 Bad Request\r\nContent-Length: 0 const status_444_response = 'HTTP/1.1 444 No Response\r\nContent-Length: 0\r\nConnection: close\r\n\r\n'.bytes() const status_413_response = 'HTTP/1.1 413 Payload Too Large\r\nContent-Length: 0\r\nConnection: close\r\n\r\n'.bytes() -fn C.socket(domain net.AddrFamily, typ net.SocketType, protocol int) int +fn C.socket(domain net.AddrFamily, typ net.SocketType, protocol i32) i32 -fn C.bind(sockfd int, addr &net.Addr, addrlen u32) int +fn C.bind(sockfd i32, addr &net.Addr, addrlen u32) i32 -fn C.send(__fd int, __buf voidptr, __n usize, __flags int) int +fn C.send(__fd i32, __buf voidptr, __n usize, __flags i32) i32 -fn C.recv(__fd int, __buf voidptr, __n usize, __flags int) int +fn C.recv(__fd i32, __buf voidptr, __n usize, __flags i32) i32 -fn C.setsockopt(__fd int, __level int, __optname int, __optval voidptr, __optlen u32) int +fn C.setsockopt(__fd i32, __level i32, __optname i32, __optval voidptr, __optlen u32) i32 -fn C.listen(__fd int, __n int) int +fn C.listen(__fd i32, __n i32) i32 fn C.perror(s &u8) -fn C.close(fd int) int +fn C.close(fd i32) i32 fn C.htons(__hostshort u16) u16 -fn C.fcntl(fd int, cmd int, arg int) int +fn C.fcntl(fd i32, cmd i32, arg i32) i32 pub struct Slice { pub: diff --git a/vlib/fasthttp/fasthttp_darwin.v b/vlib/fasthttp/fasthttp_darwin.v index 11493d630..00983340a 100644 --- a/vlib/fasthttp/fasthttp_darwin.v +++ b/vlib/fasthttp/fasthttp_darwin.v @@ -12,12 +12,12 @@ const buf_size = max_connection_size const kqueue_max_events = 128 const backlog = max_connection_size -fn C.kevent(kq int, changelist &C.kevent, nchanges int, eventlist &C.kevent, nevents int, timeout &C.timespec) int -fn C.kqueue() int -fn C.fstat(fd int, buf &C.stat) int +fn C.kevent(kq i32, changelist &C.kevent, nchanges i32, eventlist &C.kevent, nevents i32, timeout &C.timespec) i32 +fn C.kqueue() i32 +fn C.fstat(fd i32, buf &C.stat) i32 // int sendfile(int fd, int s, off_t offset, off_t *len, struct sf_hdtr *hdtr, int flags); -fn C.sendfile(fd int, s int, offset i64, len &i64, hdtr voidptr, flags int) int +fn C.sendfile(fd i32, s i32, offset i64, len &i64, hdtr voidptr, flags i32) i32 struct C.kevent { ident u64 diff --git a/vlib/fasthttp/fasthttp_linux.v b/vlib/fasthttp/fasthttp_linux.v index aedccf48a..d0afb5501 100644 --- a/vlib/fasthttp/fasthttp_linux.v +++ b/vlib/fasthttp/fasthttp_linux.v @@ -7,17 +7,17 @@ import net #include #include -fn C.accept4(sockfd int, addr &net.Addr, addrlen &u32, flags int) int +fn C.accept4(sockfd i32, addr &net.Addr, addrlen &u32, flags i32) i32 -fn C.epoll_create1(__flags int) int +fn C.epoll_create1(__flags i32) i32 -fn C.epoll_ctl(__epfd int, __op int, __fd int, __event &C.epoll_event) int +fn C.epoll_ctl(__epfd i32, __op i32, __fd i32, __event &C.epoll_event) i32 -fn C.epoll_wait(__epfd int, __events &C.epoll_event, __maxevents int, __timeout int) int +fn C.epoll_wait(__epfd i32, __events &C.epoll_event, __maxevents i32, __timeout i32) i32 -fn C.sendfile(out_fd int, in_fd int, offset &i64, count usize) int +fn C.sendfile(out_fd i32, in_fd i32, offset &i64, count usize) i32 -fn C.fstat(fd int, buf &C.stat) int +fn C.fstat(fd i32, buf &C.stat) i32 @[typedef] union C.epoll_data_t { diff --git a/vlib/fontstash/fontstash_funcs.c.v b/vlib/fontstash/fontstash_funcs.c.v index 9db751b04..020ef7d6d 100644 --- a/vlib/fontstash/fontstash_funcs.c.v +++ b/vlib/fontstash/fontstash_funcs.c.v @@ -10,15 +10,15 @@ fn C.fonsSetErrorCallback(s &C.FONScontext, callback fn (voidptr, int, int), upt fn C.fonsGetAtlasSize(s &C.FONScontext, width &int, height &int) // Expands the atlas size. -fn C.fonsExpandAtlas(s &C.FONScontext, width int, height int) int +fn C.fonsExpandAtlas(s &C.FONScontext, width i32, height i32) i32 // Resets the whole stash. -fn C.fonsResetAtlas(s &C.FONScontext, width int, height int) int +fn C.fonsResetAtlas(s &C.FONScontext, width i32, height i32) i32 // Add fonts -fn C.fonsGetFontByName(s &C.FONScontext, name &char) int -fn C.fonsAddFallbackFont(s &C.FONScontext, base int, fallback int) int -fn C.fonsAddFontMem(s &C.FONScontext, name &char, data &u8, dataSize int, freeData int) int +fn C.fonsGetFontByName(s &C.FONScontext, name &char) i32 +fn C.fonsAddFallbackFont(s &C.FONScontext, base i32, fallback i32) i32 +fn C.fonsAddFontMem(s &C.FONScontext, name &char, data &u8, dataSize i32, freeData i32) i32 // State handling fn C.fonsPushState(s &C.FONScontext) @@ -30,8 +30,8 @@ fn C.fonsSetSize(s &C.FONScontext, size f32) fn C.fonsSetColor(s &C.FONScontext, color u32) fn C.fonsSetSpacing(s &C.FONScontext, spacing f32) fn C.fonsSetBlur(s &C.FONScontext, blur f32) -fn C.fonsSetAlign(s &C.FONScontext, align int) -fn C.fonsSetFont(s &C.FONScontext, font int) +fn C.fonsSetAlign(s &C.FONScontext, align i32) +fn C.fonsSetFont(s &C.FONScontext, font i32) // Draw text fn C.fonsDrawText(s &C.FONScontext, x f32, y f32, str &char, end &char) f32 @@ -42,12 +42,12 @@ fn C.fonsLineBounds(s &C.FONScontext, y f32, miny &f32, maxy &f32) fn C.fonsVertMetrics(s &C.FONScontext, ascender &f32, descender &f32, lineh &f32) // Text iterator -fn C.fonsTextIterInit(s &C.FONScontext, iter &C.FONStextIter, x f32, y f32, str &char, end &char) int -fn C.fonsTextIterNext(s &C.FONScontext, iter &C.FONStextIter, quad &C.FONSquad) int +fn C.fonsTextIterInit(s &C.FONScontext, iter &C.FONStextIter, x f32, y f32, str &char, end &char) i32 +fn C.fonsTextIterNext(s &C.FONScontext, iter &C.FONStextIter, quad &C.FONSquad) i32 // Pull texture changes fn C.fonsGetTextureData(s &C.FONScontext, width &int, height &int) &char -fn C.fonsValidateTexture(s &C.FONScontext, dirty &int) int +fn C.fonsValidateTexture(s &C.FONScontext, dirty &int) i32 // Draws the stash texture for debugging fn C.fonsDrawDebug(s &C.FONScontext, x f32, y f32) diff --git a/vlib/gg/gg.c.v b/vlib/gg/gg.c.v index 87e7304f4..92c7a2a40 100644 --- a/vlib/gg/gg.c.v +++ b/vlib/gg/gg.c.v @@ -27,9 +27,9 @@ struct C.XRRCrtcInfo { height u32 } -fn C.XOpenDisplay(int) voidptr -fn C.XCloseDisplay(voidptr) int -fn C.DefaultScreen(voidptr) int +fn C.XOpenDisplay(i32) voidptr +fn C.XCloseDisplay(voidptr) i32 +fn C.DefaultScreen(voidptr) i32 fn C.DefaultRootWindow(voidptr) u64 fn C.XRRGetScreenResources(voidptr, u64) &C.XRRScreenResources fn C.XRRGetOutputPrimary(voidptr, u64) u64 @@ -52,7 +52,7 @@ $if windows { #flag wasm32_emscripten --embed-file @VEXEROOT/examples/assets/fonts/RobotoMono-Regular.ttf@/assets/fonts/RobotoMono-Regular.ttf // call Windows API to get screen size -fn C.GetSystemMetrics(int) int +fn C.GetSystemMetrics(i32) i32 pub type TouchPoint = C.sapp_touchpoint diff --git a/vlib/gg/gg_darwin.c.v b/vlib/gg/gg_darwin.c.v index a11faea26..3b23670c4 100644 --- a/vlib/gg/gg_darwin.c.v +++ b/vlib/gg/gg_darwin.c.v @@ -4,11 +4,11 @@ module gg fn C.gg_get_screen_size() Size -fn C.darwin_draw_string(x int, y int, s string, cfg voidptr) +fn C.darwin_draw_string(x i32, y i32, s string, cfg voidptr) -fn C.darwin_text_width(s string) int +fn C.darwin_text_width(s string) i32 -fn C.darwin_text_width_runes(r []rune) int +fn C.darwin_text_width_runes(r []rune) i32 fn C.darwin_window_refresh() diff --git a/vlib/math/bits/bits.c.v b/vlib/math/bits/bits.c.v index b4b595a74..4df541400 100644 --- a/vlib/math/bits/bits.c.v +++ b/vlib/math/bits/bits.c.v @@ -3,10 +3,10 @@ // that can be found in the LICENSE file. module bits -fn C.__builtin_clz(x u32) int -fn C.__builtin_clzll(x u64) int -fn C.__lzcnt(x u32) int -fn C.__lzcnt64(x u64) int +fn C.__builtin_clz(x u32) i32 +fn C.__builtin_clzll(x u64) i32 +fn C.__lzcnt(x u32) i32 +fn C.__lzcnt64(x u64) i32 // --- LeadingZeros --- // leading_zeros_8 returns the number of leading zero bits in x; the result is 8 for x == 0. @@ -65,8 +65,8 @@ pub fn leading_zeros_64(x u64) int { return leading_zeros_64_default(x) } -fn C.__builtin_ctz(x u32) int -fn C.__builtin_ctzll(x u64) int +fn C.__builtin_ctz(x u32) i32 +fn C.__builtin_ctzll(x u64) i32 fn C._BitScanForward(pos &int, x u32) u8 fn C._BitScanForward64(pos &int, x u64) u8 @@ -135,10 +135,10 @@ pub fn trailing_zeros_64(x u64) int { return trailing_zeros_64_default(x) } -fn C.__builtin_popcount(x u32) int -fn C.__builtin_popcountll(x u64) int -fn C.__popcnt(x u32) int -fn C.__popcnt64(x u64) int +fn C.__builtin_popcount(x u32) i32 +fn C.__builtin_popcountll(x u64) i32 +fn C.__popcnt(x u32) i32 +fn C.__popcnt64(x u64) i32 // --- OnesCount --- // ones_count_8 returns the number of one bits ("population count") in x. diff --git a/vlib/math/exp.c.v b/vlib/math/exp.c.v index 2b2b897c8..2a9eec6f7 100644 --- a/vlib/math/exp.c.v +++ b/vlib/math/exp.c.v @@ -4,7 +4,7 @@ fn C.exp(x f64) f64 fn C.exp2(x f64) f64 -fn C.ldexp(x f64, exp int) f64 +fn C.ldexp(x f64, exp i32) f64 // exp returns e**x, the base-e exponential of x. @[inline] diff --git a/vlib/net/aasocket.c.v b/vlib/net/aasocket.c.v index ee5ab42eb..b0bc8924d 100644 --- a/vlib/net/aasocket.c.v +++ b/vlib/net/aasocket.c.v @@ -42,10 +42,10 @@ pub enum AddrFamily { unspec = C.AF_UNSPEC } -fn C.socket(domain AddrFamily, typ SocketType, protocol int) int +fn C.socket(domain AddrFamily, typ SocketType, protocol i32) i32 // fn C.setsockopt(sockfd int, level int, optname int, optval voidptr, optlen C.socklen_t) int -fn C.setsockopt(sockfd int, level int, optname int, optval voidptr, optlen u32) int +fn C.setsockopt(sockfd i32, level i32, optname i32, optval voidptr, optlen u32) i32 fn C.htonl(host u32) u32 fn C.htons(host u16) u16 @@ -56,70 +56,70 @@ fn C.ntohs(net u16) u16 // fn C.bind(sockfd int, addr &C.sockaddr, addrlen C.socklen_t) int // use voidptr for arg 2 because sockaddr is a generic descriptor for any kind of socket operation, // it can also take sockaddr_in depending on the type of socket used in arg 1 -fn C.bind(sockfd int, addr &Addr, addrlen u32) int +fn C.bind(sockfd i32, addr &Addr, addrlen u32) i32 -fn C.listen(sockfd int, backlog int) int +fn C.listen(sockfd i32, backlog i32) i32 // fn C.accept(sockfd int, addr &C.sockaddr, addrlen &C.socklen_t) int -fn C.accept(sockfd int, addr &Addr, addrlen &u32) int +fn C.accept(sockfd i32, addr &Addr, addrlen &u32) i32 -fn C.getaddrinfo(node &char, service &char, hints &C.addrinfo, res &&C.addrinfo) int +fn C.getaddrinfo(node &char, service &char, hints &C.addrinfo, res &&C.addrinfo) i32 fn C.freeaddrinfo(info &C.addrinfo) // fn C.connect(sockfd int, addr &C.sockaddr, addrlen C.socklen_t) int -fn C.connect(sockfd int, addr &Addr, addrlen u32) int +fn C.connect(sockfd i32, addr &Addr, addrlen u32) i32 // fn C.send(sockfd int, buf voidptr, len usize, flags int) usize -fn C.send(sockfd int, buf voidptr, len usize, flags int) int +fn C.send(sockfd i32, buf voidptr, len usize, flags i32) i32 // fn C.sendto(sockfd int, buf voidptr, len usize, flags int, dest_add &C.sockaddr, addrlen C.socklen_t) usize -fn C.sendto(sockfd int, buf voidptr, len usize, flags int, dest_add &Addr, addrlen u32) int +fn C.sendto(sockfd i32, buf voidptr, len usize, flags i32, dest_add &Addr, addrlen u32) i32 // fn C.recv(sockfd int, buf voidptr, len usize, flags int) usize -fn C.recv(sockfd int, buf voidptr, len usize, flags int) int +fn C.recv(sockfd i32, buf voidptr, len usize, flags i32) i32 // fn C.recvfrom(sockfd int, buf voidptr, len usize, flags int, src_addr &C.sockaddr, addrlen &C.socklen_t) usize -fn C.recvfrom(sockfd int, buf voidptr, len usize, flags int, src_addr &Addr, addrlen &u32) int +fn C.recvfrom(sockfd i32, buf voidptr, len usize, flags i32, src_addr &Addr, addrlen &u32) i32 -fn C.shutdown(socket int, how int) int +fn C.shutdown(socket i32, how i32) i32 // fn C.getpeername(sockfd int, addr &C.sockaddr, addlen &C.socklen_t) int -fn C.getpeername(sockfd int, addr &Addr, addlen &u32) int +fn C.getpeername(sockfd i32, addr &Addr, addlen &u32) i32 -fn C.inet_ntop(af AddrFamily, src voidptr, dst &char, dst_size int) &char +fn C.inet_ntop(af AddrFamily, src voidptr, dst &char, dst_size i32) &char fn C.WSAAddressToStringA(lpsaAddress &Addr, dwAddressLength u32, lpProtocolInfo voidptr, lpszAddressString &char, - lpdwAddressStringLength &u32) int + lpdwAddressStringLength &u32) i32 // fn C.getsockname(sockfd int, addr &C.sockaddr, addrlen &C.socklen_t) int -fn C.getsockname(sockfd int, addr &C.sockaddr, addrlen &u32) int +fn C.getsockname(sockfd i32, addr &C.sockaddr, addrlen &u32) i32 -fn C.getsockopt(sockfd int, level int, optname int, optval voidptr, optlen &u32) int +fn C.getsockopt(sockfd i32, level i32, optname i32, optval voidptr, optlen &u32) i32 // defined in builtin // fn C.read() int // fn C.close() int -fn C.ioctlsocket(s int, cmd int, argp &u32) int +fn C.ioctlsocket(s i32, cmd i32, argp &u32) i32 -fn C.fcntl(fd int, cmd int, arg ...voidptr) int +fn C.fcntl(fd i32, cmd i32, arg ...voidptr) i32 -fn C.select(ndfs int, readfds &C.fd_set, writefds &C.fd_set, exceptfds &C.fd_set, timeout &C.timeval) int +fn C.select(ndfs i32, readfds &C.fd_set, writefds &C.fd_set, exceptfds &C.fd_set, timeout &C.timeval) i32 fn C.FD_ZERO(fdset &C.fd_set) -fn C.FD_SET(fd int, fdset &C.fd_set) +fn C.FD_SET(fd i32, fdset &C.fd_set) -fn C.FD_ISSET(fd int, fdset &C.fd_set) int +fn C.FD_ISSET(fd i32, fdset &C.fd_set) i32 -fn C.inet_pton(family AddrFamily, saddr &char, addr voidptr) int +fn C.inet_pton(family AddrFamily, saddr &char, addr voidptr) i32 -fn C.photon_socket(domain AddrFamily, typ SocketType, protocol int) int -fn C.photon_connect(int, &Addr, u32, timeout u64) int -fn C.photon_accept(int, voidptr, int, timeout u64) int -fn C.photon_send(int, voidptr, int, int, timeout u64) int -fn C.photon_recv(int, voidptr, int, int, timeout u64) int +fn C.photon_socket(domain AddrFamily, typ SocketType, protocol i32) i32 +fn C.photon_connect(i32, &Addr, u32, timeout u64) i32 +fn C.photon_accept(i32, voidptr, i32, timeout u64) i32 +fn C.photon_send(i32, voidptr, i32, i32, timeout u64) i32 +fn C.photon_recv(i32, voidptr, i32, i32, timeout u64) i32 @[typedef] pub struct C.fd_set {} diff --git a/vlib/net/mbedtls/mbedtls.c.v b/vlib/net/mbedtls/mbedtls.c.v index 078632827..1eb60eb82 100644 --- a/vlib/net/mbedtls/mbedtls.c.v +++ b/vlib/net/mbedtls/mbedtls.c.v @@ -167,43 +167,43 @@ pub struct C.mbedtls_x509_crt {} pub struct C.mbedtls_x509_crl {} fn C.mbedtls_net_init(&C.mbedtls_net_context) -fn C.mbedtls_net_connect(&C.mbedtls_net_context, &char, &char, int) int -fn C.mbedtls_net_bind(&C.mbedtls_net_context, &char, &char, int) int -fn C.mbedtls_net_accept(&C.mbedtls_net_context, &C.mbedtls_net_context, voidptr, usize, &usize) int +fn C.mbedtls_net_connect(&C.mbedtls_net_context, &char, &char, i32) i32 +fn C.mbedtls_net_bind(&C.mbedtls_net_context, &char, &char, i32) i32 +fn C.mbedtls_net_accept(&C.mbedtls_net_context, &C.mbedtls_net_context, voidptr, usize, &usize) i32 fn C.mbedtls_net_free(&C.mbedtls_net_context) fn C.mbedtls_ssl_init(&C.mbedtls_ssl_context) -fn C.mbedtls_ssl_setup(&C.mbedtls_ssl_context, &C.mbedtls_ssl_config) int +fn C.mbedtls_ssl_setup(&C.mbedtls_ssl_context, &C.mbedtls_ssl_config) i32 fn C.mbedtls_ssl_session_reset(&C.mbedtls_ssl_context) -fn C.mbedtls_ssl_conf_authmode(&C.mbedtls_ssl_config, int) +fn C.mbedtls_ssl_conf_authmode(&C.mbedtls_ssl_config, i32) fn C.mbedtls_ssl_conf_rng(&C.mbedtls_ssl_config, fn (voidptr, &u8, usize) int, &C.mbedtls_ctr_drbg_context) fn C.mbedtls_ssl_set_bio(&C.mbedtls_ssl_context, &C.mbedtls_net_context, &C.mbedtls_ssl_send_t, &C.mbedtls_ssl_recv_t, &C.mbedtls_ssl_recv_timeout_t) -fn C.mbedtls_ssl_conf_own_cert(&C.mbedtls_ssl_config, &C.mbedtls_x509_crt, &C.mbedtls_pk_context) int +fn C.mbedtls_ssl_conf_own_cert(&C.mbedtls_ssl_config, &C.mbedtls_x509_crt, &C.mbedtls_pk_context) i32 fn C.mbedtls_ssl_conf_ca_chain(&C.mbedtls_ssl_config, &C.mbedtls_x509_crt, &C.mbedtls_x509_crl) -fn C.mbedtls_ssl_set_hostname(&C.mbedtls_ssl_context, &char) int -fn C.mbedtls_ssl_handshake(&C.mbedtls_ssl_context) int -fn C.mbedtls_ssl_read(&C.mbedtls_ssl_context, &u8, usize) int -fn C.mbedtls_ssl_write(&C.mbedtls_ssl_context, &u8, usize) int +fn C.mbedtls_ssl_set_hostname(&C.mbedtls_ssl_context, &char) i32 +fn C.mbedtls_ssl_handshake(&C.mbedtls_ssl_context) i32 +fn C.mbedtls_ssl_read(&C.mbedtls_ssl_context, &u8, usize) i32 +fn C.mbedtls_ssl_write(&C.mbedtls_ssl_context, &u8, usize) i32 fn C.mbedtls_ssl_free(&C.mbedtls_ssl_context) fn C.mbedtls_ssl_config_init(&C.mbedtls_ssl_config) -fn C.mbedtls_ssl_config_defaults(&C.mbedtls_ssl_config, int, int, int) int +fn C.mbedtls_ssl_config_defaults(&C.mbedtls_ssl_config, i32, i32, i32) i32 fn C.mbedtls_ssl_config_free(&C.mbedtls_ssl_config) fn C.mbedtls_ssl_conf_sni(&C.mbedtls_ssl_config, fn (voidptr, &C.mbedtls_ssl_context, &char, int) int, voidptr) fn C.mbedtls_ssl_set_hs_ca_chain(&C.mbedtls_ssl_config, &C.mbedtls_x509_crt, &C.mbedtls_x509_crl) -fn C.mbedtls_ssl_set_hs_own_cert(&C.mbedtls_ssl_context, &C.mbedtls_x509_crt, &C.mbedtls_pk_context) int -fn C.mbedtls_ssl_set_hs_authmode(&C.mbedtls_ssl_context, int) +fn C.mbedtls_ssl_set_hs_own_cert(&C.mbedtls_ssl_context, &C.mbedtls_x509_crt, &C.mbedtls_pk_context) i32 +fn C.mbedtls_ssl_set_hs_authmode(&C.mbedtls_ssl_context, i32) fn C.mbedtls_pk_init(&C.mbedtls_pk_context) fn C.mbedtls_pk_free(&C.mbedtls_pk_context) fn C.mbedtls_pk_parse_key(&C.mbedtls_pk_context, &u8, usize, &u8, usize, fn (voidptr, &u8, usize) int, - voidptr) int -fn C.mbedtls_pk_parse_keyfile(&C.mbedtls_pk_context, &char, &char, fn (voidptr, &u8, usize) int, voidptr) int + voidptr) i32 +fn C.mbedtls_pk_parse_keyfile(&C.mbedtls_pk_context, &char, &char, fn (voidptr, &u8, usize) int, voidptr) i32 fn C.mbedtls_ctr_drbg_init(&C.mbedtls_ctr_drbg_context) -fn C.mbedtls_ctr_drbg_seed(&C.mbedtls_ctr_drbg_context, fn (voidptr, &u8, usize), voidptr, &u8, usize) int +fn C.mbedtls_ctr_drbg_seed(&C.mbedtls_ctr_drbg_context, fn (voidptr, &u8, usize), voidptr, &u8, usize) i32 fn C.mbedtls_ctr_drbg_free(&C.mbedtls_ctr_drbg_context) -fn C.mbedtls_ctr_drbg_random(voidptr, &u8, usize) int +fn C.mbedtls_ctr_drbg_random(voidptr, &u8, usize) i32 fn C.mbedtls_entropy_init(&C.mbedtls_entropy_context) fn C.mbedtls_entropy_free(&C.mbedtls_entropy_context) @@ -211,13 +211,13 @@ fn C.mbedtls_entropy_func(voidptr, &u8, usize) fn C.mbedtls_x509_crt_init(&C.mbedtls_x509_crt) fn C.mbedtls_x509_crt_free(&C.mbedtls_x509_crt) -fn C.mbedtls_x509_crt_parse(&C.mbedtls_x509_crt, &u8, usize) int -fn C.mbedtls_x509_crt_parse_file(&C.mbedtls_x509_crt, &char) int +fn C.mbedtls_x509_crt_parse(&C.mbedtls_x509_crt, &u8, usize) i32 +fn C.mbedtls_x509_crt_parse_file(&C.mbedtls_x509_crt, &char) i32 -fn C.mbedtls_high_level_strerr(int) &char +fn C.mbedtls_high_level_strerr(i32) &char -fn C.mbedtls_debug_set_threshold(level int) +fn C.mbedtls_debug_set_threshold(level i32) fn C.mbedtls_ssl_conf_read_timeout(conf &C.mbedtls_ssl_config, timeout u32) -fn C.mbedtls_ssl_conf_alpn_protocols(&C.mbedtls_ssl_config, &&char) int +fn C.mbedtls_ssl_conf_alpn_protocols(&C.mbedtls_ssl_config, &&char) i32 diff --git a/vlib/net/net_nix.c.v b/vlib/net/net_nix.c.v index 73f03a348..3bb2d0d59 100644 --- a/vlib/net/net_nix.c.v +++ b/vlib/net/net_nix.c.v @@ -28,4 +28,4 @@ pub const error_einprogress = int(C.EINPROGRESS) pub const error_eagain = int(C.EAGAIN) pub const error_eintr = int(C.EINTR) -fn C.unlink(&char) int +fn C.unlink(&char) i32 diff --git a/vlib/net/openssl/openssl.c.v b/vlib/net/openssl/openssl.c.v index ac1a96cfc..9a7181a53 100644 --- a/vlib/net/openssl/openssl.c.v +++ b/vlib/net/openssl/openssl.c.v @@ -86,46 +86,46 @@ fn (c &C.SSL_CTX) str() string { fn C.BIO_new_ssl_connect(ctx &C.SSL_CTX) &C.BIO -fn C.BIO_set_conn_hostname(b &C.BIO, name &char) int +fn C.BIO_set_conn_hostname(b &C.BIO, name &char) i32 // there are actually 2 macros for BIO_get_ssl // fn C.BIO_get_ssl(bp &C.BIO, ssl charptr, c int) // fn C.BIO_get_ssl(bp &C.BIO, sslp charptr) fn C.BIO_get_ssl(bp &C.BIO, vargs ...voidptr) -fn C.BIO_do_connect(b &C.BIO) int +fn C.BIO_do_connect(b &C.BIO) i32 -fn C.BIO_do_handshake(b &C.BIO) int +fn C.BIO_do_handshake(b &C.BIO) i32 fn C.BIO_puts(b &C.BIO, buf &char) -fn C.BIO_read(b &C.BIO, buf voidptr, len int) int +fn C.BIO_read(b &C.BIO, buf voidptr, len i32) i32 fn C.BIO_free_all(a &C.BIO) fn C.SSL_CTX_new(method &C.SSL_METHOD) &C.SSL_CTX -fn C.SSL_CTX_set_options(ctx &C.SSL_CTX, options int) +fn C.SSL_CTX_set_options(ctx &C.SSL_CTX, options i32) -fn C.SSL_CTX_set_verify_depth(s &C.SSL_CTX, depth int) +fn C.SSL_CTX_set_verify_depth(s &C.SSL_CTX, depth i32) -fn C.SSL_CTX_load_verify_locations(ctx &C.SSL_CTX, const_file &char, ca_path &char) int +fn C.SSL_CTX_load_verify_locations(ctx &C.SSL_CTX, const_file &char, ca_path &char) i32 fn C.SSL_CTX_free(ctx &C.SSL_CTX) -fn C.SSL_CTX_use_certificate_file(ctx &C.SSL_CTX, const_file &char, file_type int) int +fn C.SSL_CTX_use_certificate_file(ctx &C.SSL_CTX, const_file &char, file_type i32) i32 -fn C.SSL_CTX_use_PrivateKey_file(ctx &C.SSL_CTX, const_file &char, file_type int) int +fn C.SSL_CTX_use_PrivateKey_file(ctx &C.SSL_CTX, const_file &char, file_type i32) i32 fn C.SSL_new(&C.SSL_CTX) &C.SSL -fn C.SSL_set_fd(ssl &C.SSL, fd int) int +fn C.SSL_set_fd(ssl &C.SSL, fd i32) i32 -fn C.SSL_connect(&C.SSL) int +fn C.SSL_connect(&C.SSL) i32 -fn C.SSL_do_handshake(&C.SSL) int +fn C.SSL_do_handshake(&C.SSL) i32 -fn C.SSL_set_cipher_list(ctx &SSL, str &char) int +fn C.SSL_set_cipher_list(ctx &SSL, str &char) i32 fn C.SSL_get1_peer_certificate(ssl &SSL) &C.X509 @@ -133,23 +133,23 @@ fn C.X509_free(const_cert &C.X509) fn C.ERR_clear_error() -fn C.SSL_get_error(ssl &C.SSL, ret int) int +fn C.SSL_get_error(ssl &C.SSL, ret i32) i32 -fn C.SSL_get_verify_result(ssl &SSL) int +fn C.SSL_get_verify_result(ssl &SSL) i32 -fn C.SSL_set_tlsext_host_name(s &SSL, name &char) int +fn C.SSL_set_tlsext_host_name(s &SSL, name &char) i32 -fn C.SSL_shutdown(&C.SSL) int +fn C.SSL_shutdown(&C.SSL) i32 fn C.SSL_free(&C.SSL) -fn C.SSL_write(ssl &C.SSL, buf voidptr, buflen int) int +fn C.SSL_write(ssl &C.SSL, buf voidptr, buflen i32) i32 -fn C.SSL_read(ssl &C.SSL, buf voidptr, buflen int) int +fn C.SSL_read(ssl &C.SSL, buf voidptr, buflen i32) i32 fn C.SSL_load_error_strings() -fn C.SSL_library_init() int +fn C.SSL_library_init() i32 fn C.SSLv23_client_method() &C.SSL_METHOD @@ -157,7 +157,7 @@ fn C.TLS_method() voidptr fn C.TLSv1_2_method() voidptr -fn C.OPENSSL_init_ssl(opts u64, settings &OPENSSL_INIT_SETTINGS) int +fn C.OPENSSL_init_ssl(opts u64, settings &OPENSSL_INIT_SETTINGS) i32 fn init() { $if ssl_pre_1_1_version ? { diff --git a/vlib/net/unix/common.c.v b/vlib/net/unix/common.c.v index ffb9a205f..f3a5ca160 100644 --- a/vlib/net/unix/common.c.v +++ b/vlib/net/unix/common.c.v @@ -13,7 +13,7 @@ const no_timeout = time.Duration(0) // only ever return with data) const infinite_timeout = time.infinite -fn C.strncpy(&char, &char, int) +fn C.strncpy(&char, &char, i32) // close a socket, given its file descriptor `handle`. pub fn close(handle int) ! { diff --git a/vlib/os/debugger_darwin.c.v b/vlib/os/debugger_darwin.c.v index 1919fa77a..3d811f6ae 100644 --- a/vlib/os/debugger_darwin.c.v +++ b/vlib/os/debugger_darwin.c.v @@ -3,7 +3,7 @@ module os #include #include -fn C.ptrace(int, u32, voidptr, int) int +fn C.ptrace(i32, u32, voidptr, i32) i32 // debugger_present returns a bool indicating if the process is being debugged. pub fn debugger_present() bool { diff --git a/vlib/os/debugger_freebsd.c.v b/vlib/os/debugger_freebsd.c.v index 61020db42..583b25b99 100644 --- a/vlib/os/debugger_freebsd.c.v +++ b/vlib/os/debugger_freebsd.c.v @@ -2,7 +2,7 @@ module os #include -fn C.ptrace(int, u32, voidptr, int) int +fn C.ptrace(i32, u32, voidptr, i32) i32 // debugger_present returns a bool indicating if the process is being debugged. pub fn debugger_present() bool { diff --git a/vlib/os/debugger_openbsd.c.v b/vlib/os/debugger_openbsd.c.v index 877c95779..38138d824 100644 --- a/vlib/os/debugger_openbsd.c.v +++ b/vlib/os/debugger_openbsd.c.v @@ -2,7 +2,7 @@ module os #include -fn C.ptrace(int, u32, voidptr, int) int +fn C.ptrace(i32, u32, voidptr, i32) i32 // debugger_present returns a bool indicating if the process is being debugged. pub fn debugger_present() bool { diff --git a/vlib/os/environment.c.v b/vlib/os/environment.c.v index b98f811fd..853a148ab 100644 --- a/vlib/os/environment.c.v +++ b/vlib/os/environment.c.v @@ -8,7 +8,7 @@ fn C.getenv(&char) &char // C.GetEnvironmentStringsW & C.FreeEnvironmentStringsW are defined only on windows fn C.GetEnvironmentStringsW() &u16 -fn C.FreeEnvironmentStringsW(&u16) int +fn C.FreeEnvironmentStringsW(&u16) i32 // getenv returns the value of the environment variable named by the key. // If there is not one found, it returns an empty string ''. diff --git a/vlib/os/fd.c.v b/vlib/os/fd.c.v index a56997673..c6ff66c9c 100644 --- a/vlib/os/fd.c.v +++ b/vlib/os/fd.c.v @@ -80,12 +80,12 @@ pub: tv_usec u64 } -fn C.select(ndfs int, readfds &C.fd_set, writefds &C.fd_set, exceptfds &C.fd_set, timeout &C.timeval) int +fn C.select(ndfs i32, readfds &C.fd_set, writefds &C.fd_set, exceptfds &C.fd_set, timeout &C.timeval) i32 // These are C macros, but from the V's point of view, can be treated as C functions: fn C.FD_ZERO(fdset &C.fd_set) -fn C.FD_SET(fd int, fdset &C.fd_set) -fn C.FD_ISSET(fd int, fdset &C.fd_set) int +fn C.FD_SET(fd i32, fdset &C.fd_set) +fn C.FD_ISSET(fd i32, fdset &C.fd_set) i32 // fd_is_pending returns true, when there is pending data, waiting to be read from file descriptor `fd`. // If the file descriptor is closed, or if reading from it, will block (there is no data), fd_is_pending returns false. diff --git a/vlib/os/file.c.v b/vlib/os/file.c.v index a97052b74..d3ad04a43 100644 --- a/vlib/os/file.c.v +++ b/vlib/os/file.c.v @@ -28,11 +28,11 @@ pub mut: is_opened bool } -fn C.fseeko(&C.FILE, u64, int) int +fn C.fseeko(&C.FILE, u64, i32) i32 -fn C._fseeki64(&C.FILE, u64, int) int +fn C._fseeki64(&C.FILE, u64, i32) i32 -fn C.getc(&C.FILE) int +fn C.getc(&C.FILE) i32 fn C.freopen(&char, &char, &C.FILE) &C.FILE diff --git a/vlib/os/file_buffering.c.v b/vlib/os/file_buffering.c.v index 02d44fc23..535b060c6 100644 --- a/vlib/os/file_buffering.c.v +++ b/vlib/os/file_buffering.c.v @@ -1,6 +1,6 @@ module os -fn C.setvbuf(stream &C.FILE, buffer &char, mode int, size usize) int +fn C.setvbuf(stream &C.FILE, buffer &char, mode i32, size usize) i32 // FileBufferMode describes the available buffering modes for an os.File: unbuffered, line buffered and block/fully buffered. // Normally all files are block buffered. If a stream refers to a terminal (as stdout normally does), it is line buffered. diff --git a/vlib/os/filelock/lib_nix.c.v b/vlib/os/filelock/lib_nix.c.v index 0ab2a1cb0..78f9271e2 100644 --- a/vlib/os/filelock/lib_nix.c.v +++ b/vlib/os/filelock/lib_nix.c.v @@ -2,9 +2,9 @@ module filelock #include -fn C.unlink(&char) int -fn C.open(&char, int, int) int -fn C.flock(int, int) int +fn C.unlink(&char) i32 +fn C.open(&char, i32, i32) i32 +fn C.flock(i32, i32) i32 @[unsafe] pub fn (mut l FileLock) unlink() { diff --git a/vlib/os/notify/backend_darwin.c.v b/vlib/os/notify/backend_darwin.c.v index 621acac97..56f6f489d 100644 --- a/vlib/os/notify/backend_darwin.c.v +++ b/vlib/os/notify/backend_darwin.c.v @@ -15,9 +15,9 @@ mut: udata voidptr } -fn C.kqueue() int -fn C.__kevent__(int, voidptr, int, voidptr, int, voidptr) int -fn C.EV_SET(voidptr, u32, i16, u16, u32, int, voidptr) +fn C.kqueue() i32 +fn C.__kevent__(i32, voidptr, i32, voidptr, i32, voidptr) i32 +fn C.EV_SET(voidptr, u32, i16, u16, u32, i32, voidptr) // KqueueNotifier provides methods that implement FdNotifier using the // kqueue I/O event notification facility (macos, freeBSD, xxxBSD...unix only) diff --git a/vlib/os/notify/backend_linux.c.v b/vlib/os/notify/backend_linux.c.v index e558a3c8f..49373ea5c 100644 --- a/vlib/os/notify/backend_linux.c.v +++ b/vlib/os/notify/backend_linux.c.v @@ -18,11 +18,11 @@ union C.epoll_data_t { u64 u64 } -fn C.epoll_create1(int) int +fn C.epoll_create1(i32) i32 -fn C.epoll_ctl(int, int, int, &C.epoll_event) int +fn C.epoll_ctl(i32, i32, i32, &C.epoll_event) i32 -fn C.epoll_wait(int, &C.epoll_event, int, int) int +fn C.epoll_wait(i32, &C.epoll_event, i32, i32) i32 // EpollNotifier provides methods that implement FdNotifier using the // epoll I/O event notification facility (linux only) diff --git a/vlib/os/os.c.v b/vlib/os/os.c.v index 3804b0eb1..20c21c884 100644 --- a/vlib/os/os.c.v +++ b/vlib/os/os.c.v @@ -18,33 +18,33 @@ pub const args = arguments() fn C.readdir(voidptr) &C.dirent -fn C.readlink(pathname &char, buf &char, bufsiz usize) int +fn C.readlink(pathname &char, buf &char, bufsiz usize) i32 -fn C.getline(voidptr, voidptr, voidptr) int +fn C.getline(voidptr, voidptr, voidptr) i32 -fn C.sigaction(int, voidptr, int) int +fn C.sigaction(i32, voidptr, i32) i32 -fn C.open(&char, int, ...int) int +fn C.open(&char, i32, ...int) i32 -fn C._wopen(&u16, int, ...int) int +fn C._wopen(&u16, i32, ...int) i32 -fn C.fdopen(fd int, mode &char) &C.FILE +fn C.fdopen(fd i32, mode &char) &C.FILE -fn C.ferror(stream &C.FILE) int +fn C.ferror(stream &C.FILE) i32 -fn C.feof(stream &C.FILE) int +fn C.feof(stream &C.FILE) i32 -fn C.CopyFile(&u16, &u16, bool) int +fn C.CopyFile(&u16, &u16, bool) i32 // fn C.lstat(charptr, voidptr) u64 fn C._wstat64(&u16, voidptr) u64 -fn C.chown(&char, int, int) int +fn C.chown(&char, i32, i32) i32 -fn C.ftruncate(voidptr, u64) int +fn C.ftruncate(voidptr, u64) i32 -fn C._chsize_s(voidptr, u64) int +fn C._chsize_s(voidptr, u64) i32 // read_bytes returns all bytes read from file in `path`. @[manualfree] diff --git a/vlib/os/os_android_outside_termux.c.v b/vlib/os/os_android_outside_termux.c.v index 714500191..a91d79dbb 100644 --- a/vlib/os/os_android_outside_termux.c.v +++ b/vlib/os/os_android_outside_termux.c.v @@ -34,7 +34,7 @@ pub struct C.AAssetManager { // AssetManager provides access to an application's raw assets by creating Asset objects. pub type AssetManager = C.AAssetManager -fn C.AAssetManager_open(&C.AAssetManager, &char, int) &C.AAsset +fn C.AAssetManager_open(&C.AAssetManager, &char, i32) &C.AAsset // open opens an Android `Asset`. pub fn (am &AssetManager) open(filename string, mode AssetMode) !&Asset { @@ -57,7 +57,7 @@ pub fn (a &Asset) get_buffer() voidptr { return C.AAsset_getBuffer(a) } -fn C.AAsset_getLength(&C.AAsset) int +fn C.AAsset_getLength(&C.AAsset) i32 // get_length returns the total size of the asset data. pub fn (a &Asset) get_length() int { @@ -71,7 +71,7 @@ pub fn (a &Asset) get_length_64() i64 { return C.AAsset_getLength64(a) } -fn C.AAsset_read(&C.AAsset, voidptr, usize) int +fn C.AAsset_read(&C.AAsset, voidptr, usize) i32 // read attempts to read 'count' bytes of data from the current offset. // read returns the number of bytes read, zero on EOF, or < 0 on error. diff --git a/vlib/os/os_nix.c.v b/vlib/os/os_nix.c.v index f1d008a6c..671162c64 100644 --- a/vlib/os/os_nix.c.v +++ b/vlib/os/os_nix.c.v @@ -45,26 +45,26 @@ pub const s_iroth = 0o0004 // Read by others pub const s_iwoth = 0o0002 // Write by others pub const s_ixoth = 0o0001 -fn C.utime(&char, &C.utimbuf) int +fn C.utime(&char, &C.utimbuf) i32 -fn C.uname(name &C.utsname) int +fn C.uname(name &C.utsname) i32 -fn C.symlink(&char, &char) int +fn C.symlink(&char, &char) i32 -fn C.readlink(&char, &char, int) int +fn C.readlink(&char, &char, i32) i32 -fn C.link(&char, &char) int +fn C.link(&char, &char) i32 -fn C.gethostname(&char, int) int +fn C.gethostname(&char, i32) i32 // Note: not available on Android fn C.getlogin_r(&char, int) int fn C.getlogin() &char -fn C.getppid() int +fn C.getppid() i32 -fn C.getgid() int +fn C.getgid() i32 -fn C.getegid() int +fn C.getegid() i32 enum GlobMatch { exact @@ -441,7 +441,7 @@ pub fn (mut f File) close() { C.fclose(f.cfile) } -fn C.mkstemp(stemplate &u8) int +fn C.mkstemp(stemplate &u8) i32 // ensure_folder_is_writable checks that `folder` exists, and is writable to the process // by creating an empty file in it, then deleting it. @@ -522,7 +522,7 @@ fn get_long_path(path string) !string { return path } -fn C.sysconf(name int) i64 +fn C.sysconf(name i32) i64 // page_size returns the page size in bytes. pub fn page_size() int { diff --git a/vlib/os/os_windows.c.v b/vlib/os/os_windows.c.v index acddec17c..abecbf3d5 100644 --- a/vlib/os/os_windows.c.v +++ b/vlib/os/os_windows.c.v @@ -18,12 +18,12 @@ pub const path_delimiter = ';' pub const path_devnull = r'\\.\nul' // See https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsymboliclinkw -fn C.CreateSymbolicLinkW(&u16, &u16, u32) int +fn C.CreateSymbolicLinkW(&u16, &u16, u32) i32 // See https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createhardlinkw -fn C.CreateHardLinkW(&u16, &u16, C.SECURITY_ATTRIBUTES) int +fn C.CreateHardLinkW(&u16, &u16, C.SECURITY_ATTRIBUTES) i32 -fn C._getpid() int +fn C._getpid() i32 const executable_suffixes = ['.exe', '.bat', '.cmd', ''] @@ -118,7 +118,7 @@ pub struct C._utimbuf { modtime int } -fn C._utime(&char, voidptr) int +fn C._utime(&char, voidptr) i32 fn native_glob_pattern(pattern string, mut matches []string) ! { $if debug { diff --git a/vlib/os/pipe.c.v b/vlib/os/pipe.c.v index a5236e438..692c2a596 100644 --- a/vlib/os/pipe.c.v +++ b/vlib/os/pipe.c.v @@ -1,9 +1,9 @@ module os -fn C._dup(fd int) int -fn C._dup2(fd1 int, fd2 int) int -fn C._pipe(fds &int, size u32, mode int) int -fn C.dup(fd int) int +fn C._dup(fd i32) i32 +fn C._dup2(fd1 i32, fd2 i32) i32 +fn C._pipe(fds &int, size u32, mode i32) i32 +fn C.dup(fd i32) i32 const fd_stdout = $if windows { 1 } $else { C.STDOUT_FILENO } const fd_stderr = $if windows { 2 } $else { C.STDERR_FILENO } diff --git a/vlib/os/process_nix.c.v b/vlib/os/process_nix.c.v index 358aaf252..0ffdda59c 100644 --- a/vlib/os/process_nix.c.v +++ b/vlib/os/process_nix.c.v @@ -1,6 +1,6 @@ module os -fn C.setpgid(pid int, pgid int) int +fn C.setpgid(pid i32, pgid i32) i32 fn (mut p Process) unix_spawn_process() int { mut pipeset := [6]int{} diff --git a/vlib/os/process_windows.c.v b/vlib/os/process_windows.c.v index b666331c0..36282d6c3 100644 --- a/vlib/os/process_windows.c.v +++ b/vlib/os/process_windows.c.v @@ -6,7 +6,7 @@ fn C.GenerateConsoleCtrlEvent(event u32, pgid u32) bool fn C.GetModuleHandleA(name &char) HMODULE fn C.GetProcAddress(handle voidptr, procname &u8) voidptr fn C.TerminateProcess(process HANDLE, exit_code u32) bool -fn C.PeekNamedPipe(hNamedPipe voidptr, lpBuffer voidptr, nBufferSize int, lpBytesRead voidptr, lpTotalBytesAvail voidptr, +fn C.PeekNamedPipe(hNamedPipe voidptr, lpBuffer voidptr, nBufferSize i32, lpBytesRead voidptr, lpTotalBytesAvail voidptr, lpBytesLeftThisMessage voidptr) bool type FN_NTSuspendResume = fn (voidptr) u64 diff --git a/vlib/os/signal.c.v b/vlib/os/signal.c.v index d44b8dd70..ef08edc2b 100644 --- a/vlib/os/signal.c.v +++ b/vlib/os/signal.c.v @@ -2,7 +2,7 @@ module os #include -fn C.signal(signal int, handlercb SignalHandler) voidptr +fn C.signal(signal i32, handlercb SignalHandler) voidptr // signal will assign `handler` callback to be called when `signum` signal is received. pub fn signal_opt(signum Signal, handler SignalHandler) !SignalHandler { diff --git a/vlib/os/signal_darwin.c.v b/vlib/os/signal_darwin.c.v index 79ff72d75..b2115f036 100644 --- a/vlib/os/signal_darwin.c.v +++ b/vlib/os/signal_darwin.c.v @@ -16,9 +16,9 @@ pub fn is_main_thread() bool { return g_main_thread_id == u64(C.pthread_self()) } -fn C.sigaddset(set &u32, signum int) int +fn C.sigaddset(set &u32, signum i32) i32 fn C.sigemptyset(set &u32) -fn C.sigprocmask(how int, set &u32, oldset &u32) int +fn C.sigprocmask(how i32, set &u32, oldset &u32) i32 fn signal_ignore_internal(args ...Signal) { mask1 := u32(0) diff --git a/vlib/os/signal_linux.c.v b/vlib/os/signal_linux.c.v index ab9dff37c..82ddd699f 100644 --- a/vlib/os/signal_linux.c.v +++ b/vlib/os/signal_linux.c.v @@ -19,9 +19,9 @@ pub fn is_main_thread() bool { @[typedef] struct C.sigset_t {} -fn C.sigaddset(set &C.sigset_t, signum int) int +fn C.sigaddset(set &C.sigset_t, signum i32) i32 fn C.sigemptyset(set &C.sigset_t) -fn C.sigprocmask(how int, set &C.sigset_t, oldset &C.sigset_t) int +fn C.sigprocmask(how i32, set &C.sigset_t, oldset &C.sigset_t) i32 fn signal_ignore_internal(args ...Signal) { $if !android && !macos && !openbsd { diff --git a/vlib/os/sleeping.c.v b/vlib/os/sleeping.c.v index 1112aa6bc..9069d7b8d 100644 --- a/vlib/os/sleeping.c.v +++ b/vlib/os/sleeping.c.v @@ -6,7 +6,7 @@ pub mut: tv_nsec i64 } -fn C.nanosleep(req &C.timespec, rem &C.timespec) int +fn C.nanosleep(req &C.timespec, rem &C.timespec) i32 // sleep_ms provides a cross platform way to sleep, without having to `import time` for a time.sleep/1 call. fn sleep_ms(ms i64) { diff --git a/vlib/picoev/loop_freebsd.c.v b/vlib/picoev/loop_freebsd.c.v index 237d0618a..5372dbe77 100644 --- a/vlib/picoev/loop_freebsd.c.v +++ b/vlib/picoev/loop_freebsd.c.v @@ -4,9 +4,9 @@ module picoev #include #include -fn C.kevent(int, changelist voidptr, nchanges int, eventlist voidptr, nevents int, timeout &C.timespec) int -fn C.kqueue() int -fn C.EV_SET(kev voidptr, ident int, filter i16, flags u16, fflags u32, data voidptr, udata voidptr) +fn C.kevent(i32, changelist voidptr, nchanges i32, eventlist voidptr, nevents i32, timeout &C.timespec) i32 +fn C.kqueue() i32 +fn C.EV_SET(kev voidptr, ident i32, filter i16, flags u16, fflags u32, data voidptr, udata voidptr) pub struct C.kevent { pub mut: diff --git a/vlib/picoev/loop_linux.c.v b/vlib/picoev/loop_linux.c.v index 2fda674fe..539404200 100644 --- a/vlib/picoev/loop_linux.c.v +++ b/vlib/picoev/loop_linux.c.v @@ -6,9 +6,9 @@ $if !musl ? { #include // needed for cross compiling to linux } -fn C.epoll_create(__flags int) int -fn C.epoll_wait(__epfd int, __events &C.epoll_event, __maxevents int, __timeout int) int -fn C.epoll_ctl(__epfd int, __op int, __fd int, __event &C.epoll_event) int +fn C.epoll_create(__flags i32) i32 +fn C.epoll_wait(__epfd i32, __events &C.epoll_event, __maxevents i32, __timeout i32) i32 +fn C.epoll_ctl(__epfd i32, __op i32, __fd i32, __event &C.epoll_event) i32 @[typedef] union C.epoll_data { diff --git a/vlib/picoev/loop_macos.c.v b/vlib/picoev/loop_macos.c.v index 00d2c999d..a66503127 100644 --- a/vlib/picoev/loop_macos.c.v +++ b/vlib/picoev/loop_macos.c.v @@ -4,9 +4,9 @@ module picoev #include #include -fn C.kevent(int, changelist voidptr, nchanges int, eventlist voidptr, nevents int, timeout &C.timespec) int -fn C.kqueue() int -fn C.EV_SET(kev voidptr, ident int, filter i16, flags u16, fflags u32, data voidptr, udata voidptr) +fn C.kevent(i32, changelist voidptr, nchanges i32, eventlist voidptr, nevents i32, timeout &C.timespec) i32 +fn C.kqueue() i32 +fn C.EV_SET(kev voidptr, ident i32, filter i16, flags u16, fflags u32, data voidptr, udata voidptr) pub struct C.kevent { pub mut: diff --git a/vlib/picoev/loop_openbsd.c.v b/vlib/picoev/loop_openbsd.c.v index 1ef6bb0b4..571c43f1d 100644 --- a/vlib/picoev/loop_openbsd.c.v +++ b/vlib/picoev/loop_openbsd.c.v @@ -4,9 +4,9 @@ module picoev #include #include -fn C.kevent(int, changelist voidptr, nchanges int, eventlist voidptr, nevents int, timeout &C.timespec) int -fn C.kqueue() int -fn C.EV_SET(kev voidptr, ident int, filter i16, flags u16, fflags u32, data voidptr, udata voidptr) +fn C.kevent(i32, changelist voidptr, nchanges i32, eventlist voidptr, nevents i32, timeout &C.timespec) i32 +fn C.kqueue() i32 +fn C.EV_SET(kev voidptr, ident i32, filter i16, flags u16, fflags u32, data voidptr, udata voidptr) pub struct C.kevent { pub mut: diff --git a/vlib/picoev/loop_termux.c.v b/vlib/picoev/loop_termux.c.v index 2fda674fe..539404200 100644 --- a/vlib/picoev/loop_termux.c.v +++ b/vlib/picoev/loop_termux.c.v @@ -6,9 +6,9 @@ $if !musl ? { #include // needed for cross compiling to linux } -fn C.epoll_create(__flags int) int -fn C.epoll_wait(__epfd int, __events &C.epoll_event, __maxevents int, __timeout int) int -fn C.epoll_ctl(__epfd int, __op int, __fd int, __event &C.epoll_event) int +fn C.epoll_create(__flags i32) i32 +fn C.epoll_wait(__epfd i32, __events &C.epoll_event, __maxevents i32, __timeout i32) i32 +fn C.epoll_ctl(__epfd i32, __op i32, __fd i32, __event &C.epoll_event) i32 @[typedef] union C.epoll_data { diff --git a/vlib/picohttpparser/response.c.v b/vlib/picohttpparser/response.c.v index 81494a905..6b81eb6ee 100644 --- a/vlib/picohttpparser/response.c.v +++ b/vlib/picohttpparser/response.c.v @@ -109,7 +109,7 @@ pub fn (mut r Response) raw(response string) { r.write_string(response) } -fn C.send(sockfd int, buf voidptr, len usize, flags int) int +fn C.send(sockfd i32, buf voidptr, len usize, flags i32) i32 @[inline] pub fn (mut r Response) end() int { diff --git a/vlib/readline/readline_nix.c.v b/vlib/readline/readline_nix.c.v index 1a475f349..3bda2766c 100644 --- a/vlib/readline/readline_nix.c.v +++ b/vlib/readline/readline_nix.c.v @@ -12,9 +12,9 @@ import term import os import encoding.utf8.east_asian -fn C.raise(sig int) +fn C.raise(sig i32) -fn C.getppid() int +fn C.getppid() i32 // Action defines what actions to be executed. enum Action { diff --git a/vlib/runtime/free_memory_impl_darwin.c.v b/vlib/runtime/free_memory_impl_darwin.c.v index ae75b6d65..bf9e63f66 100644 --- a/vlib/runtime/free_memory_impl_darwin.c.v +++ b/vlib/runtime/free_memory_impl_darwin.c.v @@ -23,9 +23,9 @@ pub struct C.task_t {} fn C.mach_host_self() C.host_t fn C.mach_task_self() C.task_t -fn C.mach_port_deallocate(task C.task_t, host C.host_t) int -fn C.host_page_size(host C.host_t, out_page_size &C.vm_size_t) int -fn C.host_statistics64(host C.host_t, flavor int, host_info_out &int, host_info_outCnt &u32) int +fn C.mach_port_deallocate(task C.task_t, host C.host_t) i32 +fn C.host_page_size(host C.host_t, out_page_size &C.vm_size_t) i32 +fn C.host_statistics64(host C.host_t, flavor i32, host_info_out &int, host_info_outCnt &u32) i32 fn free_memory_impl() !usize { $if macos { diff --git a/vlib/runtime/free_memory_impl_freebsd.c.v b/vlib/runtime/free_memory_impl_freebsd.c.v index 4fea509d1..c98f299e3 100644 --- a/vlib/runtime/free_memory_impl_freebsd.c.v +++ b/vlib/runtime/free_memory_impl_freebsd.c.v @@ -1,6 +1,6 @@ module runtime -fn C.sysctlnametomib(name charptr, mib &int, len &usize) int +fn C.sysctlnametomib(name charptr, mib &int, len &usize) i32 fn free_memory_impl() !usize { $if cross ? { diff --git a/vlib/runtime/runtime_nix.c.v b/vlib/runtime/runtime_nix.c.v index 818325301..ef61d1e7c 100644 --- a/vlib/runtime/runtime_nix.c.v +++ b/vlib/runtime/runtime_nix.c.v @@ -1,6 +1,6 @@ module runtime -fn C.sysconf(name int) i64 +fn C.sysconf(name i32) i64 // nr_cpus returns the number of virtual CPU cores found on the system. pub fn nr_cpus() int { diff --git a/vlib/runtime/used_memory_darwin.c.v b/vlib/runtime/used_memory_darwin.c.v index 5a20cf3fd..737dfce1b 100644 --- a/vlib/runtime/used_memory_darwin.c.v +++ b/vlib/runtime/used_memory_darwin.c.v @@ -4,7 +4,7 @@ struct C.task_basic_info { resident_size u64 } -fn C.task_info(C.task_t, int, &C.task_basic_info, &u64) int +fn C.task_info(C.task_t, i32, &C.task_basic_info, &u64) i32 // used_memory retrieves the current physical memory usage of the process. pub fn used_memory() !u64 { diff --git a/vlib/runtime/used_memory_freebsd.c.v b/vlib/runtime/used_memory_freebsd.c.v index 87506388b..9596a6cf4 100644 --- a/vlib/runtime/used_memory_freebsd.c.v +++ b/vlib/runtime/used_memory_freebsd.c.v @@ -10,7 +10,7 @@ struct C.rusage { ru_idrss int } -fn C.getrusage(who int, usage &C.rusage) int +fn C.getrusage(who i32, usage &C.rusage) i32 $if !tinyc { #flag -lprocstat @@ -26,7 +26,7 @@ struct C.kinfo_proc { fn C.procstat_open_sysctl() &C.procstat fn C.procstat_close(&C.procstat) -fn C.procstat_getprocs(&C.procstat, int, int, &u32) &C.kinfo_proc +fn C.procstat_getprocs(&C.procstat, i32, i32, &u32) &C.kinfo_proc // used_memory retrieves the current physical memory usage of the process. pub fn used_memory() !u64 { diff --git a/vlib/runtime/used_memory_openbsd.c.v b/vlib/runtime/used_memory_openbsd.c.v index c08acceae..47b2f5ca9 100644 --- a/vlib/runtime/used_memory_openbsd.c.v +++ b/vlib/runtime/used_memory_openbsd.c.v @@ -6,7 +6,7 @@ struct C.rusage { ru_maxrss int } -fn C.getrusage(who int, usage &C.rusage) int +fn C.getrusage(who i32, usage &C.rusage) i32 // used_memory retrieves the current physical memory usage of the process. pub fn used_memory() !u64 { diff --git a/vlib/runtime/used_memory_windows.c.v b/vlib/runtime/used_memory_windows.c.v index 6aa9113ed..1da1d3671 100644 --- a/vlib/runtime/used_memory_windows.c.v +++ b/vlib/runtime/used_memory_windows.c.v @@ -9,7 +9,7 @@ struct C.PROCESS_MEMORY_COUNTERS { WorkingSetSize isize } -fn C.GetProcessMemoryInfo(int, &C.PROCESS_MEMORY_COUNTERS, u64) bool +fn C.GetProcessMemoryInfo(i32, &C.PROCESS_MEMORY_COUNTERS, u64) bool // used_memory retrieves the current physical memory usage of the process. pub fn used_memory() !u64 { diff --git a/vlib/sokol/audio/audio.c.v b/vlib/sokol/audio/audio.c.v index 61f120d01..556b1547a 100644 --- a/vlib/sokol/audio/audio.c.v +++ b/vlib/sokol/audio/audio.c.v @@ -113,17 +113,17 @@ fn C.saudio_userdata() voidptr fn C.saudio_query_desc() C.saudio_desc -fn C.saudio_sample_rate() int +fn C.saudio_sample_rate() i32 -fn C.saudio_buffer_frames() int +fn C.saudio_buffer_frames() i32 -fn C.saudio_channels() int +fn C.saudio_channels() i32 fn C.saudio_suspended() bool -fn C.saudio_expect() int +fn C.saudio_expect() i32 -fn C.saudio_push(frames &f32, num_frames int) int +fn C.saudio_push(frames &f32, num_frames i32) i32 // setup - setup sokol-audio pub fn setup(desc &C.saudio_desc) { diff --git a/vlib/sokol/gfx/gfx_funcs.c.v b/vlib/sokol/gfx/gfx_funcs.c.v index 1eb4745d4..22b6b9347 100644 --- a/vlib/sokol/gfx/gfx_funcs.c.v +++ b/vlib/sokol/gfx/gfx_funcs.c.v @@ -26,20 +26,20 @@ fn C.sg_destroy_pipeline(pip C.sg_pipeline) fn C.sg_destroy_attachments(atts C.sg_attachments) fn C.sg_update_buffer(buf C.sg_buffer, data &C.sg_range) fn C.sg_update_image(img C.sg_image, data &C.sg_image_data) -fn C.sg_append_buffer(buf C.sg_buffer, data &C.sg_range) int +fn C.sg_append_buffer(buf C.sg_buffer, data &C.sg_range) i32 fn C.sg_query_buffer_overflow(buf C.sg_buffer) bool fn C.sg_query_buffer_will_overflow(buf C.sg_buffer, size usize) bool // rendering functions fn C.sg_begin_pass(const_pass &C.sg_pass) -fn C.sg_apply_viewport(x int, y int, width int, height int, origin_top_left bool) +fn C.sg_apply_viewport(x i32, y i32, width i32, height i32, origin_top_left bool) fn C.sg_apply_viewportf(x f32, y f32, width f32, height f32, origin_top_left bool) -fn C.sg_apply_scissor_rect(x int, y int, width int, height int, origin_top_left bool) +fn C.sg_apply_scissor_rect(x i32, y i32, width i32, height i32, origin_top_left bool) fn C.sg_apply_scissor_rectf(x f32, y f32, width f32, height f32, origin_top_left bool) fn C.sg_apply_pipeline(pip C.sg_pipeline) fn C.sg_apply_bindings(bindings &C.sg_bindings) -fn C.sg_apply_uniforms(stage ShaderStage, ub_index int, const_data &C.sg_range) -fn C.sg_draw(base_element int, num_elements int, num_instances int) +fn C.sg_apply_uniforms(stage ShaderStage, ub_index i32, const_data &C.sg_range) +fn C.sg_draw(base_element i32, num_elements i32, num_instances i32) fn C.sg_end_pass() fn C.sg_commit() diff --git a/vlib/sokol/sapp/sapp_funcs.c.v b/vlib/sokol/sapp/sapp_funcs.c.v index 2b6c06cb3..84ce9b219 100644 --- a/vlib/sokol/sapp/sapp_funcs.c.v +++ b/vlib/sokol/sapp/sapp_funcs.c.v @@ -4,21 +4,21 @@ module sapp fn C.sapp_isvalid() bool // returns the current framebuffer width in pixels -fn C.sapp_width() int +fn C.sapp_width() i32 fn C.sapp_widthf() f32 // returns the current framebuffer height in pixels -fn C.sapp_height() int +fn C.sapp_height() i32 fn C.sapp_heightf() f32 // get default framebuffer color pixel format -fn C.sapp_color_format() int +fn C.sapp_color_format() i32 // get default framebuffer depth pixel format -fn C.sapp_depth_format() int +fn C.sapp_depth_format() i32 // get default framebuffer sample count -fn C.sapp_sample_count() int +fn C.sapp_sample_count() i32 // returns true when high_dpi was requested and actually running in a high-dpi scenario fn C.sapp_high_dpi() bool @@ -90,13 +90,13 @@ fn C.sapp_set_window_title(&char) // SOKOL_APP_API_DECL void sapp_set_icon(const sapp_icon_desc* icon_desc); // Get number of dropped files -fn C.sapp_get_num_dropped_files() int +fn C.sapp_get_num_dropped_files() i32 // Get the file path of the dropped file -fn C.sapp_get_dropped_file_path(int) &char +fn C.sapp_get_dropped_file_path(i32) &char // special run-function for SOKOL_NO_ENTRY (in standard mode this is an empty stub) -fn C.sapp_run(desc &Desc) int +fn C.sapp_run(desc &Desc) i32 // HTML5: enable or disable the hardwired "Leave Site?" dialog box fn C.sapp_html5_ask_leave_site(ask bool) diff --git a/vlib/sokol/sapp/sapp_v.c.v b/vlib/sokol/sapp/sapp_v.c.v index c477d509b..77c9d0a25 100644 --- a/vlib/sokol/sapp/sapp_v.c.v +++ b/vlib/sokol/sapp/sapp_v.c.v @@ -6,7 +6,7 @@ import stbi #define SOKOL_VALIDATE_NON_FATAL 1 // v_sapp_gl_read_rgba_pixels reads pixles from the OpenGL buffer into `pixels`. -fn C.v_sapp_gl_read_rgba_pixels(x int, y int, width int, height int, pixels charptr) +fn C.v_sapp_gl_read_rgba_pixels(x i32, y i32, width i32, height i32, pixels charptr) // screenshot takes a screenshot of the current window and // saves it to `path`. The format is inferred from the extension diff --git a/vlib/sokol/sgl/sgl_funcs.c.v b/vlib/sokol/sgl/sgl_funcs.c.v index 256d6ceca..5a63f7d67 100644 --- a/vlib/sokol/sgl/sgl_funcs.c.v +++ b/vlib/sokol/sgl/sgl_funcs.c.v @@ -22,9 +22,9 @@ fn C.sgl_destroy_pipeline(pip C.sgl_pipeline) // render state functions fn C.sgl_defaults() -fn C.sgl_viewport(x int, y int, w int, h int, origin_top_left bool) +fn C.sgl_viewport(x i32, y i32, w i32, h i32, origin_top_left bool) fn C.sgl_viewportf(x f32, y f32, w f32, h f32, origin_top_left bool) -fn C.sgl_scissor_rect(x int, y int, w int, h int, origin_top_left bool) +fn C.sgl_scissor_rect(x i32, y i32, w i32, h i32, origin_top_left bool) fn C.sgl_scissor_rectf(x f32, y f32, w f32, h f32, origin_top_left bool) fn C.sgl_enable_texture() fn C.sgl_disable_texture() diff --git a/vlib/stbi/stbi.c.v b/vlib/stbi/stbi.c.v index 6df7cf4a8..477b6d273 100644 --- a/vlib/stbi/stbi.c.v +++ b/vlib/stbi/stbi.c.v @@ -54,11 +54,11 @@ pub mut: // Configuration functions // //----------------------------------------------------------------------------- -fn C.stbi_set_flip_vertically_on_load(should_flip int) -fn C.stbi_flip_vertically_on_write(flag int) -fn C.set_png_compression_level(level int) -fn C.write_force_png_filter(level int) -fn C.write_tga_with_rle(level int) +fn C.stbi_set_flip_vertically_on_load(should_flip i32) +fn C.stbi_flip_vertically_on_write(flag i32) +fn C.set_png_compression_level(level i32) +fn C.write_force_png_filter(level i32) +fn C.write_tga_with_rle(level i32) pub fn set_flip_vertically_on_load(val bool) { C.stbi_set_flip_vertically_on_load(val) @@ -109,9 +109,9 @@ pub fn (img &Image) free() { // Load functions // //----------------------------------------------------------------------------- -fn C.stbi_load(filename &char, x &int, y &int, channels_in_file &int, desired_channels int) &u8 -fn C.stbi_load_from_file(f voidptr, x &int, y &int, channels_in_file &int, desired_channels int) &u8 -fn C.stbi_load_from_memory(buffer &u8, len int, x &int, y &int, channels_in_file &int, desired_channels int) &u8 +fn C.stbi_load(filename &char, x &int, y &int, channels_in_file &int, desired_channels i32) &u8 +fn C.stbi_load_from_file(f voidptr, x &int, y &int, channels_in_file &int, desired_channels i32) &u8 +fn C.stbi_load_from_memory(buffer &u8, len i32, x &int, y &int, channels_in_file &int, desired_channels i32) &u8 @[params] pub struct LoadParams { @@ -170,8 +170,8 @@ pub fn load_from_memory(buf &u8, bufsize int, params LoadParams) !Image { // Resize functions // //----------------------------------------------------------------------------- -fn C.stbir_resize_uint8_linear(input_pixels &u8, input_w int, input_h int, input_stride_in_bytes int, output_pixels &u8, - output_w int, output_h int, output_stride_in_bytes int, num_channels int) int +fn C.stbir_resize_uint8_linear(input_pixels &u8, input_w i32, input_h i32, input_stride_in_bytes i32, output_pixels &u8, + output_w i32, output_h i32, output_stride_in_bytes i32, num_channels i32) i32 // resize_uint8 resizes `img` to dimensions of `output_w` and `output_h` pub fn resize_uint8(img &Image, output_w int, output_h int) !Image { @@ -201,10 +201,10 @@ pub fn resize_uint8(img &Image, output_w int, output_h int) !Image { // Write functions // //----------------------------------------------------------------------------- -fn C.stbi_write_png(filename &char, w int, h int, comp int, buffer &u8, stride_in_bytes int) int -fn C.stbi_write_bmp(filename &char, w int, h int, comp int, buffer &u8) int -fn C.stbi_write_tga(filename &char, w int, h int, comp int, buffer &u8) int -fn C.stbi_write_jpg(filename &char, w int, h int, comp int, buffer &u8, quality int) int +fn C.stbi_write_png(filename &char, w i32, h i32, comp i32, buffer &u8, stride_in_bytes i32) i32 +fn C.stbi_write_bmp(filename &char, w i32, h i32, comp i32, buffer &u8) i32 +fn C.stbi_write_tga(filename &char, w i32, h i32, comp i32, buffer &u8) i32 +fn C.stbi_write_jpg(filename &char, w i32, h i32, comp i32, buffer &u8, quality i32) i32 // fn C.stbi_write_hdr(filename &char, w int, h int, comp int, buffer &u8) int // buffer &u8 => buffer &f32 diff --git a/vlib/sync/stdatomic/1.declarations.c.v b/vlib/sync/stdatomic/1.declarations.c.v index 6950c3ba1..2ca41cc30 100644 --- a/vlib/sync/stdatomic/1.declarations.c.v +++ b/vlib/sync/stdatomic/1.declarations.c.v @@ -109,12 +109,12 @@ fn C.atomic_exchange_u64(voidptr, u64) u64 fn C.atomic_fetch_add_u64(voidptr, u64) u64 fn C.atomic_fetch_sub_u64(voidptr, u64) u64 -fn C.atomic_thread_fence(int) +fn C.atomic_thread_fence(i32) fn C.cpu_relax() fn C.ANNOTATE_RWLOCK_CREATE(voidptr) -fn C.ANNOTATE_RWLOCK_ACQUIRED(voidptr, int) -fn C.ANNOTATE_RWLOCK_RELEASED(voidptr, int) +fn C.ANNOTATE_RWLOCK_ACQUIRED(voidptr, i32) +fn C.ANNOTATE_RWLOCK_RELEASED(voidptr, i32) fn C.ANNOTATE_RWLOCK_DESTROY(voidptr) $if valgrind ? { diff --git a/vlib/sync/sync_darwin.c.v b/vlib/sync/sync_darwin.c.v index 05bcb59ad..1130249df 100644 --- a/vlib/sync/sync_darwin.c.v +++ b/vlib/sync/sync_darwin.c.v @@ -10,28 +10,28 @@ import time #include @[trusted] -fn C.pthread_mutex_init(voidptr, voidptr) int -fn C.pthread_mutex_lock(voidptr) int -fn C.pthread_mutex_trylock(voidptr) int -fn C.pthread_mutex_unlock(voidptr) int -fn C.pthread_mutex_destroy(voidptr) int -fn C.pthread_rwlockattr_init(voidptr) int -fn C.pthread_rwlockattr_setkind_np(voidptr, int) int -fn C.pthread_rwlock_init(voidptr, voidptr) int -fn C.pthread_rwlock_rdlock(voidptr) int -fn C.pthread_rwlock_wrlock(voidptr) int -fn C.pthread_rwlock_tryrdlock(voidptr) int -fn C.pthread_rwlock_trywrlock(voidptr) int -fn C.pthread_rwlock_unlock(voidptr) int -fn C.pthread_rwlock_destroy(voidptr) int -fn C.pthread_condattr_init(voidptr) int -fn C.pthread_condattr_setpshared(voidptr, int) int -fn C.pthread_condattr_destroy(voidptr) int -fn C.pthread_cond_init(voidptr, voidptr) int -fn C.pthread_cond_signal(voidptr) int -fn C.pthread_cond_wait(voidptr, voidptr) int -fn C.pthread_cond_timedwait(voidptr, voidptr, voidptr) int -fn C.pthread_cond_destroy(voidptr) int +fn C.pthread_mutex_init(voidptr, voidptr) i32 +fn C.pthread_mutex_lock(voidptr) i32 +fn C.pthread_mutex_trylock(voidptr) i32 +fn C.pthread_mutex_unlock(voidptr) i32 +fn C.pthread_mutex_destroy(voidptr) i32 +fn C.pthread_rwlockattr_init(voidptr) i32 +fn C.pthread_rwlockattr_setkind_np(voidptr, i32) i32 +fn C.pthread_rwlock_init(voidptr, voidptr) i32 +fn C.pthread_rwlock_rdlock(voidptr) i32 +fn C.pthread_rwlock_wrlock(voidptr) i32 +fn C.pthread_rwlock_tryrdlock(voidptr) i32 +fn C.pthread_rwlock_trywrlock(voidptr) i32 +fn C.pthread_rwlock_unlock(voidptr) i32 +fn C.pthread_rwlock_destroy(voidptr) i32 +fn C.pthread_condattr_init(voidptr) i32 +fn C.pthread_condattr_setpshared(voidptr, i32) i32 +fn C.pthread_condattr_destroy(voidptr) i32 +fn C.pthread_cond_init(voidptr, voidptr) i32 +fn C.pthread_cond_signal(voidptr) i32 +fn C.pthread_cond_wait(voidptr, voidptr) i32 +fn C.pthread_cond_timedwait(voidptr, voidptr, voidptr) i32 +fn C.pthread_cond_destroy(voidptr) i32 @[typedef] pub struct C.pthread_mutex_t {} diff --git a/vlib/sync/sync_default.c.v b/vlib/sync/sync_default.c.v index 1fab2f062..41473aa72 100644 --- a/vlib/sync/sync_default.c.v +++ b/vlib/sync/sync_default.c.v @@ -14,27 +14,27 @@ $if !android { #include @[trusted] -fn C.pthread_mutex_init(voidptr, voidptr) int -fn C.pthread_mutex_lock(voidptr) int -fn C.pthread_mutex_trylock(voidptr) int -fn C.pthread_mutex_unlock(voidptr) int -fn C.pthread_mutex_destroy(voidptr) int -fn C.pthread_rwlockattr_init(voidptr) int -fn C.pthread_rwlockattr_setkind_np(voidptr, int) int -fn C.pthread_rwlockattr_destroy(voidptr) int -fn C.pthread_rwlock_init(voidptr, voidptr) int -fn C.pthread_rwlock_rdlock(voidptr) int -fn C.pthread_rwlock_wrlock(voidptr) int -fn C.pthread_rwlock_tryrdlock(voidptr) int -fn C.pthread_rwlock_trywrlock(voidptr) int -fn C.pthread_rwlock_unlock(voidptr) int -fn C.pthread_rwlock_destroy(voidptr) int -fn C.sem_init(voidptr, int, u32) int -fn C.sem_post(voidptr) int -fn C.sem_wait(voidptr) int -fn C.sem_trywait(voidptr) int -fn C.sem_timedwait(voidptr, voidptr) int -fn C.sem_destroy(voidptr) int +fn C.pthread_mutex_init(voidptr, voidptr) i32 +fn C.pthread_mutex_lock(voidptr) i32 +fn C.pthread_mutex_trylock(voidptr) i32 +fn C.pthread_mutex_unlock(voidptr) i32 +fn C.pthread_mutex_destroy(voidptr) i32 +fn C.pthread_rwlockattr_init(voidptr) i32 +fn C.pthread_rwlockattr_setkind_np(voidptr, i32) i32 +fn C.pthread_rwlockattr_destroy(voidptr) i32 +fn C.pthread_rwlock_init(voidptr, voidptr) i32 +fn C.pthread_rwlock_rdlock(voidptr) i32 +fn C.pthread_rwlock_wrlock(voidptr) i32 +fn C.pthread_rwlock_tryrdlock(voidptr) i32 +fn C.pthread_rwlock_trywrlock(voidptr) i32 +fn C.pthread_rwlock_unlock(voidptr) i32 +fn C.pthread_rwlock_destroy(voidptr) i32 +fn C.sem_init(voidptr, i32, u32) i32 +fn C.sem_post(voidptr) i32 +fn C.sem_wait(voidptr) i32 +fn C.sem_trywait(voidptr) i32 +fn C.sem_timedwait(voidptr, voidptr) i32 +fn C.sem_destroy(voidptr) i32 @[typedef] pub struct C.pthread_mutex_t {} diff --git a/vlib/sync/sync_freebsd.c.v b/vlib/sync/sync_freebsd.c.v index 11c90aab4..4bddee59d 100644 --- a/vlib/sync/sync_freebsd.c.v +++ b/vlib/sync/sync_freebsd.c.v @@ -14,27 +14,27 @@ $if !android { #include @[trusted] -fn C.pthread_mutex_init(voidptr, voidptr) int -fn C.pthread_mutex_lock(voidptr) int -fn C.pthread_mutex_trylock(voidptr) int -fn C.pthread_mutex_unlock(voidptr) int -fn C.pthread_mutex_destroy(voidptr) int -fn C.pthread_rwlockattr_init(voidptr) int -fn C.pthread_rwlockattr_setkind_np(voidptr, int) int -fn C.pthread_rwlockattr_destroy(voidptr) int -fn C.pthread_rwlock_init(voidptr, voidptr) int -fn C.pthread_rwlock_rdlock(voidptr) int -fn C.pthread_rwlock_wrlock(voidptr) int -fn C.pthread_rwlock_tryrdlock(voidptr) int -fn C.pthread_rwlock_trywrlock(voidptr) int -fn C.pthread_rwlock_unlock(voidptr) int -fn C.pthread_rwlock_destroy(voidptr) int -fn C.sem_init(voidptr, int, u32) int -fn C.sem_post(voidptr) int -fn C.sem_wait(voidptr) int -fn C.sem_trywait(voidptr) int -fn C.sem_timedwait(voidptr, voidptr) int -fn C.sem_destroy(voidptr) int +fn C.pthread_mutex_init(voidptr, voidptr) i32 +fn C.pthread_mutex_lock(voidptr) i32 +fn C.pthread_mutex_trylock(voidptr) i32 +fn C.pthread_mutex_unlock(voidptr) i32 +fn C.pthread_mutex_destroy(voidptr) i32 +fn C.pthread_rwlockattr_init(voidptr) i32 +fn C.pthread_rwlockattr_setkind_np(voidptr, i32) i32 +fn C.pthread_rwlockattr_destroy(voidptr) i32 +fn C.pthread_rwlock_init(voidptr, voidptr) i32 +fn C.pthread_rwlock_rdlock(voidptr) i32 +fn C.pthread_rwlock_wrlock(voidptr) i32 +fn C.pthread_rwlock_tryrdlock(voidptr) i32 +fn C.pthread_rwlock_trywrlock(voidptr) i32 +fn C.pthread_rwlock_unlock(voidptr) i32 +fn C.pthread_rwlock_destroy(voidptr) i32 +fn C.sem_init(voidptr, i32, u32) i32 +fn C.sem_post(voidptr) i32 +fn C.sem_wait(voidptr) i32 +fn C.sem_trywait(voidptr) i32 +fn C.sem_timedwait(voidptr, voidptr) i32 +fn C.sem_destroy(voidptr) i32 pub struct C.pthread_mutex {} diff --git a/vlib/sync/sync_windows.c.v b/vlib/sync/sync_windows.c.v index 5e397f25c..0d32240ef 100644 --- a/vlib/sync/sync_windows.c.v +++ b/vlib/sync/sync_windows.c.v @@ -11,10 +11,10 @@ import time fn C.GetSystemTimeAsFileTime(lpSystemTimeAsFileTime &C._FILETIME) fn C.InitializeConditionVariable(voidptr) fn C.WakeConditionVariable(voidptr) -fn C.SleepConditionVariableSRW(voidptr, voidptr, u32, u32) int +fn C.SleepConditionVariableSRW(voidptr, voidptr, u32, u32) i32 -fn C.TryAcquireSRWLockExclusive(h voidptr) int -fn C.TryAcquireSRWLockShared(h voidptr) int +fn C.TryAcquireSRWLockExclusive(h voidptr) i32 +fn C.TryAcquireSRWLockShared(h voidptr) i32 // TODO: The suggestion of using CriticalSection instead of mutex // was discussed. Needs consideration. diff --git a/vlib/sync/tls_default.c.v b/vlib/sync/tls_default.c.v index da1ea0bd4..e5b3a548b 100644 --- a/vlib/sync/tls_default.c.v +++ b/vlib/sync/tls_default.c.v @@ -1,9 +1,9 @@ module sync // Pthread TLS API functions (via C interface) -fn C.pthread_key_create(key voidptr, voidptr) int -fn C.pthread_key_delete(key u64) int -fn C.pthread_setspecific(key u64, const_ptr voidptr) int +fn C.pthread_key_create(key voidptr, voidptr) i32 +fn C.pthread_key_delete(key u64) i32 +fn C.pthread_setspecific(key u64, const_ptr voidptr) i32 fn C.pthread_getspecific(key u64) voidptr // new_tls creates new TLS storage initialized with the given `value` diff --git a/vlib/term/term_nix.c.v b/vlib/term/term_nix.c.v index 4227b3e6c..dea8a9dd4 100644 --- a/vlib/term/term_nix.c.v +++ b/vlib/term/term_nix.c.v @@ -14,7 +14,7 @@ pub: ws_ypixel u16 } -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // get_terminal_size returns a number of columns and rows of terminal window. pub fn get_terminal_size() (int, int) { diff --git a/vlib/term/term_windows.c.v b/vlib/term/term_windows.c.v index e57177bd6..0501c1502 100644 --- a/vlib/term/term_windows.c.v +++ b/vlib/term/term_windows.c.v @@ -166,8 +166,8 @@ pub fn enable_echo(enable bool) { } fn C.kbhit() bool -fn C._getch() int -fn C._getche() int +fn C._getch() i32 +fn C._getche() i32 // KeyPressedParams contains the optional parameters that you can pass to key_pressed. @[params] diff --git a/vlib/term/termios/termios_android.c.v b/vlib/term/termios/termios_android.c.v index 417b400a3..cbd2e1b2a 100644 --- a/vlib/term/termios/termios_android.c.v +++ b/vlib/term/termios/termios_android.c.v @@ -31,11 +31,11 @@ mut: c_ospeed Speed } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/term/termios/termios_darwin.c.v b/vlib/term/termios/termios_darwin.c.v index ed53201c9..12fadfe87 100644 --- a/vlib/term/termios/termios_darwin.c.v +++ b/vlib/term/termios/termios_darwin.c.v @@ -30,11 +30,11 @@ mut: c_ospeed Speed } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/term/termios/termios_dragonfly.c.v b/vlib/term/termios/termios_dragonfly.c.v index 8d757e83d..a93c6171d 100644 --- a/vlib/term/termios/termios_dragonfly.c.v +++ b/vlib/term/termios/termios_dragonfly.c.v @@ -30,11 +30,11 @@ mut: c_ospeed Speed } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/term/termios/termios_freebsd.c.v b/vlib/term/termios/termios_freebsd.c.v index 0488036a9..9f2a72031 100644 --- a/vlib/term/termios/termios_freebsd.c.v +++ b/vlib/term/termios/termios_freebsd.c.v @@ -30,11 +30,11 @@ mut: c_ospeed Speed } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/term/termios/termios_linux.c.v b/vlib/term/termios/termios_linux.c.v index 417b400a3..cbd2e1b2a 100644 --- a/vlib/term/termios/termios_linux.c.v +++ b/vlib/term/termios/termios_linux.c.v @@ -31,11 +31,11 @@ mut: c_ospeed Speed } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/term/termios/termios_netbsd.c.v b/vlib/term/termios/termios_netbsd.c.v index 0488036a9..9f2a72031 100644 --- a/vlib/term/termios/termios_netbsd.c.v +++ b/vlib/term/termios/termios_netbsd.c.v @@ -30,11 +30,11 @@ mut: c_ospeed Speed } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/term/termios/termios_openbsd.c.v b/vlib/term/termios/termios_openbsd.c.v index e13750afb..185f5ecd3 100644 --- a/vlib/term/termios/termios_openbsd.c.v +++ b/vlib/term/termios/termios_openbsd.c.v @@ -30,11 +30,11 @@ mut: c_ospeed Speed } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/term/termios/termios_qnx.c.v b/vlib/term/termios/termios_qnx.c.v index fbb9c050d..376fb6951 100644 --- a/vlib/term/termios/termios_qnx.c.v +++ b/vlib/term/termios/termios_qnx.c.v @@ -31,11 +31,11 @@ mut: c_ospeed Speed } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/term/termios/termios_solaris.c.v b/vlib/term/termios/termios_solaris.c.v index 91084f115..cd20c7b98 100644 --- a/vlib/term/termios/termios_solaris.c.v +++ b/vlib/term/termios/termios_solaris.c.v @@ -28,11 +28,11 @@ mut: c_cc [cclen]Cc } -fn C.tcgetattr(fd int, termios_p &C.termios) int +fn C.tcgetattr(fd i32, termios_p &C.termios) i32 -fn C.tcsetattr(fd int, optional_actions int, const_termios_p &C.termios) int +fn C.tcsetattr(fd i32, optional_actions i32, const_termios_p &C.termios) i32 -fn C.ioctl(fd int, request u64, args ...voidptr) int +fn C.ioctl(fd i32, request u64, args ...voidptr) i32 // flag provides a termios flag of the correct size // for the underlying C.termios structure diff --git a/vlib/time/time_darwin.c.v b/vlib/time/time_darwin.c.v index 422c7d8eb..2ab33ae8b 100644 --- a/vlib/time/time_darwin.c.v +++ b/vlib/time/time_darwin.c.v @@ -17,7 +17,7 @@ fn C.mach_absolute_time() u64 fn C.mach_timebase_info(&C.mach_timebase_info_data_t) -fn C.clock_gettime_nsec_np(int) u64 +fn C.clock_gettime_nsec_np(i32) u64 struct InternalTimeBase { numer u32 = 1 diff --git a/vlib/time/time_nix.c.v b/vlib/time/time_nix.c.v index 82c7ecfbf..ee1ed4058 100644 --- a/vlib/time/time_nix.c.v +++ b/vlib/time/time_nix.c.v @@ -50,9 +50,9 @@ pub mut: } // the first arg is defined in include/bits/types.h as `__S32_TYPE`, which is `int` -fn C.clock_gettime(int, &C.timespec) int +fn C.clock_gettime(i32, &C.timespec) i32 -fn C.nanosleep(req &C.timespec, rem &C.timespec) int +fn C.nanosleep(req &C.timespec, rem &C.timespec) i32 // sys_mono_now returns a *monotonically increasing time*, NOT a time adjusted for daylight savings, location etc. pub fn sys_mono_now() u64 { diff --git a/vlib/time/time_windows.c.v b/vlib/time/time_windows.c.v index a43114a8c..8048c7b62 100644 --- a/vlib/time/time_windows.c.v +++ b/vlib/time/time_windows.c.v @@ -42,7 +42,7 @@ fn C.SystemTimeToTzSpecificLocalTime(lpTimeZoneInformation &C.TIME_ZONE_INFORMAT fn C.localtime_s(t &C.time_t, tm &C.tm) -fn C.timespec_get(t &C.timespec, base int) int +fn C.timespec_get(t &C.timespec, base i32) i32 // start_time and time_coefficients are needed on Windows because of potential overflows const start_time = init_win_time_start() diff --git a/vlib/v/gen/c/testdata/multiple_c_cources/sources.v b/vlib/v/gen/c/testdata/multiple_c_cources/sources.v index 64cdc84fc..92835b8df 100644 --- a/vlib/v/gen/c/testdata/multiple_c_cources/sources.v +++ b/vlib/v/gen/c/testdata/multiple_c_cources/sources.v @@ -5,8 +5,8 @@ module multiple_c_cources #include "@VMODROOT/common.h" -fn C.f1() int -fn C.f2() int +fn C.f1() i32 +fn C.f2() i32 pub fn call_c_functions() { println('start') diff --git a/vlib/v/slow_tests/keep_args_alive_test.c.v b/vlib/v/slow_tests/keep_args_alive_test.c.v index eeb064bba..7b16ec3e8 100644 --- a/vlib/v/slow_tests/keep_args_alive_test.c.v +++ b/vlib/v/slow_tests/keep_args_alive_test.c.v @@ -18,7 +18,7 @@ fn C.atomic_load_ptr(voidptr) voidptr fn C.atomic_store_ptr(voidptr, voidptr) @[keep_args_alive] -fn C.calc_expr_after_delay(voidptr, int, voidptr) int +fn C.calc_expr_after_delay(voidptr, i32, voidptr) i32 fn set_vals() voidptr { unsafe { diff --git a/vlib/v/tests/c_array_test.c.v b/vlib/v/tests/c_array_test.c.v index 19ca8b4f9..18a4258f1 100644 --- a/vlib/v/tests/c_array_test.c.v +++ b/vlib/v/tests/c_array_test.c.v @@ -2,9 +2,9 @@ import arrays #insert "@VEXEROOT/vlib/v/tests/c_array_test.c" -fn C.gen_c_array(size int) voidptr +fn C.gen_c_array(size i32) voidptr -fn C.gen_c_int_array(size int) voidptr +fn C.gen_c_int_array(size i32) voidptr fn test_carray_to_varray() { size := 10 diff --git a/vlib/v/tests/c_structs/cstruct_alias_test.v b/vlib/v/tests/c_structs/cstruct_alias_test.v index 17b7f3353..ea463ad7c 100644 --- a/vlib/v/tests/c_structs/cstruct_alias_test.v +++ b/vlib/v/tests/c_structs/cstruct_alias_test.v @@ -8,7 +8,7 @@ pub type Camera3D = C.Camera3D pub type Camera = C.Camera3D // Update camera position for selected mode -pub fn C.UpdateCamera(camera &Camera, mode int) +pub fn C.UpdateCamera(camera &Camera, mode i32) enum CameraMode { camera_free diff --git a/vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v b/vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v index 182568abf..2413818e9 100644 --- a/vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v +++ b/vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v @@ -5,7 +5,7 @@ #flag -I@VMODROOT/includes #include "myinclude.h" -fn C.add(int, int) int +fn C.add(i32, i32) i32 // Tests that VROOT works no matter the current folder #flag -I @VEXEROOT/thirdparty/stb_image diff --git a/vlib/v/tests/fns/fn_test.c.v b/vlib/v/tests/fns/fn_test.c.v index 0a66a4c79..8362a81ee 100644 --- a/vlib/v/tests/fns/fn_test.c.v +++ b/vlib/v/tests/fns/fn_test.c.v @@ -51,11 +51,11 @@ interface MyInterface {} type F9 = fn (MyInterface) -fn C.atoi(&u8) int +fn C.atoi(&u8) i32 fn C.freec(ptr voidptr) @[trusted] -fn C.exitc(code int) +fn C.exitc(code i32) // above checks attribute doesn't conflict with `freec` return type diff --git a/vlib/v/tests/interop_test.c.v b/vlib/v/tests/interop_test.c.v index f2e6f421e..719293f4b 100644 --- a/vlib/v/tests/interop_test.c.v +++ b/vlib/v/tests/interop_test.c.v @@ -3,7 +3,7 @@ struct Foo {} -fn C.a(a string, b int) f32 +fn C.a(a string, b i32) f32 fn C.b(a &voidptr) fn C.c(a string, b ...string) string fn C.d(a ...int) diff --git a/vlib/v/tests/project_with_c_code/main.v b/vlib/v/tests/project_with_c_code/main.v index e006b4da9..90a70744f 100644 --- a/vlib/v/tests/project_with_c_code/main.v +++ b/vlib/v/tests/project_with_c_code/main.v @@ -4,7 +4,7 @@ import v.tests.project_with_c_code.mod1 #include "@DIR/relative.h" -fn C.abc() int +fn C.abc() i32 fn main() { res := mod1.vadd(1, 2) diff --git a/vlib/v/tests/project_with_c_code/main1_test.v b/vlib/v/tests/project_with_c_code/main1_test.v index d7c63d0ba..797e2b122 100644 --- a/vlib/v/tests/project_with_c_code/main1_test.v +++ b/vlib/v/tests/project_with_c_code/main1_test.v @@ -3,7 +3,7 @@ import v.tests.project_with_c_code.mod1 #include "@DIR/relative.h" -fn C.abc() int +fn C.abc() i32 fn test_using_c_code_in_the_same_module_works() { assert 1003 == mod1.vadd(1, 2) diff --git a/vlib/v/tests/project_with_c_code/mod1/wrapper.c.v b/vlib/v/tests/project_with_c_code/mod1/wrapper.c.v index db787d39d..a5aeba199 100644 --- a/vlib/v/tests/project_with_c_code/mod1/wrapper.c.v +++ b/vlib/v/tests/project_with_c_code/mod1/wrapper.c.v @@ -9,7 +9,7 @@ pub struct C.MyStruct { UppercaseField int } -fn C.cadd(int, int) int +fn C.cadd(i32, i32) i32 pub fn vadd(a int, b int) int { x := C.MyStruct{100} diff --git a/vlib/v/tests/project_with_c_code_2/modc/wrapper.c.v b/vlib/v/tests/project_with_c_code_2/modc/wrapper.c.v index 1eb338e3d..465d4cb45 100644 --- a/vlib/v/tests/project_with_c_code_2/modc/wrapper.c.v +++ b/vlib/v/tests/project_with_c_code_2/modc/wrapper.c.v @@ -19,17 +19,17 @@ pub mut: p &C.Atype } -fn C.new_atype(int) voidptr +fn C.new_atype(i32) voidptr @[trusted] -fn C.handle_array(voidptr, int) +fn C.handle_array(voidptr, i32) fn todo_remove_me() { // TODO: remove this dummy function, when the vfmt bug of @[trusted] after a void C function is fixed } @[trusted] -fn C.handle_array2(voidptr, int) +fn C.handle_array2(voidptr, i32) fn C.destroy_atype(voidptr) diff --git a/vlib/v/tests/project_with_cpp_code/compiling_cpp_files_with_a_cplusplus_compiler_test.c.v b/vlib/v/tests/project_with_cpp_code/compiling_cpp_files_with_a_cplusplus_compiler_test.c.v index 69b846908..4bbba1fb4 100644 --- a/vlib/v/tests/project_with_cpp_code/compiling_cpp_files_with_a_cplusplus_compiler_test.c.v +++ b/vlib/v/tests/project_with_cpp_code/compiling_cpp_files_with_a_cplusplus_compiler_test.c.v @@ -4,7 +4,7 @@ module main #flag @VMODROOT/implementation.o #include "@VMODROOT/implementation.h" -fn C.sizeof_char() int +fn C.sizeof_char() i32 fn test_the_implementation_object_file_was_compiled_with_a_c_plus_plus_compiler() { res := C.sizeof_char() diff --git a/vlib/v/trace_calls/tracing_calls_nix.c.v b/vlib/v/trace_calls/tracing_calls_nix.c.v index 58b311d2f..9f1355eca 100644 --- a/vlib/v/trace_calls/tracing_calls_nix.c.v +++ b/vlib/v/trace_calls/tracing_calls_nix.c.v @@ -7,5 +7,5 @@ pub mut: } fn C.gettid() u32 -fn C.clock_gettime(int, &C.timespec) int +fn C.clock_gettime(i32, &C.timespec) i32 fn C.pthread_self() u64 diff --git a/vlib/veb/sendfile_freebsd.c.v b/vlib/veb/sendfile_freebsd.c.v index fb221a00e..107661a3b 100644 --- a/vlib/veb/sendfile_freebsd.c.v +++ b/vlib/veb/sendfile_freebsd.c.v @@ -1,6 +1,6 @@ module veb -fn C.sendfile(in_fd int, out_fd int, offset int, count int, voidptr offsetp, voidptr hdr, flags int) int +fn C.sendfile(in_fd i32, out_fd i32, offset i32, count i32, voidptr offsetp, voidptr hdr, flags i32) i32 fn sendfile(out_fd int, in_fd int, nr_bytes int) int { // out_fd must be a stream socket descriptor. diff --git a/vlib/veb/sendfile_linux.c.v b/vlib/veb/sendfile_linux.c.v index 3eb3a6a0a..df68c38b3 100644 --- a/vlib/veb/sendfile_linux.c.v +++ b/vlib/veb/sendfile_linux.c.v @@ -2,7 +2,7 @@ module veb #include -fn C.sendfile(out_fd int, in_fd int, offset voidptr, count int) int +fn C.sendfile(out_fd i32, in_fd i32, offset voidptr, count i32) i32 fn sendfile(out_fd int, in_fd int, nr_bytes int) int { // always pass nil as offset, so the file offset will be used and updated. diff --git a/vlib/x/crypto/slhdsa/slhdsa.c.v b/vlib/x/crypto/slhdsa/slhdsa.c.v index fe063254e..ffc344b1e 100644 --- a/vlib/x/crypto/slhdsa/slhdsa.c.v +++ b/vlib/x/crypto/slhdsa/slhdsa.c.v @@ -35,31 +35,31 @@ struct C.EVP_PKEY {} fn C.EVP_PKEY_new() &C.EVP_PKEY fn C.EVP_PKEY_Q_keygen(ctx voidptr, propq &char, tipe &char) &C.EVP_PKEY -fn C.EVP_PKEY_is_a(pkey &C.EVP_PKEY, name &char) int -fn C.EVP_PKEY_size(key &C.EVP_PKEY) int +fn C.EVP_PKEY_is_a(pkey &C.EVP_PKEY, name &char) i32 +fn C.EVP_PKEY_size(key &C.EVP_PKEY) i32 fn C.EVP_PKEY_dup(key &C.EVP_PKEY) &C.EVP_PKEY fn C.EVP_PKEY_free(key &C.EVP_PKEY) -fn C.EVP_PKEY_get_octet_string_param(pkey &C.EVP_PKEY, key_name &char, buf &u8, max_buf_sz int, out_len &usize) int -fn C.EVP_PKEY_print_private(out &C.BIO, pkey &C.EVP_PKEY, indent int, pctx voidptr) int -fn C.EVP_PKEY_print_public(out &C.BIO, pkey &C.EVP_PKEY, indent int, pctx voidptr) int -fn C.EVP_PKEY_keygen_init(ctx &C.EVP_PKEY_CTX) int // 1 success -fn C.EVP_PKEY_keygen(ctx &C.EVP_PKEY_CTX, ppkey &&C.EVP_PKEY) int -fn C.EVP_PKEY_CTX_set_params(ctx &C.EVP_PKEY_CTX, params &C.OSSL_PARAM) int +fn C.EVP_PKEY_get_octet_string_param(pkey &C.EVP_PKEY, key_name &char, buf &u8, max_buf_sz i32, out_len &usize) i32 +fn C.EVP_PKEY_print_private(out &C.BIO, pkey &C.EVP_PKEY, indent i32, pctx voidptr) i32 +fn C.EVP_PKEY_print_public(out &C.BIO, pkey &C.EVP_PKEY, indent i32, pctx voidptr) i32 +fn C.EVP_PKEY_keygen_init(ctx &C.EVP_PKEY_CTX) i32 // 1 success +fn C.EVP_PKEY_keygen(ctx &C.EVP_PKEY_CTX, ppkey &&C.EVP_PKEY) i32 +fn C.EVP_PKEY_CTX_set_params(ctx &C.EVP_PKEY_CTX, params &C.OSSL_PARAM) i32 fn C.EVP_PKEY_get0_type_name(key &C.EVP_PKEY) &char fn C.EVP_PKEY_get0_description(key &C.EVP_PKEY) &char -fn C.EVP_PKEY_get_bits(pkey &C.EVP_PKEY) int -fn C.EVP_PKEY_get_security_bits(pkey &C.EVP_PKEY) int -fn C.EVP_PKEY_sign_init_ex(ctx &C.EVP_PKEY_CTX, params &C.OSSL_PARAM) int -fn C.EVP_PKEY_sign_message_init(ctx &C.EVP_PKEY_CTX, algo &C.EVP_SIGNATURE, params &C.OSSL_PARAM) int -fn C.EVP_PKEY_sign(ctx &C.EVP_PKEY_CTX, sig &char, siglen &usize, tbs &char, tbslen int) int -fn C.EVP_PKEY_verify_message_init(ctx &C.EVP_PKEY_CTX, algo &C.EVP_SIGNATURE, params &C.OSSL_PARAM) int -fn C.EVP_PKEY_verify(ctx &C.EVP_PKEY_CTX, sig &char, siglen &int, tbs &char, tbslen int) int -fn C.EVP_PKEY_set_octet_string_param(key &C.EVP_PKEY, key_name &u8, buf &u8, bsize int) int -fn C.EVP_PKEY_fromdata_init(ctx &C.EVP_PKEY_CTX) int -fn C.EVP_PKEY_fromdata(ctx &C.EVP_PKEY_CTX, ppkey &&C.EVP_PKEY, selection int, params &C.OSSL_PARAM) int -fn C.EVP_PKEY_check(ctx &C.EVP_PKEY_CTX) int -fn C.EVP_PKEY_private_check(ctx &C.EVP_PKEY_CTX) int -fn C.EVP_PKEY_public_check(ctx &C.EVP_PKEY_CTX) int +fn C.EVP_PKEY_get_bits(pkey &C.EVP_PKEY) i32 +fn C.EVP_PKEY_get_security_bits(pkey &C.EVP_PKEY) i32 +fn C.EVP_PKEY_sign_init_ex(ctx &C.EVP_PKEY_CTX, params &C.OSSL_PARAM) i32 +fn C.EVP_PKEY_sign_message_init(ctx &C.EVP_PKEY_CTX, algo &C.EVP_SIGNATURE, params &C.OSSL_PARAM) i32 +fn C.EVP_PKEY_sign(ctx &C.EVP_PKEY_CTX, sig &char, siglen &usize, tbs &char, tbslen i32) i32 +fn C.EVP_PKEY_verify_message_init(ctx &C.EVP_PKEY_CTX, algo &C.EVP_SIGNATURE, params &C.OSSL_PARAM) i32 +fn C.EVP_PKEY_verify(ctx &C.EVP_PKEY_CTX, sig &char, siglen &int, tbs &char, tbslen i32) i32 +fn C.EVP_PKEY_set_octet_string_param(key &C.EVP_PKEY, key_name &u8, buf &u8, bsize i32) i32 +fn C.EVP_PKEY_fromdata_init(ctx &C.EVP_PKEY_CTX) i32 +fn C.EVP_PKEY_fromdata(ctx &C.EVP_PKEY_CTX, ppkey &&C.EVP_PKEY, selection i32, params &C.OSSL_PARAM) i32 +fn C.EVP_PKEY_check(ctx &C.EVP_PKEY_CTX) i32 +fn C.EVP_PKEY_private_check(ctx &C.EVP_PKEY_CTX) i32 +fn C.EVP_PKEY_public_check(ctx &C.EVP_PKEY_CTX) i32 @[typedef] struct C.EVP_PKEY_CTX {} @@ -86,8 +86,8 @@ struct C.OSSL_PARAM_BLD {} fn C.OSSL_PARAM_free(params &C.OSSL_PARAM) fn C.OSSL_PARAM_BLD_free(param_bld &C.OSSL_PARAM_BLD) fn C.OSSL_PARAM_BLD_new() &C.OSSL_PARAM_BLD -fn C.OSSL_PARAM_BLD_push_int(bld &C.OSSL_PARAM_BLD, key &u8, val int) int -fn C.OSSL_PARAM_BLD_push_octet_string(bld &C.OSSL_PARAM_BLD, key &u8, buf voidptr, bsize int) int +fn C.OSSL_PARAM_BLD_push_int(bld &C.OSSL_PARAM_BLD, key &u8, val i32) i32 +fn C.OSSL_PARAM_BLD_push_octet_string(bld &C.OSSL_PARAM_BLD, key &u8, buf voidptr, bsize i32) i32 fn C.OSSL_PARAM_BLD_to_param(bld &C.OSSL_PARAM_BLD) &C.OSSL_PARAM @[typedef] @@ -97,6 +97,6 @@ struct C.BIO_METHOD {} struct C.BIO {} fn C.BIO_new(t &C.BIO_METHOD) &C.BIO -fn C.BIO_read_ex(b &C.BIO, data voidptr, dlen int, readbytes &usize) int +fn C.BIO_read_ex(b &C.BIO, data voidptr, dlen i32, readbytes &usize) i32 fn C.BIO_free_all(a &C.BIO) fn C.BIO_s_mem() &C.BIO_METHOD -- 2.39.5