Skip to content

Commit 4359e3a

Browse files
committed
chore: Rename C++ headers to .hh suffixes.
This helps formatters and other dump (simple) tools know what's C++ and what's C.
1 parent 0c05566 commit 4359e3a

17 files changed

+27
-25
lines changed

.restyled.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
22
exclude:
3-
- "**/*.api.h"
4-
# shfmt doesn't support this file
3+
# shfmt doesn't support this file
54
- "other/analysis/run-clang-tidy"
65

76
restylers:
87
- astyle:
98
arguments: ["--options=other/astyle/astylerc"]
109
include:
11-
- "!**/*.cc"
10+
- "**/*.c"
11+
- "**/*.h"
1212
- autopep8
1313
- black
1414
- clang-format:
1515
image: restyled/restyler-clang-format:13.0.1
1616
include:
1717
- "**/*.cc"
18+
- "**/*.hh"
1819
- prettier-yaml
1920
- reorder-python-imports
2021
- shellharden

testing/fuzzing/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
44
cc_library(
55
name = "fuzz_support",
66
srcs = [
7-
"func_conversion.h",
7+
"func_conversion.hh",
88
"fuzz_support.cc",
99
],
10-
hdrs = ["fuzz_support.h"],
10+
hdrs = ["fuzz_support.hh"],
1111
visibility = ["//c-toxcore:__subpackages__"],
1212
deps = [
1313
"//c-toxcore/toxcore:crypto_core",
@@ -18,7 +18,7 @@ cc_library(
1818

1919
cc_library(
2020
name = "fuzz_tox",
21-
hdrs = ["fuzz_tox.h"],
21+
hdrs = ["fuzz_tox.hh"],
2222
visibility = ["//c-toxcore:__subpackages__"],
2323
deps = [":fuzz_support"],
2424
)

testing/fuzzing/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Override network and random functions
2-
add_library(fuzz_support func_conversion.h fuzz_support.cc fuzz_support.h)
2+
add_library(fuzz_support func_conversion.hh fuzz_support.cc fuzz_support.hh)
33

44
set(LIBFUZZER_LINKER_FLAGS)
55
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")

testing/fuzzing/bootstrap_fuzz_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include "../../toxcore/tox.h"
55
#include "../../toxcore/tox_dispatch.h"
66
#include "../../toxcore/tox_events.h"
7-
#include "fuzz_support.h"
8-
#include "fuzz_tox.h"
7+
#include "fuzz_support.hh"
8+
#include "fuzz_tox.hh"
99

1010
namespace {
1111

testing/fuzzing/e2e_fuzz_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#include "../../toxcore/tox.h"
1313
#include "../../toxcore/tox_dispatch.h"
1414
#include "../../toxcore/tox_events.h"
15-
#include "fuzz_support.h"
16-
#include "fuzz_tox.h"
15+
#include "fuzz_support.hh"
16+
#include "fuzz_tox.hh"
1717

1818
namespace {
1919

File renamed without changes.

testing/fuzzing/fuzz_support.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright © 2021-2022 The TokTok team.
33
*/
44

5-
#include "fuzz_support.h"
5+
#include "fuzz_support.hh"
66

77
#include <arpa/inet.h>
88
#include <sys/socket.h>
@@ -18,7 +18,7 @@
1818
#include "../../toxcore/crypto_core.h"
1919
#include "../../toxcore/network.h"
2020
#include "../../toxcore/tox_private.h"
21-
#include "func_conversion.h"
21+
#include "func_conversion.hh"
2222

2323
// TODO(iphydf): Put this somewhere shared.
2424
struct Network_Addr {

testing/fuzzing/fuzz_support.h renamed to testing/fuzzing/fuzz_support.hh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
struct Fuzz_Data {
2121
static constexpr bool DEBUG = false;
22-
static constexpr std::size_t TRACE_TRAP = -1; // 579;
22+
static constexpr std::size_t TRACE_TRAP = -1; // 579;
2323

2424
private:
2525
const uint8_t *data_;
@@ -303,7 +303,8 @@ struct Record_System : System {
303303
if (recording_.size() == Fuzz_Data::TRACE_TRAP) {
304304
__asm__("int $3");
305305
}
306-
std::printf("%s: produce@%zu(bool %s)\n", name_, recording_.size(), byte ? "true" : "false");
306+
std::printf(
307+
"%s: produce@%zu(bool %s)\n", name_, recording_.size(), byte ? "true" : "false");
307308
}
308309
recording_.push_back(byte);
309310
}
File renamed without changes.

testing/fuzzing/protodump.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "../../toxcore/tox_private.h"
3434
#include "../../toxcore/tox_struct.h"
3535
#include "../../toxcore/util.h"
36-
#include "fuzz_support.h"
36+
#include "fuzz_support.hh"
3737

3838
namespace {
3939

0 commit comments

Comments
 (0)