Skip to content

Commit 02cab97

Browse files
committed
src: more lint after cpplint tightening
Commit 847c6d9 adds a 'project headers before system headers' check to cpplint. Update the files in src/ to make the linter pass again.
1 parent 847c6d9 commit 02cab97

22 files changed

+121
-122
lines changed

src/cares_wrap.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
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 <assert.h>
23-
#include <errno.h>
24-
#include <stdlib.h>
25-
#include <string.h>
26-
2722
#define CARES_STATICLIB
2823
#include "ares.h"
2924
#include "node.h"
3025
#include "req_wrap.h"
3126
#include "tree.h"
3227
#include "uv.h"
3328

29+
#include <assert.h>
30+
#include <errno.h>
31+
#include <stdlib.h>
32+
#include <string.h>
33+
3434
#if defined(__ANDROID__) || \
3535
defined(__MINGW32__) || \
3636
defined(__OpenBSD__) || \

src/handle_wrap.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
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 "handle_wrap.h"
2223
#include "node.h"
2324
#include "queue.h"
24-
#include "handle_wrap.h"
2525

2626
namespace node {
2727

src/handle_wrap.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
#ifndef SRC_HANDLE_WRAP_H_
2323
#define SRC_HANDLE_WRAP_H_
2424

25+
#include "node.h"
2526
#include "queue.h"
27+
#include "uv.h"
28+
#include "v8.h"
2629

2730
namespace node {
2831

src/node.cc

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,69 +20,69 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
#include "node.h"
23-
#include "req_wrap.h"
24-
#include "handle_wrap.h"
25-
#include "string_bytes.h"
23+
#include "node_buffer.h"
24+
#include "node_constants.h"
25+
#include "node_file.h"
26+
#include "node_http_parser.h"
27+
#include "node_javascript.h"
28+
#include "node_script.h"
29+
#include "node_version.h"
2630

27-
#include "ares.h"
28-
#include "uv.h"
31+
#if defined HAVE_PERFCTR
32+
#include "node_counters.h"
33+
#endif
34+
35+
#if HAVE_OPENSSL
36+
#include "node_crypto.h"
37+
#endif
2938

30-
#include "v8-debug.h"
3139
#if defined HAVE_DTRACE || defined HAVE_ETW || defined HAVE_SYSTEMTAP
32-
# include "node_dtrace.h"
40+
#include "node_dtrace.h"
3341
#endif
34-
#if defined HAVE_PERFCTR
35-
# include "node_counters.h"
42+
43+
#if HAVE_SYSTEMTAP
44+
#include "node_provider.h"
3645
#endif
3746

47+
#include "ares.h"
48+
#include "handle_wrap.h"
49+
#include "req_wrap.h"
50+
#include "string_bytes.h"
51+
#include "uv.h"
52+
#include "v8-debug.h"
53+
#include "zlib.h"
54+
55+
#include <assert.h>
56+
#include <errno.h>
57+
#include <limits.h> // PATH_MAX
3858
#include <locale.h>
3959
#include <signal.h>
4060
#include <stdio.h>
4161
#include <stdlib.h>
4262
#include <string.h>
43-
#if !defined(_MSC_VER)
44-
#include <strings.h>
45-
#else
46-
#define strcasecmp _stricmp
47-
#endif
48-
#include <limits.h> /* PATH_MAX */
49-
#include <assert.h>
50-
#if !defined(_MSC_VER)
51-
#include <unistd.h> /* setuid, getuid */
52-
#else
63+
#include <sys/types.h>
64+
65+
#if defined(_MSC_VER)
5366
#include <direct.h>
67+
#include <io.h>
5468
#include <process.h>
69+
#include <strings.h>
70+
#define strcasecmp _stricmp
5571
#define getpid _getpid
56-
#include <io.h>
5772
#define umask _umask
5873
typedef int mode_t;
74+
#else
75+
#include <unistd.h> // setuid, getuid
5976
#endif
60-
#include <errno.h>
61-
#include <sys/types.h>
62-
#include "zlib.h"
6377

6478
#if defined(__POSIX__) && !defined(__ANDROID__)
65-
# include <pwd.h> /* getpwnam() */
66-
# include <grp.h> /* getgrnam() */
79+
#include <pwd.h> // getpwnam()
80+
#include <grp.h> // getgrnam()
6781
#endif
6882

69-
#include "node_buffer.h"
70-
#include "node_file.h"
71-
#include "node_http_parser.h"
72-
#include "node_constants.h"
73-
#include "node_javascript.h"
74-
#include "node_version.h"
75-
#if HAVE_OPENSSL
76-
# include "node_crypto.h"
77-
#endif
78-
#if HAVE_SYSTEMTAP
79-
#include "node_provider.h"
80-
#endif
81-
#include "node_script.h"
82-
8383
#ifdef __APPLE__
84-
# include <crt_externs.h>
85-
# define environ (*_NSGetEnviron())
84+
#include <crt_externs.h>
85+
#define environ (*_NSGetEnviron())
8686
#elif !defined(_MSC_VER)
8787
extern char **environ;
8888
#endif

src/node.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,7 @@
5858
# define SIGKILL 9
5959
#endif
6060

61-
#include "node_version.h" /* NODE_MODULE_VERSION */
62-
#include "uv.h"
63-
#include "v8.h"
64-
65-
#include <sys/types.h> /* struct stat */
66-
#include <sys/stat.h>
67-
#include <assert.h>
68-
61+
#include "node_version.h" // NODE_MODULE_VERSION
6962
#include "node_object_wrap.h"
7063

7164
// Forward-declare these functions now to stop MSVS from becoming
@@ -99,9 +92,14 @@ NODE_EXTERN v8::Handle<v8::Value> MakeCallback(
9992
} // namespace node
10093

10194
#if NODE_WANT_INTERNALS
102-
# include "node_internals.h"
95+
#include "node_internals.h"
10396
#endif
10497

98+
#include "uv.h"
99+
#include "v8.h"
100+
101+
#include <assert.h>
102+
105103
#ifndef NODE_STRINGIFY
106104
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
107105
#define NODE_STRINGIFY_HELPER(n) #n

src/node_counters.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@
2323
#define SRC_NODE_COUNTERS_H_
2424

2525
#include "node.h"
26-
#include "v8.h"
27-
28-
namespace node {
29-
30-
void InitPerfCounters(v8::Handle<v8::Object> target);
31-
void TermPerfCounters(v8::Handle<v8::Object> target);
32-
33-
} // namespace node
3426

3527
#ifdef HAVE_PERFCTR
3628
#include "node_win32_perfctr_provider.h"
@@ -50,4 +42,13 @@ void TermPerfCounters(v8::Handle<v8::Object> target);
5042
#define NODE_COUNT_PIPE_BYTES_RECV(bytes)
5143
#endif
5244

45+
#include "v8.h"
46+
47+
namespace node {
48+
49+
void InitPerfCounters(v8::Handle<v8::Object> target);
50+
void TermPerfCounters(v8::Handle<v8::Object> target);
51+
52+
} // namespace node
53+
5354
#endif // SRC_NODE_COUNTERS_H_

src/node_crypto.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@
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 "node.h"
23+
#include "node_buffer.h"
2224
#include "node_crypto.h"
2325
#include "node_crypto_bio.h"
2426
#include "node_crypto_groups.h"
25-
#include "v8.h"
27+
#include "node_root_certs.h"
2628

27-
#include "node.h"
28-
#include "node_buffer.h"
2929
#include "string_bytes.h"
30-
#include "node_root_certs.h"
30+
#include "v8.h"
3131

32+
#include <errno.h>
33+
#include <stdlib.h>
3234
#include <string.h>
33-
#ifdef _MSC_VER
35+
36+
#if defined(_MSC_VER)
3437
#define strcasecmp _stricmp
3538
#endif
3639

37-
#include <stdlib.h>
38-
#include <errno.h>
39-
4040
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
41-
# define OPENSSL_CONST const
41+
#define OPENSSL_CONST const
4242
#else
43-
# define OPENSSL_CONST
43+
#define OPENSSL_CONST
4444
#endif
4545

4646
#define ASSERT_IS_STRING_OR_BUFFER(val) do { \

src/node_crypto.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@
2323
#define SRC_NODE_CRYPTO_H_
2424

2525
#include "node.h"
26-
2726
#include "node_object_wrap.h"
27+
28+
#ifdef OPENSSL_NPN_NEGOTIATED
29+
#include "node_buffer.h"
30+
#endif
31+
2832
#include "v8.h"
2933

3034
#include <openssl/ssl.h>
@@ -37,10 +41,6 @@
3741
#include <openssl/rand.h>
3842
#include <openssl/pkcs12.h>
3943

40-
#ifdef OPENSSL_NPN_NEGOTIATED
41-
#include "node_buffer.h"
42-
#endif
43-
4444
#define EVP_F_EVP_DECRYPTFINAL 101
4545

4646

src/node_http_parser.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
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 "node_http_parser.h"
23-
24-
#include "v8.h"
2522
#include "node.h"
2623
#include "node_buffer.h"
24+
#include "node_http_parser.h"
25+
#include "v8.h"
2726

28-
#include <string.h> /* strdup() */
29-
#if !defined(_MSC_VER)
30-
#include <strings.h> /* strcasecmp() */
31-
#else
27+
#include <stdlib.h> // free()
28+
#include <string.h> // strdup()
29+
30+
#if defined(_MSC_VER)
3231
#define strcasecmp _stricmp
32+
#else
33+
#include <strings.h> // strcasecmp()
3334
#endif
34-
#include <stdlib.h> /* free() */
3535

3636
// This is a binding to http_parser (https://github.com/joyent/http-parser)
3737
// The goal is to decouple sockets from parsing for more javascript-level

src/node_internals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#ifndef SRC_NODE_INTERNALS_H_
2323
#define SRC_NODE_INTERNALS_H_
2424

25+
#include "v8.h"
26+
2527
#include <assert.h>
2628
#include <stdlib.h>
2729

28-
#include "v8.h"
29-
3030
struct sockaddr;
3131

3232
namespace node {

0 commit comments

Comments
 (0)