File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ const (
35
35
'vlib/v/tests/interop_test.v' , /* bad comment formatting */
36
36
'vlib/v/tests/string_interpolation_test.v' /* TODO byteptr: &byte.str() behaves differently than byteptr.str() */ ,
37
37
'vlib/v/gen/js/tests/js.v' , /* local `hello` fn, gets replaced with module `hello` aliased as `hl` */
38
- 'examples/c_interop_wkhtmltopdf.v' /* &charptr --> &&char */ ,
39
38
]
40
39
vfmt_verify_list = [
41
40
'cmd/' ,
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ fn main() {
53
53
// init
54
54
init := C.wkhtmltopdf_init (0 )
55
55
println ('wkhtmltopdf_init: $init ' )
56
- version := int ( C.wkhtmltopdf_version ())
56
+ version := unsafe { cstring_to_vstring ( & char ( C.wkhtmltopdf_version ())) }
57
57
println ('wkhtmltopdf_version: $version ' )
58
58
global_settings := C.wkhtmltopdf_create_global_settings ()
59
59
println ('wkhtmltopdf_create_global_settings: ${voidptr(global_settings)} ' )
@@ -71,14 +71,15 @@ fn main() {
71
71
error_code := C.wkhtmltopdf_http_error_code (converter)
72
72
println ('wkhtmltopdf_http_error_code: $error_code ' )
73
73
if result {
74
- data := & charptr (0 )
75
- size := C.wkhtmltopdf_get_output (converter, data)
74
+ pdata := & char (0 )
75
+ ppdata := & pdata
76
+ size := C.wkhtmltopdf_get_output (converter, voidptr (ppdata))
76
77
println ('wkhtmltopdf_get_output: $size bytes' )
77
78
mut file := os.open_file ('./google.pdf' , 'w+' , 0o666 ) or {
78
79
println ('ERR: $err ' )
79
80
return
80
81
}
81
- wrote := unsafe { file.write_ptr (data , size) }
82
+ wrote := unsafe { file.write_ptr (pdata , size) }
82
83
println ('write_bytes: $wrote [./google.pdf]' )
83
84
file.flush ()
84
85
file.close ()
You can’t perform that action at this time.
0 commit comments