From 3bd75b5f9a34547296e386a2875819fe4aecc9ca Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 10 Dec 2019 13:09:46 +0100 Subject: [PATCH] src: fix lint-cpp issues PR-URL: https://github.com/nodejs/quic/pull/224 Reviewed-By: Anna Henningsen --- src/node_crypto.cc | 1 - src/node_crypto_common.cc | 1 - src/node_quic_crypto.cc | 3 --- src/node_quic_http3_application.cc | 3 +-- src/node_quic_session.cc | 1 - src/node_quic_socket.cc | 3 +-- src/node_quic_stream.cc | 5 ++--- src/node_quic_stream.h | 2 +- src/node_quic_util.h | 2 +- src/node_sockaddr-inl.h | 2 -- 10 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 34f44a522d..9ffadf0619 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -32,7 +32,6 @@ #include "tls_wrap.h" // TLSWrap #include "async_wrap-inl.h" -#include "base_object-inl.h" #include "env-inl.h" #include "memory_tracker-inl.h" #include "string_bytes.h" diff --git a/src/node_crypto_common.cc b/src/node_crypto_common.cc index 7ad1337ae8..e2fed6d680 100644 --- a/src/node_crypto_common.cc +++ b/src/node_crypto_common.cc @@ -18,7 +18,6 @@ namespace node { using v8::Array; using v8::Context; using v8::Integer; -using v8::Isolate; using v8::Local; using v8::Object; using v8::Value; diff --git a/src/node_quic_crypto.cc b/src/node_quic_crypto.cc index b3cd484037..4f7f2224da 100644 --- a/src/node_quic_crypto.cc +++ b/src/node_quic_crypto.cc @@ -28,10 +28,7 @@ namespace node { using crypto::EntropySource; -using v8::Array; -using v8::Integer; using v8::Local; -using v8::Object; using v8::String; using v8::Value; diff --git a/src/node_quic_http3_application.cc b/src/node_quic_http3_application.cc index 176c1cac65..940f1b5ba2 100644 --- a/src/node_quic_http3_application.cc +++ b/src/node_quic_http3_application.cc @@ -16,7 +16,6 @@ namespace node { using v8::Eternal; using v8::MaybeLocal; -using v8::Number; using v8::String; using v8::Value; @@ -510,7 +509,7 @@ bool Http3Application::SendPendingData() { // } // continue; } - //Session()->SetLastError(QUIC_ERROR_APPLICATION, nwrite); + // Session()->SetLastError(QUIC_ERROR_APPLICATION, nwrite); return false; } diff --git a/src/node_quic_session.cc b/src/node_quic_session.cc index 9ce3e6c278..365d59db26 100644 --- a/src/node_quic_session.cc +++ b/src/node_quic_session.cc @@ -607,7 +607,6 @@ void JSQuicSessionListener::OnSessionTicket(int size, SSL_SESSION* session) { Session()->MakeCallback( env->quic_on_session_ticket_function(), arraysize(argv), argv); - } void JSQuicSessionListener::OnSessionSilentClose( diff --git a/src/node_quic_socket.cc b/src/node_quic_socket.cc index c6de5f33f6..0927dac7f8 100644 --- a/src/node_quic_socket.cc +++ b/src/node_quic_socket.cc @@ -599,8 +599,7 @@ bool QuicSocket::SendStatelessReset( NGTCP2_MAX_PKTLEN_IPV4, token, random, - RANDLEN - ); + RANDLEN); if (nwrite <= 0) return false; buf.Realloc(nwrite); diff --git a/src/node_quic_stream.cc b/src/node_quic_stream.cc index dab2ff4714..f4950ceefd 100644 --- a/src/node_quic_stream.cc +++ b/src/node_quic_stream.cc @@ -23,7 +23,6 @@ using v8::Array; using v8::Context; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Integer; using v8::Isolate; using v8::Local; using v8::Object; @@ -336,9 +335,9 @@ void QuicStream::ReceiveData( // Reading can be paused while we are processing. If that's // the case, we still want to acknowledge the current bytes // so that pausing does not throw off our flow control. - if (read_paused) + if (read_paused) { inbound_consumed_data_while_paused_ += avail; - else { + } else { IncrementStat( avail, &stream_stats_, diff --git a/src/node_quic_stream.h b/src/node_quic_stream.h index bd522e2643..b3a659fa5c 100644 --- a/src/node_quic_stream.h +++ b/src/node_quic_stream.h @@ -55,7 +55,7 @@ enum QuicStreamStatsIdx : int { // pair. QuicApplication implementations that support headers // per stream must create a specialization of the Header class. class QuicHeader { - public: + public: QuicHeader() {} virtual ~QuicHeader() {} diff --git a/src/node_quic_util.h b/src/node_quic_util.h index 5741bee0d8..cc9499d01e 100644 --- a/src/node_quic_util.h +++ b/src/node_quic_util.h @@ -88,7 +88,7 @@ struct QuicError { inline QuicError( int32_t family_ = QUIC_ERROR_SESSION, uint64_t code_ = NGTCP2_NO_ERROR); - inline QuicError(ngtcp2_connection_close_error_code code); + explicit inline QuicError(ngtcp2_connection_close_error_code code); inline QuicError( Environment* env, v8::Local codeArg, diff --git a/src/node_sockaddr-inl.h b/src/node_sockaddr-inl.h index 24dd9a9e9a..a1968a675e 100644 --- a/src/node_sockaddr-inl.h +++ b/src/node_sockaddr-inl.h @@ -12,7 +12,6 @@ namespace node { -namespace { // Fun hash combine trick based on a variadic template that // I came across a while back but can't remember where. Will add an attribution // if I can find the source. @@ -23,7 +22,6 @@ inline void hash_combine(size_t* seed, const T& value, Args... rest) { *seed ^= std::hash{}(value) + 0x9e3779b9 + (*seed << 6) + (*seed >> 2); hash_combine(seed, rest...); } -} // namespace size_t SocketAddress::Hash::operator()(const sockaddr* addr) const { size_t hash = 0;