Skip to content

Commit f2064df

Browse files
committed
src: de-lint header usage
PR-URL: #26306 Reviewed-By: Gireesh Punathil <[email protected]>
1 parent 9029981 commit f2064df

35 files changed

+148
-151
lines changed

src/async_wrap.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

22+
#include "async_wrap.h" // NOLINT(build/include_inline)
2223
#include "async_wrap-inl.h"
2324
#include "env-inl.h"
2425
#include "node_errors.h"

src/debug_utils.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
#include <cstdio>
2323
#endif
2424

25-
#else // __POSIX__
26-
27-
#include <windows.h>
28-
#include <dbghelp.h>
29-
3025
#endif // __POSIX__
3126

3227
#if defined(__linux__) || defined(__sun) || defined(__FreeBSD__)

src/env.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "env.h"
2+
13
#include "async_wrap.h"
24
#include "node_buffer.h"
35
#include "node_context_data.h"
@@ -14,9 +16,9 @@
1416
#include "tracing/traced_value.h"
1517
#include "v8-profiler.h"
1618

17-
#include <cstdio>
1819
#include <algorithm>
1920
#include <atomic>
21+
#include <cstdio>
2022

2123
namespace node {
2224

src/inspector/main_thread_interface.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
#include "node_mutex.h"
44
#include "v8-inspector.h"
5+
#include "util-inl.h"
56

6-
#include <functional>
77
#include <unicode/unistr.h>
8-
#include "util-inl.h"
8+
9+
#include <functional>
910

1011
namespace node {
1112
namespace inspector {

src/inspector_agent.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616

1717
#include "libplatform/libplatform.h"
1818

19+
#ifdef __POSIX__
20+
#include <pthread.h>
21+
#include <climits> // PTHREAD_STACK_MIN
22+
#endif // __POSIX__
23+
1924
#include <cstring>
2025
#include <sstream>
2126
#include <unordered_map>
2227
#include <vector>
2328

24-
#ifdef __POSIX__
25-
#include <climits> // PTHREAD_STACK_MIN
26-
#include <pthread.h>
27-
#endif // __POSIX__
28-
2929
namespace node {
3030
namespace inspector {
3131
namespace {

src/inspector_agent.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
#ifndef SRC_INSPECTOR_AGENT_H_
2-
#define SRC_INSPECTOR_AGENT_H_
1+
#pragma once
32

43
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
54

6-
#include <memory>
7-
8-
#include <cstddef>
9-
105
#if !HAVE_INSPECTOR
116
#error("This header can only be used when inspector is enabled")
127
#endif
@@ -15,6 +10,9 @@
1510
#include "node_persistent.h"
1611
#include "v8.h"
1712

13+
#include <cstddef>
14+
#include <memory>
15+
1816
namespace v8_inspector {
1917
class StringView;
2018
} // namespace v8_inspector
@@ -143,5 +141,3 @@ class Agent {
143141
} // namespace node
144142

145143
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
146-
147-
#endif // SRC_INSPECTOR_AGENT_H_

src/inspector_io.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
#ifndef SRC_INSPECTOR_IO_H_
2-
#define SRC_INSPECTOR_IO_H_
1+
#pragma once
32

43
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
54

5+
#if !HAVE_INSPECTOR
6+
#error("This header can only be used when inspector is enabled")
7+
#endif
8+
69
#include "inspector_socket_server.h"
710
#include "node_mutex.h"
11+
812
#include "uv.h"
913

10-
#include <memory>
1114
#include <cstddef>
12-
13-
#if !HAVE_INSPECTOR
14-
#error("This header can only be used when inspector is enabled")
15-
#endif
15+
#include <memory>
1616

1717

1818
namespace v8_inspector {
@@ -93,5 +93,3 @@ class InspectorIo {
9393
} // namespace node
9494

9595
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
96-
97-
#endif // SRC_INSPECTOR_IO_H_

src/inspector_socket.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
#include "openssl/sha.h" // Sha-1 hash
1212

13-
#include <map>
1413
#include <cstring>
14+
#include <map>
1515

1616
#define ACCEPT_KEY_LENGTH base64_encoded_size(20)
1717

src/large_pages/node_large_page.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
//
2121
// SPDX-License-Identifier: MIT
2222

23-
#include <errno.h>
24-
#include <fcntl.h> // _O_RDWR
23+
#include <errno.h> // NOLINT(build/include)
24+
#include <fcntl.h> // _O_RDWR
2525
#include <limits.h> // PATH_MAX
2626
#include <locale.h>
2727
#include <signal.h>
@@ -31,11 +31,12 @@
3131
#include <string.h>
3232
#include <sys/types.h>
3333
#include <sys/mman.h>
34+
#include <unistd.h> // readlink
35+
3436
#include <string>
3537
#include <fstream>
3638
#include <iostream>
3739
#include <sstream>
38-
#include <unistd.h> // readlink
3940

4041
// The functions in this file map the text segment of node into 2M pages.
4142
// The algorithm is simple

src/memory_tracker.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
#ifndef SRC_MEMORY_TRACKER_H_
2-
#define SRC_MEMORY_TRACKER_H_
1+
#pragma once
32

43
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
54

6-
#include <unordered_map>
5+
#include "aliased_buffer.h"
6+
#include "v8-profiler.h"
7+
8+
#include <uv.h>
9+
10+
#include <limits>
711
#include <queue>
812
#include <stack>
913
#include <string>
10-
#include <limits>
11-
#include <uv.h>
12-
#include "aliased_buffer.h"
13-
#include "v8-profiler.h"
14+
#include <unordered_map>
1415

1516
namespace node {
1617

@@ -253,5 +254,3 @@ class MemoryTracker {
253254
} // namespace node
254255

255256
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
256-
257-
#endif // SRC_MEMORY_TRACKER_H_

0 commit comments

Comments
 (0)