diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 5ac43f3197aaae..26877f3ddd8f69 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -25,6 +25,7 @@ #include "base_object-inl.h" #include "env-inl.h" #include "memory_tracker-inl.h" +#include "nbytes.h" #include "node.h" #include "node_errors.h" #include "node_external_reference.h" @@ -32,7 +33,6 @@ #include "util-inl.h" #include "uv.h" #include "v8.h" -#include "nbytes.h" #include #include @@ -1820,7 +1820,8 @@ void SetLocalAddress(const FunctionCallbackInfo& args) { THROW_ERR_INVALID_ARG_VALUE(env, "Cannot specify two IPv4 addresses."); return; } else { - ares_set_local_ip4(channel->cares_channel(), nbytes::ReadUint32BE(addr1)); + ares_set_local_ip4(channel->cares_channel(), + nbytes::ReadUint32BE(addr1)); } } else if (uv_inet_pton(AF_INET6, *ip1, &addr1) == 0) { if (type0 == 6) { diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index 11e8836fbc450e..4da42cf4147bf6 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -2,13 +2,13 @@ #include "base_object-inl.h" #include "env-inl.h" #include "memory_tracker-inl.h" +#include "nbytes.h" #include "node.h" #include "node_buffer.h" #include "node_crypto.h" #include "node_internals.h" #include "string_bytes.h" #include "v8.h" -#include "nbytes.h" #include #include @@ -93,8 +93,8 @@ void LogSecret( std::string line = name; line += " " + nbytes::HexEncode(reinterpret_cast(crandom), kTlsClientRandomSize); - line += " " + nbytes::HexEncode(reinterpret_cast(secret), - secretlen); + line += + " " + nbytes::HexEncode(reinterpret_cast(secret), secretlen); keylog_cb(ssl.get(), line.c_str()); } diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index 0c77ad38e5e993..5246b9170a7a78 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -1,8 +1,8 @@ #include "inspector_socket.h" #include "llhttp.h" -#include "simdutf.h" #include "nbytes.h" +#include "simdutf.h" #include "util-inl.h" #include "openssl/sha.h" // Sha-1 hash diff --git a/src/node_buffer.cc b/src/node_buffer.cc index e7ef9a7e2262db..53e4f2888fffdc 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -35,9 +35,9 @@ #include "v8-fast-api-calls.h" #include "v8.h" -#include "nbytes.h" -#include #include +#include +#include "nbytes.h" #define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \ THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument") \ diff --git a/src/node_http_common-inl.h b/src/node_http_common-inl.h index 78037f7e92faa0..dba1a5e051b3e0 100644 --- a/src/node_http_common-inl.h +++ b/src/node_http_common-inl.h @@ -7,8 +7,8 @@ #include "env-inl.h" #include "v8.h" -#include "nbytes.h" #include +#include "nbytes.h" namespace node { diff --git a/src/node_i18n.cc b/src/node_i18n.cc index 14c41660d1a36f..7a13f35d2f2bcb 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -54,7 +54,6 @@ #include "util-inl.h" #include "v8.h" -#include "nbytes.h" #include #include #include @@ -70,6 +69,7 @@ #include #include #include +#include "nbytes.h" #ifdef NODE_HAVE_SMALL_ICU /* if this is defined, we have a 'secondary' entry point. diff --git a/src/node_sockaddr.cc b/src/node_sockaddr.cc index 057cf3c056cfba..e1572187437f1b 100644 --- a/src/node_sockaddr.cc +++ b/src/node_sockaddr.cc @@ -1,10 +1,11 @@ -#include "node_sockaddr-inl.h" // NOLINT(build/include) -#include "env-inl.h" +#include "node_sockaddr.h" // NOLINT(build/include_inline) #include "base_object-inl.h" +#include "env-inl.h" #include "memory_tracker-inl.h" +#include "nbytes.h" #include "node_errors.h" +#include "node_sockaddr-inl.h" // NOLINT(build/include_inline) #include "uv.h" -#include "nbytes.h" #include #include diff --git a/src/quic/cid.cc b/src/quic/cid.cc index a017502deeb2ac..404b98c47d6c19 100644 --- a/src/quic/cid.cc +++ b/src/quic/cid.cc @@ -4,8 +4,8 @@ #include #include #include -#include "quic/defs.h" #include "nbytes.h" +#include "quic/defs.h" namespace node { namespace quic { @@ -72,11 +72,10 @@ size_t CID::length() const { std::string CID::ToString() const { char dest[kMaxLength * 2]; - size_t written = - nbytes::HexEncode(reinterpret_cast(ptr_->data), - ptr_->datalen, - dest, - arraysize(dest)); + size_t written = nbytes::HexEncode(reinterpret_cast(ptr_->data), + ptr_->datalen, + dest, + arraysize(dest)); return std::string(dest, written); } diff --git a/src/quic/tokens.cc b/src/quic/tokens.cc index 045c5f9a050d05..e2c03d49c1b32f 100644 --- a/src/quic/tokens.cc +++ b/src/quic/tokens.cc @@ -50,8 +50,8 @@ TokenSecret::operator const char*() const { std::string TokenSecret::ToString() const { char dest[QUIC_TOKENSECRET_LEN * 2]; - size_t written = nbytes::HexEncode( - *this, QUIC_TOKENSECRET_LEN, dest, arraysize(dest)); + size_t written = + nbytes::HexEncode(*this, QUIC_TOKENSECRET_LEN, dest, arraysize(dest)); DCHECK_EQ(written, arraysize(dest)); return std::string(dest, written); } diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index bbaf073ee69bdf..36570d069ad00b 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -27,9 +27,8 @@ #include "string_bytes.h" #include "util-inl.h" -#include "nbytes.h" #include - +#include "nbytes.h" namespace node { diff --git a/src/string_bytes.cc b/src/string_bytes.cc index dda14fe49e7634..3e2b29005a2012 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -22,11 +22,11 @@ #include "string_bytes.h" #include "env-inl.h" +#include "nbytes.h" #include "node_buffer.h" #include "node_errors.h" #include "simdutf.h" #include "util.h" -#include "nbytes.h" #include #include // memcpy @@ -295,7 +295,8 @@ size_t StringBytes::Write(Isolate* isolate, // The input does not follow the WHATWG forgiving-base64 specification // adapted for base64url // https://infra.spec.whatwg.org/#forgiving-base64-decode - nbytes = nbytes::Base64Decode(buf, buflen, ext->data(), ext->length()); + nbytes = + nbytes::Base64Decode(buf, buflen, ext->data(), ext->length()); } } else if (str->IsOneByte()) { MaybeStackBuffer stack_buf(str->Length()); @@ -317,7 +318,8 @@ size_t StringBytes::Write(Isolate* isolate, // The input does not follow the WHATWG forgiving-base64 specification // (adapted for base64url with + and / replaced by - and _). // https://infra.spec.whatwg.org/#forgiving-base64-decode - nbytes = nbytes::Base64Decode(buf, buflen, *stack_buf, stack_buf.length()); + nbytes = + nbytes::Base64Decode(buf, buflen, *stack_buf, stack_buf.length()); } } else { String::Value value(isolate, str); @@ -350,7 +352,8 @@ size_t StringBytes::Write(Isolate* isolate, } else { // The input does not follow the WHATWG forgiving-base64 specification // https://infra.spec.whatwg.org/#forgiving-base64-decode - nbytes = nbytes::Base64Decode(buf, buflen, ext->data(), ext->length()); + nbytes = + nbytes::Base64Decode(buf, buflen, ext->data(), ext->length()); } } else if (str->IsOneByte()) { MaybeStackBuffer stack_buf(str->Length()); @@ -371,7 +374,8 @@ size_t StringBytes::Write(Isolate* isolate, // The input does not follow the WHATWG forgiving-base64 specification // (adapted for base64url with + and / replaced by - and _). // https://infra.spec.whatwg.org/#forgiving-base64-decode - nbytes = nbytes::Base64Decode(buf, buflen, *stack_buf, stack_buf.length()); + nbytes = + nbytes::Base64Decode(buf, buflen, *stack_buf, stack_buf.length()); } } else { String::Value value(isolate, str); diff --git a/test/cctest/test_base64.cc b/test/cctest/test_base64.cc index ac690d29c5c1cc..4f1bc9173b6818 100644 --- a/test/cctest/test_base64.cc +++ b/test/cctest/test_base64.cc @@ -1,6 +1,6 @@ #include "nbytes.h" -#include "util-inl.h" #include "simdutf.h" +#include "util-inl.h" #include #include