Skip to content

Commit e42d99c

Browse files
amontoisoncvanaret
authored andcommitted
Polish
1 parent cf4ad8a commit e42d99c

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

interfaces/Julia/gen/wrapper_fortran.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,13 +661,11 @@ function main_fortran()
661661
open(out_c, "w") do io
662662
gen_uno_c(io, include_dir, funcs)
663663
end
664-
println("Generated: $out_c")
665664

666665
out_fortran = joinpath(fortran_dir, "uno_fortran.f90")
667666
open(out_fortran, "w") do io
668667
gen_uno_fortran(io, funcs)
669668
end
670-
println("Generated: $out_fortran")
671669
end
672670

673671
# If we want to use the file as a script with `julia wrapper_fortran.jl`

interfaces/Julia/gen/wrapper_rust.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,22 +175,22 @@ end
175175
# ----------------------------------------------------------------
176176
# Pre-computed structs
177177
# ----------------------------------------------------------------
178-
struct ArgInfo
178+
struct RustArgInfo
179179
name :: String
180180
rtype :: String
181181
end
182182

183-
struct FuncInfo
183+
struct RustFuncInfo
184184
name :: String
185185
ret :: Union{String, Nothing} # nothing = void
186-
args :: Vector{ArgInfo}
186+
args :: Vector{RustArgInfo}
187187
end
188188

189189
# ----------------------------------------------------------------
190190
# Collect all uno_* function declarations in one pass
191191
# ----------------------------------------------------------------
192192
function collect_funcs(root)
193-
funcs = FuncInfo[]
193+
funcs = RustFuncInfo[]
194194
for child in Clang.children(root)
195195
k = Clang.kind(child)
196196
name = Clang.spelling(child)
@@ -202,9 +202,9 @@ function collect_funcs(root)
202202
aname = Clang.spelling(a)
203203
at = Clang.getCursorType(a)
204204
spell = Clang.spelling(at)
205-
ArgInfo(aname, cltype_to_rust(at, spell))
205+
RustArgInfo(aname, cltype_to_rust(at, spell))
206206
end
207-
push!(funcs, FuncInfo(name, ret, collect(args)))
207+
push!(funcs, RustFuncInfo(name, ret, collect(args)))
208208
end
209209
end
210210
return funcs
@@ -215,7 +215,7 @@ end
215215
# ----------------------------------------------------------------
216216
const RUST_MAX_COL = 100
217217

218-
function gen_one_fn(io, f::FuncInfo, trailing_blank::Bool)
218+
function gen_one_fn(io, f::RustFuncInfo, trailing_blank::Bool)
219219
println(io, " // $(f.name)")
220220
ret_str = f.ret === nothing ? "" : " -> $(f.ret)"
221221

0 commit comments

Comments
 (0)