Skip to content

Commit dc24df9

Browse files
committed
cbuilder: change order of functions to improve readability
1 parent 6e4dc82 commit dc24df9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

vlib/v/builder/cbuilder/cbuilder.v

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ pub fn compile_c(mut b builder.Builder) {
3636
}
3737
}
3838

39+
pub fn build_c(mut b builder.Builder, v_files []string, out_file string) {
40+
b.out_name_c = out_file
41+
b.pref.out_name_c = os.real_path(out_file)
42+
b.info('build_c(${out_file})')
43+
output2 := gen_c(mut b, v_files)
44+
os.write_file(out_file, output2) or { panic(err) }
45+
if b.pref.is_stats {
46+
b.stats_lines = output2.count('\n') + 1
47+
b.stats_bytes = output2.len
48+
}
49+
}
50+
3951
pub fn gen_c(mut b builder.Builder, v_files []string) string {
4052
b.front_and_middle_stages(v_files) or {
4153
if err.code() > 7000 {
@@ -56,15 +68,3 @@ pub fn gen_c(mut b builder.Builder, v_files []string) string {
5668

5769
return res
5870
}
59-
60-
pub fn build_c(mut b builder.Builder, v_files []string, out_file string) {
61-
b.out_name_c = out_file
62-
b.pref.out_name_c = os.real_path(out_file)
63-
b.info('build_c(${out_file})')
64-
output2 := gen_c(mut b, v_files)
65-
os.write_file(out_file, output2) or { panic(err) }
66-
if b.pref.is_stats {
67-
b.stats_lines = output2.count('\n') + 1
68-
b.stats_bytes = output2.len
69-
}
70-
}

0 commit comments

Comments
 (0)