Skip to content

Commit

Permalink
src: update linting/formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Jun 19, 2024
1 parent 64c79e1 commit 81fb3b1
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 29 deletions.
5 changes: 3 additions & 2 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
#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"
#include "req_wrap-inl.h"
#include "util-inl.h"
#include "uv.h"
#include "v8.h"
#include "nbytes.h"

#include <cerrno>
#include <cstring>
Expand Down Expand Up @@ -1820,7 +1820,8 @@ void SetLocalAddress(const FunctionCallbackInfo<Value>& 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) {
Expand Down
6 changes: 3 additions & 3 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <openssl/ec.h>
#include <openssl/ecdh.h>
Expand Down Expand Up @@ -93,8 +93,8 @@ void LogSecret(
std::string line = name;
line += " " + nbytes::HexEncode(reinterpret_cast<const char*>(crandom),
kTlsClientRandomSize);
line += " " + nbytes::HexEncode(reinterpret_cast<const char*>(secret),
secretlen);
line +=
" " + nbytes::HexEncode(reinterpret_cast<const char*>(secret), secretlen);
keylog_cb(ssl.get(), line.c_str());
}

Expand Down
2 changes: 1 addition & 1 deletion src/inspector_socket.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
#include "v8-fast-api-calls.h"
#include "v8.h"

#include "nbytes.h"
#include <cstring>
#include <climits>
#include <cstring>
#include "nbytes.h"

#define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \
THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument") \
Expand Down
2 changes: 1 addition & 1 deletion src/node_http_common-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "env-inl.h"
#include "v8.h"

#include "nbytes.h"
#include <algorithm>
#include "nbytes.h"

namespace node {

Expand Down
2 changes: 1 addition & 1 deletion src/node_i18n.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include "util-inl.h"
#include "v8.h"

#include "nbytes.h"
#include <unicode/putil.h>
#include <unicode/timezone.h>
#include <unicode/uchar.h>
Expand All @@ -70,6 +69,7 @@
#include <unicode/utypes.h>
#include <unicode/uvernum.h>
#include <unicode/uversion.h>
#include "nbytes.h"

#ifdef NODE_HAVE_SMALL_ICU
/* if this is defined, we have a 'secondary' entry point.
Expand Down
7 changes: 4 additions & 3 deletions src/node_sockaddr.cc
Original file line number Diff line number Diff line change
@@ -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 <memory>
#include <string>
Expand Down
11 changes: 5 additions & 6 deletions src/quic/cid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <memory_tracker-inl.h>
#include <node_mutex.h>
#include <string_bytes.h>
#include "quic/defs.h"
#include "nbytes.h"
#include "quic/defs.h"

namespace node {
namespace quic {
Expand Down Expand Up @@ -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<const char*>(ptr_->data),
ptr_->datalen,
dest,
arraysize(dest));
size_t written = nbytes::HexEncode(reinterpret_cast<const char*>(ptr_->data),
ptr_->datalen,
dest,
arraysize(dest));
return std::string(dest, written);
}

Expand Down
4 changes: 2 additions & 2 deletions src/quic/tokens.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/spawn_sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
#include "string_bytes.h"
#include "util-inl.h"

#include "nbytes.h"
#include <cstring>

#include "nbytes.h"

namespace node {

Expand Down
14 changes: 9 additions & 5 deletions src/string_bytes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <climits>
#include <cstring> // memcpy
Expand Down Expand Up @@ -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<uint8_t> stack_buf(str->Length());
Expand All @@ -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);
Expand Down Expand Up @@ -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<uint8_t> stack_buf(str->Length());
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/cctest/test_base64.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "nbytes.h"
#include "util-inl.h"
#include "simdutf.h"
#include "util-inl.h"

#include <cstddef>
#include <cstring>
Expand Down

0 comments on commit 81fb3b1

Please sign in to comment.