Skip to content

Commit

Permalink
Merge branch 'master' into fix_wasm_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman authored Oct 9, 2023
2 parents e892efb + 169a6b5 commit 2d84a9d
Show file tree
Hide file tree
Showing 25 changed files with 540 additions and 535 deletions.
4 changes: 2 additions & 2 deletions cmd/tools/repeat.v
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ fn new_aints(ovals []int, extreme_mins int, extreme_maxs int) Aints {
nmaxs: extreme_maxs
}
mut sum := i64(0)
mut imin := math.max_i32
mut imax := -math.max_i32
mut imin := int(math.max_i32)
mut imax := int(-math.max_i32)
// discard the extremes:
mut vals := []int{}
for x in ovals {
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/ast/types.v
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ pub const (
signed_integer_type_idxs = [char_type_idx, i8_type_idx, i16_type_idx, int_type_idx,
i64_type_idx, i32_type_idx, isize_type_idx]
unsigned_integer_type_idxs = [u8_type_idx, u16_type_idx, u32_type_idx, u64_type_idx,
usize_type_idx, i32_type_idx]
usize_type_idx]
// C will promote any type smaller than int to int in an expression
int_promoted_type_idxs = [char_type_idx, i8_type_idx, i16_type_idx, u8_type_idx, u16_type_idx]
float_type_idxs = [f32_type_idx, f64_type_idx, float_literal_type_idx]
Expand Down
4 changes: 3 additions & 1 deletion vlib/v/builder/nativebuilder/nativebuilder.v
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ pub fn build_native(mut b builder.Builder, v_files []string, out_file string) {
eprintln('Error: Only arm64 and amd64 are supported by V')
}
}
b.stats_lines, b.stats_bytes = native.gen(b.parsed_files, b.table, out_file, b.pref)
stats_lines, stats_bytes := native.gen(b.parsed_files, b.table, out_file, b.pref)
b.stats_lines = int(stats_lines)
b.stats_bytes = int(stats_bytes)
util.timing_measure('Native GEN')
}
6 changes: 3 additions & 3 deletions vlib/v/checker/tests/compare_unsigned_signed.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ vlib/v/checker/tests/compare_unsigned_signed.vv:2:14: error: unsigned integer ca
4 | }
vlib/v/checker/tests/compare_unsigned_signed.vv:6:5: error: unsigned integer cannot be compared with negative value
4 | }
5 |
5 |
6 | if -1 > u32(1) {
| ~~
7 | println('unexpected')
Expand All @@ -23,10 +23,10 @@ vlib/v/checker/tests/compare_unsigned_signed.vv:11:6: error: negative value cann
10 | _ = u8(-1) == -1 // false!
11 | _ = -1 == u16(-1) // false!
| ~~
12 |
12 |
13 | // smaller unsigned == signed, OK
vlib/v/checker/tests/compare_unsigned_signed.vv:18:12: error: `i8` cannot be compared with `u16`
16 |
16 |
17 | // smaller signed == unsigned, NG
18 | _ = i8(0) == u16(0)
| ~~
Expand Down
4 changes: 2 additions & 2 deletions vlib/v/checker/tests/compare_unsigned_signed.vv
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ fn main() {
// unsigned == literal
_ = u8(-1) == -1 // false!
_ = -1 == u16(-1) // false!

// smaller unsigned == signed, OK
_ = u16(-1) == int(-1)
_ = int(-1) != u8(-1)

// smaller signed == unsigned, NG
_ = i8(0) == u16(0)
_ = i16(0) != u32(0)
Expand Down
Loading

0 comments on commit 2d84a9d

Please sign in to comment.