mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
ci: fix union field warnings in clipboard
module
This commit is contained in:
parent
d645e45752
commit
7545ed4121
2 changed files with 15 additions and 16 deletions
|
@ -3,9 +3,7 @@ module clipboard
|
|||
#include <libkern/OSAtomic.h>
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#flag -framework Cocoa
|
||||
|
||||
#include "@VROOT/vlib/clipboard/clipboard_darwin.m"
|
||||
|
||||
pub struct Clipboard {
|
||||
pb voidptr
|
||||
last_cb_serial i64
|
||||
|
@ -14,12 +12,14 @@ mut:
|
|||
}
|
||||
|
||||
fn C.darwin_new_pasteboard() voidptr
|
||||
|
||||
fn C.darwin_get_pasteboard_text(voidptr) byteptr
|
||||
|
||||
fn C.darwin_set_pasteboard_text(string) bool
|
||||
|
||||
fn new_clipboard() &Clipboard {
|
||||
cb := &Clipboard{
|
||||
pb: C.darwin_new_pasteboard()// pb
|
||||
pb: C.darwin_new_pasteboard() // pb
|
||||
}
|
||||
return cb
|
||||
}
|
||||
|
@ -58,9 +58,8 @@ fn (mut cb Clipboard) get_text() string {
|
|||
if isnil(cb.pb) {
|
||||
return ''
|
||||
}
|
||||
|
||||
utf8_clip := C.darwin_get_pasteboard_text(cb.pb)
|
||||
return unsafe {utf8_clip.vstring()}
|
||||
return unsafe { utf8_clip.vstring() }
|
||||
}
|
||||
|
||||
pub fn new_primary() &Clipboard {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue