mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
C backend: fix a couple of C warnings on Linux
This commit is contained in:
parent
243626c7c1
commit
2ac80485c0
@ -18,8 +18,6 @@ pub:
|
|||||||
|
|
||||||
// Private function, used by V (`nums := []int`)
|
// Private function, used by V (`nums := []int`)
|
||||||
fn new_array(mylen, cap, elm_size int) array {
|
fn new_array(mylen, cap, elm_size int) array {
|
||||||
a := 3
|
|
||||||
_ = a
|
|
||||||
//println(a)
|
//println(a)
|
||||||
arr := array {
|
arr := array {
|
||||||
len: mylen
|
len: mylen
|
||||||
|
@ -38,7 +38,7 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) {
|
|||||||
if C.backtrace_symbols_fd != 0 {
|
if C.backtrace_symbols_fd != 0 {
|
||||||
buffer := [100]byteptr
|
buffer := [100]byteptr
|
||||||
nr_ptrs := C.backtrace(*voidptr(buffer), 100)
|
nr_ptrs := C.backtrace(*voidptr(buffer), 100)
|
||||||
C.backtrace_symbols_fd(&buffer[skipframes], nr_ptrs-skipframes, 1)
|
C.backtrace_symbols_fd(*voidptr(&buffer[skipframes]), nr_ptrs-skipframes, 1)
|
||||||
return
|
return
|
||||||
}else{
|
}else{
|
||||||
C.printf('backtrace_symbols_fd is missing, so printing backtraces is not available.\n')
|
C.printf('backtrace_symbols_fd is missing, so printing backtraces is not available.\n')
|
||||||
|
@ -179,7 +179,7 @@ pub fn (n i64) hex() string {
|
|||||||
19
|
19
|
||||||
}
|
}
|
||||||
hex := malloc(len)
|
hex := malloc(len)
|
||||||
count := int(C.sprintf(*char(hex), '0x%llx', n))
|
count := int(C.sprintf(*char(hex), '0x%lx', n))
|
||||||
return tos(hex, count)
|
return tos(hex, count)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user