Browse Source

src: fix readability/nolint cpplint warnings

PR-URL: https://github.com/nodejs/node/pull/7462
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
v6.x
Ben Noordhuis 9 years ago
committed by Jeremiah Senkpiel
parent
commit
1fa6dba8f2
  1. 4
      src/node_crypto.cc
  2. 5
      src/spawn_sync.cc

4
src/node_crypto.cc

@ -175,7 +175,7 @@ template int SSLWrap<TLSWrap>::SelectALPNCallback(
#endif // TLSEXT_TYPE_application_layer_protocol_negotiation #endif // TLSEXT_TYPE_application_layer_protocol_negotiation
static void crypto_threadid_cb(CRYPTO_THREADID* tid) { static void crypto_threadid_cb(CRYPTO_THREADID* tid) {
static_assert(sizeof(uv_thread_t) <= sizeof(void*), // NOLINT(runtime/sizeof) static_assert(sizeof(uv_thread_t) <= sizeof(void*),
"uv_thread_t does not fit in a pointer"); "uv_thread_t does not fit in a pointer");
CRYPTO_THREADID_set_pointer(tid, reinterpret_cast<void*>(uv_thread_self())); CRYPTO_THREADID_set_pointer(tid, reinterpret_cast<void*>(uv_thread_self()));
} }
@ -693,7 +693,7 @@ void SecureContext::AddCACert(const FunctionCallbackInfo<Value>& args) {
unsigned cert_count = 0; unsigned cert_count = 0;
if (BIO* bio = LoadBIO(env, args[0])) { if (BIO* bio = LoadBIO(env, args[0])) {
while (X509* x509 = // NOLINT(whitespace/if-one-line) while (X509* x509 =
PEM_read_bio_X509(bio, nullptr, CryptoPemCallback, nullptr)) { PEM_read_bio_X509(bio, nullptr, CryptoPemCallback, nullptr)) {
X509_STORE_add_cert(sc->ca_store_, x509); X509_STORE_add_cert(sc->ca_store_, x509);
SSL_CTX_add_client_CA(sc->ctx_, x509); SSL_CTX_add_client_CA(sc->ctx_, x509);

5
src/spawn_sync.cc

@ -992,7 +992,7 @@ int SyncProcessRunner::CopyJsStringArray(Local<Value> js_value,
data_size = 0; data_size = 0;
for (uint32_t i = 0; i < length; i++) { for (uint32_t i = 0; i < length; i++) {
data_size += StringBytes::StorageSize(isolate, js_array->Get(i), UTF8) + 1; data_size += StringBytes::StorageSize(isolate, js_array->Get(i), UTF8) + 1;
data_size = ROUND_UP(data_size, sizeof(void*)); // NOLINT(runtime/sizeof) data_size = ROUND_UP(data_size, sizeof(void*));
} }
buffer = new char[list_size + data_size]; buffer = new char[list_size + data_size];
@ -1008,8 +1008,7 @@ int SyncProcessRunner::CopyJsStringArray(Local<Value> js_value,
js_array->Get(i), js_array->Get(i),
UTF8); UTF8);
buffer[data_offset++] = '\0'; buffer[data_offset++] = '\0';
data_offset = ROUND_UP(data_offset, data_offset = ROUND_UP(data_offset, sizeof(void*));
sizeof(void*)); // NOLINT(runtime/sizeof)
} }
list[length] = nullptr; list[length] = nullptr;

Loading…
Cancel
Save