Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: remove void casts for clear_error_on_return #13669

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,6 @@ void SecureContext::AddCACert(const FunctionCallbackInfo<Value>& args) {
SecureContext* sc;
ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

if (args.Length() != 1) {
return env->ThrowTypeError("CA certificate argument is mandatory");
Expand Down Expand Up @@ -806,7 +805,6 @@ void SecureContext::AddCRL(const FunctionCallbackInfo<Value>& args) {
}

ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

BIO *bio = LoadBIO(env, args[0]);
if (!bio)
Expand Down Expand Up @@ -872,7 +870,6 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& args) {
SecureContext* sc;
ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

if (!root_cert_store) {
root_cert_store = NewRootCertStore();
Expand Down Expand Up @@ -901,7 +898,6 @@ void SecureContext::SetCiphers(const FunctionCallbackInfo<Value>& args) {
ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
Environment* env = sc->env();
ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

if (args.Length() != 1) {
return env->ThrowTypeError("Ciphers argument is mandatory");
Expand Down Expand Up @@ -948,7 +944,6 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
ASSIGN_OR_RETURN_UNWRAP(&sc, args.This());
Environment* env = sc->env();
ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

// Auto DH is not supported in openssl 1.0.1, so dhparam needs
// to be specified explicitly
Expand Down Expand Up @@ -1073,7 +1068,6 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
SecureContext* sc;
ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

if (args.Length() < 1) {
return env->ThrowTypeError("PFX certificate argument is mandatory");
Expand Down Expand Up @@ -1697,7 +1691,6 @@ void SSLWrap<Base>::GetPeerCertificate(
Environment* env = w->ssl_env();

ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence unused variable warning.

Local<Object> result;
Local<Object> info;
Expand Down Expand Up @@ -1894,7 +1887,6 @@ void SSLWrap<Base>::Renegotiate(const FunctionCallbackInfo<Value>& args) {
ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());

ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence unused variable warning.

bool yes = SSL_renegotiate(w->ssl_) == 1;
args.GetReturnValue().Set(yes);
Expand Down Expand Up @@ -2644,7 +2636,6 @@ int Connection::HandleSSLError(const char* func,
ZeroStatus zs,
SyscallStatus ss) {
ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence unused variable warning.

if (rv > 0)
return rv;
Expand Down Expand Up @@ -4259,7 +4250,6 @@ void Sign::SignFinal(const FunctionCallbackInfo<Value>& args) {
md_value = new unsigned char[md_len];

ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

Error err = sign->SignFinal(
buf,
Expand Down Expand Up @@ -4382,7 +4372,6 @@ SignBase::Error Verify::VerifyFinal(const char* key_pem,
return kSignNotInitialised;

ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

EVP_PKEY* pkey = nullptr;
BIO* bp = nullptr;
Expand Down Expand Up @@ -4614,7 +4603,6 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo<Value>& args) {
size_t out_len = 0;

ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

bool r = Cipher<operation, EVP_PKEY_cipher_init, EVP_PKEY_cipher>(
kbuf,
Expand Down Expand Up @@ -4922,7 +4910,6 @@ void DiffieHellman::ComputeSecret(const FunctionCallbackInfo<Value>& args) {
}

ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.
BIGNUM* key = nullptr;

if (args.Length() == 0) {
Expand Down Expand Up @@ -6165,7 +6152,6 @@ void SetEngine(const FunctionCallbackInfo<Value>& args) {
unsigned int flags = args[1]->Uint32Value();

ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.

const node::Utf8Value engine_id(env->isolate(), args[0]);
ENGINE* engine = ENGINE_by_id(*engine_id);
Expand Down