Skip to content

Commit

Permalink
Fix cpplint warnings
Browse files Browse the repository at this point in the history
Closes #865
  • Loading branch information
vanillajonathan authored and emilio committed Apr 15, 2024
1 parent b0ad90a commit ca78140
Show file tree
Hide file tree
Showing 434 changed files with 777 additions and 777 deletions.
12 changes: 6 additions & 6 deletions src/bindgen/language_backend/clike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ impl<'a> CLikeLanguageBackend<'a> {
if open {
write!(out, "namespace {} {{", namespace)
} else {
write!(out, "}} // namespace {}", namespace)
write!(out, "}} // namespace {}", namespace)
}
}

out.new_line();
if self.config.cpp_compatible_c() {
out.write("#endif // __cplusplus");
out.write("#endif // __cplusplus");
out.new_line();
}
}
Expand Down Expand Up @@ -457,9 +457,9 @@ impl LanguageBackend for CLikeLanguageBackend<'_> {
if let Some(f) = self.config.include_guard() {
out.new_line_if_not_start();
if self.config.language == Language::C {
write!(out, "#endif /* {} */", f);
write!(out, "#endif /* {} */", f);
} else {
write!(out, "#endif // {}", f);
write!(out, "#endif // {}", f);
}
out.new_line();
}
Expand Down Expand Up @@ -984,12 +984,12 @@ impl LanguageBackend for CLikeLanguageBackend<'_> {

if b.config.language == Language::Cxx || b.config.cpp_compatible_c() {
out.new_line();
out.write("} // extern \"C\"");
out.write("} // extern \"C\"");
out.new_line();
}

if b.config.cpp_compatible_c() {
out.write("#endif // __cplusplus");
out.write("#endif // __cplusplus");
out.new_line();
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/abi_string.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ void c(void);
void c_unwind(void);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/abi_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ void c();

void c_unwind();

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/alias.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ extern "C" {
void root(IntFoo x, DoubleFoo y, Unit z, SpecialStatus w);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ extern "C" {

void root(IntFoo x, DoubleFoo y, Unit z, SpecialStatus w);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/alias_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ extern "C" {
void root(IntFoo x, DoubleFoo y, Unit z, SpecialStatus w);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/alias_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ extern "C" {
void root(IntFoo x, DoubleFoo y, Unit z, SpecialStatus w);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/annotation.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ extern "C" {
void root(A x, B y, C z, F f, H h);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/annotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ extern "C" {

void root(A x, B y, C z, F f, H h);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/annotation_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ extern "C" {
void root(struct A x, struct B y, C z, union F f, struct H h);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/annotation_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ extern "C" {
void root(struct A x, struct B y, C z, union F f, struct H h);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/array.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ extern "C" {
void root(Foo a);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ extern "C" {

void root(Foo a);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/array_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ extern "C" {
void root(struct Foo a);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/array_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ extern "C" {
void root(struct Foo a);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/asserted_cast.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ extern "C" {
void foo(H h, I i, J j, K k);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/asserted_cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,4 @@ extern "C" {

void foo(H h, I i, J j, K k);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/asserted_cast_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ extern "C" {
void foo(struct H h, struct I i, struct J j, union K k);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/asserted_cast_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ extern "C" {
void foo(struct H h, struct I i, struct J j, union K k);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/assoc_constant.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ extern "C" {
void root(Foo x);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/assoc_constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ extern "C" {

void root(Foo x);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/assoc_constant_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ extern "C" {
void root(struct Foo x);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/assoc_constant_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ extern "C" {
void root(struct Foo x);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/associated_in_body.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ extern "C" {
void root(StyleAlignFlags flags, StyleNativeTileId tile);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/associated_in_body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ extern "C" {

void root(StyleAlignFlags flags, StyleNativeTileId tile);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/associated_in_body_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ extern "C" {
void root(struct StyleAlignFlags flags, struct StyleNativeTileId tile);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/associated_in_body_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ extern "C" {
void root(struct StyleAlignFlags flags, struct StyleNativeTileId tile);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/bitfield.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ extern "C" {
void root(const HasBitfields*);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/bitfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ extern "C" {

void root(const HasBitfields*);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/bitfield_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ extern "C" {
void root(const struct HasBitfields*);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/bitfield_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ extern "C" {
void root(const struct HasBitfields*);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/bitflags.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ void root(AlignFlags flags,
OutOfLine out_of_line);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/bitflags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ void root(AlignFlags flags,
LargeFlags largest_flags,
OutOfLine out_of_line);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/bitflags_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ void root(struct AlignFlags flags,
struct OutOfLine out_of_line);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/bitflags_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ void root(struct AlignFlags flags,
struct OutOfLine out_of_line);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/body.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ void root(MyFancyStruct s,
MyUnion_Prepended up);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ void root(MyFancyStruct s,
MyCLikeEnum_Prepended cp,
MyUnion_Prepended up);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/body_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ void root(struct MyFancyStruct s,
union MyUnion_Prepended up);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/body_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ void root(struct MyFancyStruct s,
union MyUnion_Prepended up);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/box.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ void drop_box(int32_t *x);
void drop_box_opt(int32_t *x);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ void drop_box(Box<int32_t> x);

void drop_box_opt(Option<Box<int32_t>> x);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/box_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ void drop_box(int32_t *x);
void drop_box_opt(int32_t *x);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/box_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ void drop_box(int32_t *x);
void drop_box_opt(int32_t *x);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/cdecl.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ void (*O(void))(void);
void root(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n, P p);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/cdecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ void (*O())();

void root(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n, P p);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/cell.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ extern "C" {
void root(const Foo *a, const MyStruct *with_cell);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
2 changes: 1 addition & 1 deletion tests/expectations/cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ extern "C" {

void root(const Foo *a, const MyStruct *with_cell);

} // extern "C"
} // extern "C"
4 changes: 2 additions & 2 deletions tests/expectations/cell_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ extern "C" {
void root(const Foo *a, const struct MyStruct *with_cell);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
} // extern "C"
#endif // __cplusplus
Loading

0 comments on commit ca78140

Please sign in to comment.