mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
native: replace abs() with mathutils.abs() (#18568)
This commit is contained in:
parent
a67342d05b
commit
7a9c885b31
@ -451,10 +451,6 @@ fn (mut c Amd64) cset(op Amd64SetOp) {
|
||||
c.g.println('set${op} al')
|
||||
}
|
||||
|
||||
fn abs(a i64) i64 {
|
||||
return if a < 0 { -a } else { a }
|
||||
}
|
||||
|
||||
fn (mut c Amd64) tmp_jle(addr i64) {
|
||||
// Calculate the relative offset to jump to
|
||||
// (`addr` is absolute address)
|
||||
|
@ -590,7 +590,7 @@ fn (mut g Gen) write_string_with_padding(s string, max int) {
|
||||
}
|
||||
|
||||
fn (g &Gen) abs_to_rel_addr(addr i64) int {
|
||||
return int(abs(addr - g.buf.len)) - 1
|
||||
return int(mu.abs(addr - g.buf.len)) - 1
|
||||
}
|
||||
|
||||
fn (mut g Gen) try_var_offset(var_name string) int {
|
||||
|
Loading…
Reference in New Issue
Block a user