Skip to content

Commit d4290f0

Browse files
committed
all: vfmt after recent changes
1 parent 8a7c017 commit d4290f0

6 files changed

Lines changed: 11 additions & 27 deletions

File tree

cmd/tools/vdoc/document/doc.v

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,11 @@ pub fn (mut d Doc) file_asts(mut file_asts []ast.File) ! {
506506
fname_has_set = true
507507
}
508508
if d.with_head && i == 0 {
509-
mut module_name := file_ast.mod.name
510-
// if module_name != 'main' && d.parent_mod_name.len > 0 {
511-
// module_name = d.parent_mod_name + '.' + module_name
512-
// }
509+
mut module_name := if d.parent_mod_name.len > 0 && file_ast.mod.short_name != 'main' {
510+
d.parent_mod_name + '.' + file_ast.mod.short_name
511+
} else {
512+
file_ast.mod.short_name
513+
}
513514
d.head = DocNode{
514515
name: module_name
515516
content: 'module ${module_name}'

cmd/tools/vpm/settings.v

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,3 @@ fn unique_server_urls(urls []string) []string {
111111
fn normalize_server_url(url string) string {
112112
return url.trim_space().trim_string_right('/')
113113
}
114-
115-
fn parse_server_urls(args []string) []string {
116-
mut urls := []string{}
117-
mut i := 0
118-
for i < args.len {
119-
if args[i] in server_url_option_names {
120-
i++
121-
if i < args.len {
122-
url := normalize_server_url(args[i])
123-
if url != '' && url !in urls {
124-
urls << url
125-
}
126-
}
127-
}
128-
i++
129-
}
130-
return urls
131-
}

vlib/v/gen/c/fn.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5280,11 +5280,11 @@ fn (mut g Gen) autofree_call_pregen(node ast.CallExpr) {
52805280
} else {
52815281
scope.register(ast.Var{
52825282
name: t
5283-
typ: ast.string_type
5283+
typ: arg.typ
52845284
is_autofree_tmp: true
52855285
pos: node.pos
52865286
})
5287-
s = 'string ${t} = '
5287+
s = '${g.styp(arg.typ)} ${t} = '
52885288
}
52895289
g.is_autofree_tmp = true
52905290
old_is_autofree := g.is_autofree

vlib/v/gen/c/if.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,9 @@ fn (mut g Gen) if_expr(node ast.IfExpr) {
302302
// nested if on return stmt
303303
g.write2(g.styp(g.unwrap_generic(g.last_if_option_type)), ' ')
304304
} else if resolved_sym.kind == .function && resolved_sym.info is ast.FnType {
305+
param_types := resolved_sym.info.func.params.map(it.typ)
305306
g.writeln('${g.fn_var_signature(resolved_typ, resolved_sym.info.func.return_type,
306-
resolved_sym.info.func.params.map(it.typ), tmp)}; /* if prepend */')
307+
param_types, tmp)}; /* if prepend */')
307308
declared_tmp = true
308309
} else {
309310
g.write('${styp} ')

vlib/v/gen/c/testdata/volatile.vv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ struct Abc {
66
mut volatile zzz := 123
77
mut volatile pzzz := &zzz
88
println(zzz)
9-
println(&int(voidptr(pzzz)))
9+
println(unsafe { &int(voidptr(pzzz)) })
1010
println(Abc{})

vlib/v/gen/native/tests/typeof.vv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn main() {
2828
println(t5)
2929
t6 := typeof(charptr(0))
3030
println(t6)
31-
t7 := typeof(&u8(3))
31+
t7 := typeof(unsafe { &u8(3) })
3232
println(t7)
3333

3434
// functions

0 commit comments

Comments
 (0)