Skip to content

Commit c655847

Browse files
committed
native: fix notices when building cmd/tools/builders/native_builder.v
1 parent b584e1d commit c655847

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

vlib/v/eval/expr.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ fn (e Eval) type_to_size(typ ast.Type) u64 {
561561
}
562562
else {
563563
e.error('type_to_size(): unknown type: ${e.table.sym(typ).str()}')
564-
return -1
564+
return u64(-1)
565565
}
566566
}
567567
}

vlib/v/gen/native/amd64.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ pub fn (mut g Gen) call_fn_amd64(node ast.CallExpr) {
16871687
1...8 {
16881688
g.mov_deref(.rax, .rax, ast.i64_type_idx)
16891689
if args_size[i] != 8 {
1690-
g.movabs(.rdx, (i64(1) << (args_size[i] * 8)) - 1)
1690+
g.movabs(.rdx, i64((u64(1) << (args_size[i] * 8)) - 1))
16911691
g.bitand_reg(.rax, .rdx)
16921692
}
16931693
}
@@ -1697,7 +1697,7 @@ pub fn (mut g Gen) call_fn_amd64(node ast.CallExpr) {
16971697
g.sub(.rax, 8)
16981698
g.mov_deref(.rax, .rax, ast.i64_type_idx)
16991699
if args_size[i] != 16 {
1700-
g.movabs(.rbx, (i64(1) << ((args_size[i] - 8) * 8)) - 1)
1700+
g.movabs(.rbx, i64((u64(1) << ((args_size[i] - 8) * 8)) - 1))
17011701
g.bitand_reg(.rdx, .rbx)
17021702
}
17031703
}
@@ -1737,7 +1737,7 @@ pub fn (mut g Gen) call_fn_amd64(node ast.CallExpr) {
17371737
match return_size {
17381738
1...7 {
17391739
g.mov_var_to_reg(.rdx, LocalVar{ offset: return_pos, typ: ast.i64_type_idx })
1740-
g.movabs(.rcx, 0xffffffffffffffff - (i64(1) << (return_size * 8)) + 1)
1740+
g.movabs(.rcx, i64(0xffffffffffffffff - (u64(1) << (return_size * 8)) + 1))
17411741
g.bitand_reg(.rdx, .rcx)
17421742
g.bitor_reg(.rdx, .rax)
17431743
g.mov_reg_to_var(LocalVar{ offset: return_pos, typ: ast.i64_type_idx },
@@ -1754,7 +1754,7 @@ pub fn (mut g Gen) call_fn_amd64(node ast.CallExpr) {
17541754

17551755
offset: 8
17561756
)
1757-
g.movabs(.rcx, 0xffffffffffffffff - (i64(1) << (return_size * 8)) + 1)
1757+
g.movabs(.rcx, i64(0xffffffffffffffff - (u64(1) << (return_size * 8)) + 1))
17581758
g.bitand_reg(.rax, .rcx)
17591759
g.bitor_reg(.rax, .rdx)
17601760
g.mov_reg_to_var(LocalVar{ offset: return_pos, typ: ast.i64_type_idx },

vlib/v/gen/native/gen.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ fn (mut g Gen) stmt(node ast.Stmt) {
11571157
if size <= 8 {
11581158
g.mov_deref(.rax, .rax, ast.i64_type_idx)
11591159
if size != 8 {
1160-
g.movabs(.rbx, (i64(1) << (size * 8)) - 1)
1160+
g.movabs(.rbx, i64((u64(1) << (size * 8)) - 1))
11611161
g.bitand_reg(.rax, .rbx)
11621162
}
11631163
} else if size <= 16 {
@@ -1166,7 +1166,7 @@ fn (mut g Gen) stmt(node ast.Stmt) {
11661166
g.sub(.rax, 8)
11671167
g.mov_deref(.rax, .rax, ast.i64_type_idx)
11681168
if size != 16 {
1169-
g.movabs(.rbx, (i64(1) << ((size - 8) * 8)) - 1)
1169+
g.movabs(.rbx, i64((u64(1) << ((size - 8) * 8)) - 1))
11701170
g.bitand_reg(.rdx, .rbx)
11711171
}
11721172
} else {

0 commit comments

Comments
 (0)