mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
Make core and vendor adhere to -vet, -strict-style, and -disallow-do
This commit is contained in:
@@ -29,7 +29,7 @@ clone_array :: proc(array: $A/[]^$T) -> A {
|
||||
}
|
||||
res := make(A, len(array))
|
||||
for elem, i in array {
|
||||
res[i] = auto_cast clone(elem)
|
||||
res[i] = (^T)(clone(elem))
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -40,7 +40,7 @@ clone_dynamic_array :: proc(array: $A/[dynamic]^$T) -> A {
|
||||
}
|
||||
res := make(A, len(array))
|
||||
for elem, i in array {
|
||||
res[i] = auto_cast clone(elem)
|
||||
res[i] = (^T)(clone(elem))
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -169,10 +169,10 @@ clone_node :: proc(node: ^Node) -> ^Node {
|
||||
r.lhs = clone(r.lhs)
|
||||
r.rhs = clone(r.rhs)
|
||||
case Block_Stmt:
|
||||
r.label = auto_cast clone(r.label)
|
||||
r.label = clone(r.label)
|
||||
r.stmts = clone(r.stmts)
|
||||
case If_Stmt:
|
||||
r.label = auto_cast clone(r.label)
|
||||
r.label = clone(r.label)
|
||||
r.init = clone(r.init)
|
||||
r.cond = clone(r.cond)
|
||||
r.body = clone(r.body)
|
||||
@@ -186,13 +186,13 @@ clone_node :: proc(node: ^Node) -> ^Node {
|
||||
case Defer_Stmt:
|
||||
r.stmt = clone(r.stmt)
|
||||
case For_Stmt:
|
||||
r.label = auto_cast clone(r.label)
|
||||
r.label = clone(r.label)
|
||||
r.init = clone(r.init)
|
||||
r.cond = clone(r.cond)
|
||||
r.post = clone(r.post)
|
||||
r.body = clone(r.body)
|
||||
case Range_Stmt:
|
||||
r.label = auto_cast clone(r.label)
|
||||
r.label = clone(r.label)
|
||||
r.vals = clone(r.vals)
|
||||
r.expr = clone(r.expr)
|
||||
r.body = clone(r.body)
|
||||
@@ -200,12 +200,12 @@ clone_node :: proc(node: ^Node) -> ^Node {
|
||||
r.list = clone(r.list)
|
||||
r.body = clone(r.body)
|
||||
case Switch_Stmt:
|
||||
r.label = auto_cast clone(r.label)
|
||||
r.label = clone(r.label)
|
||||
r.init = clone(r.init)
|
||||
r.cond = clone(r.cond)
|
||||
r.body = clone(r.body)
|
||||
case Type_Switch_Stmt:
|
||||
r.label = auto_cast clone(r.label)
|
||||
r.label = clone(r.label)
|
||||
r.tag = clone(r.tag)
|
||||
r.expr = clone(r.expr)
|
||||
r.body = clone(r.body)
|
||||
|
||||
Reference in New Issue
Block a user