Skip to content

Commit 108cdb7

Browse files
committed
Use declared type for each argument in passthrough mode
1 parent ba997cd commit 108cdb7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cpp2rust/converter/converter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,9 @@ void Converter::EmitArgList(const CallInfo &info) {
16231623
using Kind = CallArg::Kind;
16241624
PushParen call_args(*this);
16251625

1626-
for (const auto &ca : info.args) {
1626+
for (unsigned i = 0; i < info.args.size(); i++) {
1627+
const auto &ca = info.args[i];
1628+
16271629
if (ca.has_default) {
16281630
StrCat("Some");
16291631
}
@@ -1639,6 +1641,9 @@ void Converter::EmitArgList(const CallInfo &info) {
16391641
break;
16401642
case Kind::Inline:
16411643
ConvertParamTy(ca.param_type, ca.expr);
1644+
if (info.is_libc_passthrough) {
1645+
StrCat(std::format("as {}", Mapper::GetParamType(callee, i)));
1646+
}
16421647
break;
16431648
}
16441649
}

0 commit comments

Comments
 (0)