Skip to content

Commit 0690146

Browse files
committed
Updated and reformatted to clang-format-18
1 parent ca9dea0 commit 0690146

File tree

15 files changed

+45
-61
lines changed

15 files changed

+45
-61
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ init_compile_commands: debug
182182

183183
.PHONY: clang-format
184184
clang-format:
185-
docker run --rm -v $(CURDIR):/root/sources bkryza/clang-format-check:1.4
185+
docker run --rm -v $(CURDIR):/root/sources bkryza/clang-format-check:1.5
186186

187187
.PHONY: format
188188
format:
189-
docker run --rm -v $(CURDIR):/root/sources bkryza/clang-format-check:1.4
189+
docker run --rm -v $(CURDIR):/root/sources bkryza/clang-format-check:1.5
190190

191191
.PHONY: debug_tidy
192192
tidy: debug_tidy

src/class_diagram/generators/mermaid/class_diagram_generator.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,7 @@ void generator::generate_member(
308308

309309
void generator::generate(const concept_ &c, std::ostream &ostr) const
310310
{
311-
ostr << indent(1) << "class"
312-
<< " " << c.alias();
311+
ostr << indent(1) << "class" << " " << c.alias();
313312

314313
ostr << " {" << '\n';
315314
ostr << indent(2) << "<<concept>>\n";

src/class_diagram/generators/plantuml/class_diagram_generator.cc

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@ void generator::generate_alias(const enum_ &e, std::ostream &ostr) const
9999
print_debug(e, ostr);
100100

101101
if (!config().generate_fully_qualified_name())
102-
ostr << "enum"
103-
<< " \"" << e.name();
102+
ostr << "enum" << " \"" << e.name();
104103
else
105-
ostr << "enum"
106-
<< " \"" << render_name(e.full_name());
104+
ostr << "enum" << " \"" << render_name(e.full_name());
107105

108106
ostr << "\" as " << e.alias() << '\n';
109107

@@ -116,11 +114,9 @@ void generator::generate_alias(const concept_ &c, std::ostream &ostr) const
116114
print_debug(c, ostr);
117115

118116
if (!config().generate_fully_qualified_name())
119-
ostr << "class"
120-
<< " \"" << c.full_name_no_ns();
117+
ostr << "class" << " \"" << c.full_name_no_ns();
121118
else
122-
ostr << "class"
123-
<< " \"" << render_name(c.full_name());
119+
ostr << "class" << " \"" << render_name(c.full_name());
124120

125121
ostr << "\" as " << c.alias() << '\n';
126122

@@ -155,8 +151,7 @@ void generator::generate(const class_ &c, std::ostream &ostr) const
155151
ostr << class_type << " " << c.alias();
156152

157153
if (c.is_union())
158-
ostr << " "
159-
<< "<<union>>";
154+
ostr << " " << "<<union>>";
160155

161156
if (config().generate_links) {
162157
common_generator<diagram_config, diagram_model>::generate_link(ostr, c);

src/sequence_diagram/generators/mermaid/sequence_diagram_generator.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,7 @@ void generator::generate_participant(
445445
common::ensure_lambda_type_is_relative(config(), participant_name);
446446

447447
ostr << indent(1) << "participant " << class_participant.alias()
448-
<< " as "
449-
<< "<< ObjC Interface >><br>"
448+
<< " as " << "<< ObjC Interface >><br>"
450449
<< render_participant_name(participant_name);
451450

452451
ostr << '\n';
@@ -699,8 +698,7 @@ void generator::generate_diagram(std::ostream &ostr) const
699698
ostr << indent(1) << from_alias << " "
700699
<< common::generators::mermaid::to_mermaid(
701700
message_t::kReturn)
702-
<< " *"
703-
<< " : ";
701+
<< " *" << " : ";
704702

705703
if (config().generate_return_types())
706704
ostr << from.value().return_type();

src/sequence_diagram/generators/plantuml/sequence_diagram_generator.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,7 @@ void generator::generate_diagram(std::ostream &ostr) const
597597
from.value().type_name() == "objc_method" ||
598598
config().combine_free_functions_into_file_participants()) {
599599
generate_participant(ostr, *from_activity_id);
600-
ostr << "[->"
601-
<< " " << generate_alias(from.value()) << " : "
600+
ostr << "[->" << " " << generate_alias(from.value()) << " : "
602601
<< from.value().message_name(
603602
select_method_arguments_render_mode())
604603
<< '\n';
@@ -638,8 +637,7 @@ void generator::generate_diagram(std::ostream &ostr) const
638637
from.value().type_name() == "objc_method" ||
639638
config().combine_free_functions_into_file_participants()) {
640639
generate_participant(ostr, from_activity_id);
641-
ostr << "[->"
642-
<< " " << generate_alias(from.value()) << " : "
640+
ostr << "[->" << " " << generate_alias(from.value()) << " : "
643641
<< from.value().message_name(
644642
select_method_arguments_render_mode())
645643
<< '\n';
@@ -704,8 +702,7 @@ void generator::generate_diagram(std::ostream &ostr) const
704702
if (from.value().type_name() == "method" ||
705703
from.value().type_name() == "objc_method" ||
706704
config().combine_free_functions_into_file_participants()) {
707-
ostr << "[->"
708-
<< " " << from_alias << " : "
705+
ostr << "[->" << " " << from_alias << " : "
709706
<< from.value().message_name(render_mode) << '\n';
710707
}
711708

@@ -718,8 +715,7 @@ void generator::generate_diagram(std::ostream &ostr) const
718715
config().combine_free_functions_into_file_participants()) {
719716

720717
if (!from.value().is_void()) {
721-
ostr << "[<--"
722-
<< " " << from_alias;
718+
ostr << "[<--" << " " << from_alias;
723719

724720
if (config().generate_return_types())
725721
ostr << " : //" << from.value().return_type() << "//";

tests/t00044/t00044.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ template <typename Ret, typename... Args, typename A>
2525
struct signal_handler<Ret(Args...), A> { };
2626

2727
template <typename Ret, typename... Args, typename A>
28-
sink(signal_handler<Ret(Args...), A> &)
29-
-> sink<signal_handler<Ret(Args...), A>>;
28+
sink(
29+
signal_handler<Ret(Args...), A> &) -> sink<signal_handler<Ret(Args...), A>>;
3030

3131
signal_handler<void(int), bool> int_handler;
3232

tests/t00056/t00056.cc

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,20 @@ concept max_four_bytes = sizeof(T) <= 4;
1818
// Simple requirement
1919
template <typename T>
2020
concept iterable = requires(T container) {
21-
container.begin();
22-
container.end();
23-
};
21+
container.begin();
22+
container.end();
23+
};
2424

2525
// Type requirement
2626
template <typename T>
2727
concept has_value_type = requires { typename T::value_type; };
2828

2929
template <typename T>
30-
concept convertible_to_string =
31-
max_four_bytes<T> && requires(T s) {
32-
std::string{s};
33-
{
34-
std::to_string(s)
35-
} noexcept;
36-
{
37-
std::to_string(s)
38-
} -> std::same_as<std::string>;
39-
};
30+
concept convertible_to_string = max_four_bytes<T> && requires(T s) {
31+
std::string{s};
32+
{ std::to_string(s) } noexcept;
33+
{ std::to_string(s) } -> std::same_as<std::string>;
34+
};
4035

4136
// Compound requirement
4237
// ...
@@ -64,9 +59,9 @@ struct B {
6459
// Anonymous concept requirement (TODO)
6560
template <convertible_to_string T>
6661
requires requires(T t) {
67-
--t;
68-
t--;
69-
}
62+
--t;
63+
t--;
64+
}
7065
struct C {
7166
T c;
7267
};

tests/t00059/t00059.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ namespace t00059 {
55

66
template <typename T>
77
concept fruit_c = requires(T t) {
8-
T{};
9-
t.get_name();
10-
};
8+
T{};
9+
t.get_name();
10+
};
1111

1212
template <typename T>
1313
concept apple_c = fruit_c<T> && requires(T t) { t.get_sweetness(); };

tests/t00062/t00062.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ template <> struct A<char[1000]> {
8080
std::vector<char> n;
8181
};
8282

83-
template <int K, int L, int M> struct A<char[K][L][M]> { char klm[K][L][M]; };
83+
template <int K, int L, int M> struct A<char[K][L][M]> {
84+
char klm[K][L][M];
85+
};
8486

8587
template <typename U> struct A<U(...)> {
8688
bool u;

tests/t00065/module2/concepts/concepts.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ namespace t00065 {
55

66
template <typename T>
77
concept bconcept = requires(T t) {
8-
T{};
9-
t.b();
10-
};
8+
T{};
9+
t.b();
10+
};
1111

1212
}
1313
}

0 commit comments

Comments
 (0)