summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-07-31 23:16:08 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-07-31 23:16:26 +0200
commit02cab97490690610ab5c4ce5d76208d415f0d2c4 (patch)
treea4ac0a734d86ee9a0363ca631a175da016778847
parent847c6d980c83274b6c37e29a07d19a696435588b (diff)
downloadandroid-node-v8-02cab97490690610ab5c4ce5d76208d415f0d2c4.tar.gz
android-node-v8-02cab97490690610ab5c4ce5d76208d415f0d2c4.tar.bz2
android-node-v8-02cab97490690610ab5c4ce5d76208d415f0d2c4.zip
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.
-rw-r--r--src/cares_wrap.cc10
-rw-r--r--src/handle_wrap.cc2
-rw-r--r--src/handle_wrap.h3
-rw-r--r--src/node.cc82
-rw-r--r--src/node.h16
-rw-r--r--src/node_counters.h17
-rw-r--r--src/node_crypto.cc20
-rw-r--r--src/node_crypto.h10
-rw-r--r--src/node_http_parser.cc16
-rw-r--r--src/node_internals.h4
-rw-r--r--src/node_javascript.cc2
-rw-r--r--src/node_win32_etw_provider.h2
-rw-r--r--src/node_win32_perfctr_provider.cc6
-rw-r--r--src/node_zlib.cc12
-rw-r--r--src/pipe_wrap.cc6
-rw-r--r--src/smalloc.cc3
-rw-r--r--src/stream_wrap.cc6
-rw-r--r--src/string_bytes.cc8
-rw-r--r--src/tcp_wrap.cc6
-rw-r--r--src/tty_wrap.cc6
-rw-r--r--src/udp_wrap.cc4
-rw-r--r--src/uv.cc2
22 files changed, 121 insertions, 122 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc
index 756e0bc300..e9304310a0 100644
--- a/src/cares_wrap.cc
+++ b/src/cares_wrap.cc
@@ -19,11 +19,6 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
#define CARES_STATICLIB
#include "ares.h"
#include "node.h"
@@ -31,6 +26,11 @@
#include "tree.h"
#include "uv.h"
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
#if defined(__ANDROID__) || \
defined(__MINGW32__) || \
defined(__OpenBSD__) || \
diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc
index 6860231ca9..38b53ed402 100644
--- a/src/handle_wrap.cc
+++ b/src/handle_wrap.cc
@@ -19,9 +19,9 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+#include "handle_wrap.h"
#include "node.h"
#include "queue.h"
-#include "handle_wrap.h"
namespace node {
diff --git a/src/handle_wrap.h b/src/handle_wrap.h
index 48db9e7f81..6e6f3904b8 100644
--- a/src/handle_wrap.h
+++ b/src/handle_wrap.h
@@ -22,7 +22,10 @@
#ifndef SRC_HANDLE_WRAP_H_
#define SRC_HANDLE_WRAP_H_
+#include "node.h"
#include "queue.h"
+#include "uv.h"
+#include "v8.h"
namespace node {
diff --git a/src/node.cc b/src/node.cc
index ac15247747..d41b003c74 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -20,69 +20,69 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "node.h"
-#include "req_wrap.h"
-#include "handle_wrap.h"
-#include "string_bytes.h"
+#include "node_buffer.h"
+#include "node_constants.h"
+#include "node_file.h"
+#include "node_http_parser.h"
+#include "node_javascript.h"
+#include "node_script.h"
+#include "node_version.h"
-#include "ares.h"
-#include "uv.h"
+#if defined HAVE_PERFCTR
+#include "node_counters.h"
+#endif
+
+#if HAVE_OPENSSL
+#include "node_crypto.h"
+#endif
-#include "v8-debug.h"
#if defined HAVE_DTRACE || defined HAVE_ETW || defined HAVE_SYSTEMTAP
-# include "node_dtrace.h"
+#include "node_dtrace.h"
#endif
-#if defined HAVE_PERFCTR
-# include "node_counters.h"
+
+#if HAVE_SYSTEMTAP
+#include "node_provider.h"
#endif
+#include "ares.h"
+#include "handle_wrap.h"
+#include "req_wrap.h"
+#include "string_bytes.h"
+#include "uv.h"
+#include "v8-debug.h"
+#include "zlib.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <limits.h> // PATH_MAX
#include <locale.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if !defined(_MSC_VER)
-#include <strings.h>
-#else
-#define strcasecmp _stricmp
-#endif
-#include <limits.h> /* PATH_MAX */
-#include <assert.h>
-#if !defined(_MSC_VER)
-#include <unistd.h> /* setuid, getuid */
-#else
+#include <sys/types.h>
+
+#if defined(_MSC_VER)
#include <direct.h>
+#include <io.h>
#include <process.h>
+#include <strings.h>
+#define strcasecmp _stricmp
#define getpid _getpid
-#include <io.h>
#define umask _umask
typedef int mode_t;
+#else
+#include <unistd.h> // setuid, getuid
#endif
-#include <errno.h>
-#include <sys/types.h>
-#include "zlib.h"
#if defined(__POSIX__) && !defined(__ANDROID__)
-# include <pwd.h> /* getpwnam() */
-# include <grp.h> /* getgrnam() */
+#include <pwd.h> // getpwnam()
+#include <grp.h> // getgrnam()
#endif
-#include "node_buffer.h"
-#include "node_file.h"
-#include "node_http_parser.h"
-#include "node_constants.h"
-#include "node_javascript.h"
-#include "node_version.h"
-#if HAVE_OPENSSL
-# include "node_crypto.h"
-#endif
-#if HAVE_SYSTEMTAP
-#include "node_provider.h"
-#endif
-#include "node_script.h"
-
#ifdef __APPLE__
-# include <crt_externs.h>
-# define environ (*_NSGetEnviron())
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
#elif !defined(_MSC_VER)
extern char **environ;
#endif
diff --git a/src/node.h b/src/node.h
index 12a5d4cbc5..f41495c043 100644
--- a/src/node.h
+++ b/src/node.h
@@ -58,14 +58,7 @@
# define SIGKILL 9
#endif
-#include "node_version.h" /* NODE_MODULE_VERSION */
-#include "uv.h"
-#include "v8.h"
-
-#include <sys/types.h> /* struct stat */
-#include <sys/stat.h>
-#include <assert.h>
-
+#include "node_version.h" // NODE_MODULE_VERSION
#include "node_object_wrap.h"
// Forward-declare these functions now to stop MSVS from becoming
@@ -99,9 +92,14 @@ NODE_EXTERN v8::Handle<v8::Value> MakeCallback(
} // namespace node
#if NODE_WANT_INTERNALS
-# include "node_internals.h"
+#include "node_internals.h"
#endif
+#include "uv.h"
+#include "v8.h"
+
+#include <assert.h>
+
#ifndef NODE_STRINGIFY
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
#define NODE_STRINGIFY_HELPER(n) #n
diff --git a/src/node_counters.h b/src/node_counters.h
index 1b3d8c2b90..670f38e804 100644
--- a/src/node_counters.h
+++ b/src/node_counters.h
@@ -23,14 +23,6 @@
#define SRC_NODE_COUNTERS_H_
#include "node.h"
-#include "v8.h"
-
-namespace node {
-
-void InitPerfCounters(v8::Handle<v8::Object> target);
-void TermPerfCounters(v8::Handle<v8::Object> target);
-
-} // namespace node
#ifdef HAVE_PERFCTR
#include "node_win32_perfctr_provider.h"
@@ -50,4 +42,13 @@ void TermPerfCounters(v8::Handle<v8::Object> target);
#define NODE_COUNT_PIPE_BYTES_RECV(bytes)
#endif
+#include "v8.h"
+
+namespace node {
+
+void InitPerfCounters(v8::Handle<v8::Object> target);
+void TermPerfCounters(v8::Handle<v8::Object> target);
+
+} // namespace node
+
#endif // SRC_NODE_COUNTERS_H_
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 22b782895c..754ec65c68 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -19,28 +19,28 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+#include "node.h"
+#include "node_buffer.h"
#include "node_crypto.h"
#include "node_crypto_bio.h"
#include "node_crypto_groups.h"
-#include "v8.h"
+#include "node_root_certs.h"
-#include "node.h"
-#include "node_buffer.h"
#include "string_bytes.h"
-#include "node_root_certs.h"
+#include "v8.h"
+#include <errno.h>
+#include <stdlib.h>
#include <string.h>
-#ifdef _MSC_VER
+
+#if defined(_MSC_VER)
#define strcasecmp _stricmp
#endif
-#include <stdlib.h>
-#include <errno.h>
-
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-# define OPENSSL_CONST const
+#define OPENSSL_CONST const
#else
-# define OPENSSL_CONST
+#define OPENSSL_CONST
#endif
#define ASSERT_IS_STRING_OR_BUFFER(val) do { \
diff --git a/src/node_crypto.h b/src/node_crypto.h
index aa210df80b..aa275cc32d 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -23,8 +23,12 @@
#define SRC_NODE_CRYPTO_H_
#include "node.h"
-
#include "node_object_wrap.h"
+
+#ifdef OPENSSL_NPN_NEGOTIATED
+#include "node_buffer.h"
+#endif
+
#include "v8.h"
#include <openssl/ssl.h>
@@ -37,10 +41,6 @@
#include <openssl/rand.h>
#include <openssl/pkcs12.h>
-#ifdef OPENSSL_NPN_NEGOTIATED
-#include "node_buffer.h"
-#endif
-
#define EVP_F_EVP_DECRYPTFINAL 101
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc
index 2485b0acbf..5261f26d0f 100644
--- a/src/node_http_parser.cc
+++ b/src/node_http_parser.cc
@@ -19,19 +19,19 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-#include "node_http_parser.h"
-
-#include "v8.h"
#include "node.h"
#include "node_buffer.h"
+#include "node_http_parser.h"
+#include "v8.h"
-#include <string.h> /* strdup() */
-#if !defined(_MSC_VER)
-#include <strings.h> /* strcasecmp() */
-#else
+#include <stdlib.h> // free()
+#include <string.h> // strdup()
+
+#if defined(_MSC_VER)
#define strcasecmp _stricmp
+#else
+#include <strings.h> // strcasecmp()
#endif
-#include <stdlib.h> /* free() */
// This is a binding to http_parser (https://github.com/joyent/http-parser)
// The goal is to decouple sockets from parsing for more javascript-level
diff --git a/src/node_internals.h b/src/node_internals.h
index 86c486714a..b6dd676082 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -22,11 +22,11 @@
#ifndef SRC_NODE_INTERNALS_H_
#define SRC_NODE_INTERNALS_H_
+#include "v8.h"
+
#include <assert.h>
#include <stdlib.h>
-#include "v8.h"
-
struct sockaddr;
namespace node {
diff --git a/src/node_javascript.cc b/src/node_javascript.cc
index 76e3dfaea6..b37caa33a3 100644
--- a/src/node_javascript.cc
+++ b/src/node_javascript.cc
@@ -19,9 +19,9 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-#include "v8.h"
#include "node.h"
#include "node_natives.h"
+#include "v8.h"
#include <string.h>
#if !defined(_MSC_VER)
diff --git a/src/node_win32_etw_provider.h b/src/node_win32_etw_provider.h
index d0a41fe5dc..fd95d9a150 100644
--- a/src/node_win32_etw_provider.h
+++ b/src/node_win32_etw_provider.h
@@ -22,8 +22,8 @@
#ifndef SRC_NODE_WIN32_ETW_PROVIDER_H_
#define SRC_NODE_WIN32_ETW_PROVIDER_H_
-#include <evntprov.h>
#include "node_dtrace.h"
+#include <evntprov.h>
namespace node {
diff --git a/src/node_win32_perfctr_provider.cc b/src/node_win32_perfctr_provider.cc
index db8a9207f1..912dbb6bd9 100644
--- a/src/node_win32_perfctr_provider.cc
+++ b/src/node_win32_perfctr_provider.cc
@@ -19,12 +19,12 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+#define __INIT_node_perfctr_provider_IMP
#include "node_counters.h"
-#include <perflib.h>
+#include "node_perfctr_provider.h"
#include "node_win32_perfctr_provider.h"
-#define __INIT_node_perfctr_provider_IMP
-#include <node_perfctr_provider.h>
+#include <perflib.h>
typedef ULONG (WINAPI *PerfStartProviderExFunc)(
__in LPGUID ProviderGuid,
diff --git a/src/node_zlib.cc b/src/node_zlib.cc
index 8504d73fbc..3368233f72 100644
--- a/src/node_zlib.cc
+++ b/src/node_zlib.cc
@@ -19,18 +19,16 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+#include "node.h"
+#include "node_buffer.h"
#include "v8.h"
+#include "zlib.h"
+
#include <errno.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
-#include "zlib.h"
-#include "node.h"
-#include "node_buffer.h"
-
-
namespace node {
using v8::FunctionCallbackInfo;
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 7a7b93e051..850f458245 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -19,13 +19,13 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+#include "pipe_wrap.h"
#include "node.h"
#include "node_buffer.h"
-#include "req_wrap.h"
#include "handle_wrap.h"
-#include "stream_wrap.h"
-#include "pipe_wrap.h"
#include "node_wrap.h"
+#include "req_wrap.h"
+#include "stream_wrap.h"
namespace node {
diff --git a/src/smalloc.cc b/src/smalloc.cc
index 35220ac09b..e35602ab57 100644
--- a/src/smalloc.cc
+++ b/src/smalloc.cc
@@ -19,10 +19,9 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+#include "smalloc.h"
#include "node.h"
#include "node_internals.h"
-#include "smalloc.h"
#include "v8.h"
#include "v8-profiler.h"
diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc
index d5734d527d..17c8b89fae 100644
--- a/src/stream_wrap.cc
+++ b/src/stream_wrap.cc
@@ -19,15 +19,15 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+#include "stream_wrap.h"
#include "node.h"
#include "node_buffer.h"
+#include "node_counters.h"
#include "handle_wrap.h"
-#include "stream_wrap.h"
#include "pipe_wrap.h"
-#include "tcp_wrap.h"
#include "req_wrap.h"
+#include "tcp_wrap.h"
#include "udp_wrap.h"
-#include "node_counters.h"
#include <stdlib.h> // abort()
#include <limits.h> // INT_MAX
diff --git a/src/string_bytes.cc b/src/string_bytes.cc
index 75a7173dfd..0c15ce6063 100644
--- a/src/string_bytes.cc
+++ b/src/string_bytes.cc
@@ -21,14 +21,14 @@
#include "string_bytes.h"
-#include <assert.h>
-#include <string.h> // memcpy
-#include <limits.h>
-
#include "node.h"
#include "node_buffer.h"
#include "v8.h"
+#include <assert.h>
+#include <limits.h>
+#include <string.h> // memcpy
+
// When creating strings >= this length v8's gc spins up and consumes
// most of the execution time. For these cases it's more performant to
// use external string resources.
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index 010e9c3ec5..b4e3e0b78f 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -19,13 +19,13 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+#include "tcp_wrap.h"
#include "node.h"
#include "node_buffer.h"
-#include "req_wrap.h"
+#include "node_wrap.h"
#include "handle_wrap.h"
+#include "req_wrap.h"
#include "stream_wrap.h"
-#include "tcp_wrap.h"
-#include "node_wrap.h"
#include <stdlib.h>
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index d3c2a348d6..a53cfe87f7 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -19,13 +19,13 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+#include "tty_wrap.h"
#include "node.h"
#include "node_buffer.h"
-#include "req_wrap.h"
#include "handle_wrap.h"
-#include "stream_wrap.h"
-#include "tty_wrap.h"
#include "node_wrap.h"
+#include "req_wrap.h"
+#include "stream_wrap.h"
namespace node {
diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc
index a59843fb6d..0f97dd654c 100644
--- a/src/udp_wrap.cc
+++ b/src/udp_wrap.cc
@@ -19,11 +19,11 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+#include "udp_wrap.h"
#include "node.h"
#include "node_buffer.h"
-#include "req_wrap.h"
#include "handle_wrap.h"
-#include "udp_wrap.h"
+#include "req_wrap.h"
#include <stdlib.h>
diff --git a/src/uv.cc b/src/uv.cc
index bac0b5560a..83c39071f8 100644
--- a/src/uv.cc
+++ b/src/uv.cc
@@ -19,8 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-#include "node.h"
#include "uv.h"
+#include "node.h"
namespace node {
namespace uv {