Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed unnecessary additional new line being added.
  • Loading branch information
calumroy committed Aug 15, 2024
commit 5df33a0f6b824cda0c0355ba78dbb8f96d90bb2c
8 changes: 6 additions & 2 deletions src/codegen/c-main-generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,8 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs)
fwriter.Append(" _m->%s = (%s) ( %s );", masterSname,
PrintType((int)masterSignal->TypeRo).c_str(), masterExpr.c_str());
}


// Unpack the rest of the signals
for (size_t num = 0; num < sgs->to_signals.size(); num++)
{
const auto& signal = sgs->msg.Signals[num];
Expand Down Expand Up @@ -765,7 +766,10 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs)
// Add a newline after processing the last signal
if (num + 1 == sgs->to_signals.size())
{
fwriter.Append("");
// No newline if the last signal was a multiplexed signal, as it already has a newline
if (signal.IsSimpleSig) {
fwriter.Append("");
}
}
}

Expand Down