Skip to content

Commit

Permalink
Update brace style in C++ generated code (#1922)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier authored Mar 8, 2024
1 parent c3ff7e3 commit 1636632
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
3 changes: 0 additions & 3 deletions cpp/include/IceUtil/OutputUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ namespace IceUtilInternal
void spar(char = '('); // Start a paramater list.
void epar(char = ')'); // End a paramater list.

void spar(std::string_view); // Start a paramater list.
void epar(std::string_view); // End a paramater list.

private:
std::string _blockStart;
std::string _blockEnd;
Expand Down
15 changes: 0 additions & 15 deletions cpp/src/IceUtil/OutputUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,21 +342,6 @@ IceUtilInternal::Output::epar(char c)
_out << c;
}

void
IceUtilInternal::Output::spar(string_view s)
{
_emptyBlock = false;
_out << s;
_par = 0;
}

void
IceUtilInternal::Output::epar(string_view s)
{
_par = -1;
_out << s;
}

Output&
IceUtilInternal::operator<<(Output& out, ios_base& (*val)(ios_base&))
{
Expand Down
8 changes: 4 additions & 4 deletions cpp/src/slice2cpp/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2706,12 +2706,12 @@ Slice::Gen::InterfaceVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)

// These type IDs are sorted alphabetically.
C << nl << "static const ::std::vector<::std::string> allTypeIds = ";
C.spar("{ ");
C.spar('{');
for (const auto& typeId : p->ids())
{
C << '"' + typeId + '"';
}
C.epar(" }");
C.epar('}');
C << ";";

C << nl << "return allTypeIds;";
Expand Down Expand Up @@ -2768,12 +2768,12 @@ Slice::Gen::InterfaceVisitor::visitInterfaceDefEnd(const InterfaceDefPtr& p)

C << sp;
C << nl << "static constexpr ::std::string_view allOperations[] = ";
C.spar("{ ");
C.spar('{');
for (const auto& opName : allOpNames)
{
C << '"' + opName + '"';
}
C.epar(" }");
C.epar('}');
C << ";";

C << sp;
Expand Down

0 comments on commit 1636632

Please sign in to comment.