1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

picoev: add initial values for struct field callbacks, to fix new compiler notices (#19065)

Missing initial value for struct values
This commit is contained in:
jhuntos 2023-08-06 06:09:16 +02:00 committed by GitHub
parent b9a523cefd
commit 7ca23f6316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ pub mut:
fd int fd int
loop_id int = -1 loop_id int = -1
events u32 events u32
cb fn (int, int, voidptr) cb fn (int, int, voidptr) = unsafe { nil }
// used internally by the kqueue implementation // used internally by the kqueue implementation
backend int backend int
} }
@ -31,7 +31,7 @@ pub mut:
pub struct Config { pub struct Config {
pub: pub:
port int = 8080 port int = 8080
cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response) cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response) = unsafe { nil }
err_cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response, IError) = default_err_cb err_cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response, IError) = default_err_cb
user_data voidptr = unsafe { nil } user_data voidptr = unsafe { nil }
timeout_secs int = 8 timeout_secs int = 8
@ -42,7 +42,7 @@ pub:
[heap] [heap]
pub struct Picoev { pub struct Picoev {
cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response) cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response) = unsafe { nil }
err_cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response, IError) = default_err_cb err_cb fn (voidptr, picohttpparser.Request, mut picohttpparser.Response, IError) = default_err_cb
user_data voidptr = unsafe { nil } user_data voidptr = unsafe { nil }