diff options
author | nobu <nobu@ruby-lang.org> | 2018-09-21 10:19:10 +0000 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2021-09-26 19:16:09 +0900 |
commit | 2d0f2085e8a4023465fbb65c11ebc20767b0863d (patch) | |
tree | f49f4e0fe79f5b5cdf1cf7c57a6b3f329e734e57 | |
parent | fc04f4a8b95cfe353e7ed51f1b9279729b1b7401 (diff) | |
download | ruby-openssl-2d0f2085e8a4023465fbb65c11ebc20767b0863d.tar.gz |
Remove -Wno-parentheses flag.
[ This is a backport to the 2.1 branch. ]
[Fix GH-1958]
From: Jun Aruga <jaruga@redhat.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Suppress more -Wparentheses warnings
[Fix GH-1958]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ky: this is a combined patch of r64806-r64808.]
Sync-with-trunk: r64808
(cherry picked from commit 01b23fa8eee2ff9cc4ef5f6fabca6d999e0979c2)
-rw-r--r-- | ext/openssl/openssl_missing.h | 2 | ||||
-rw-r--r-- | ext/openssl/ossl_pkey.h | 10 | ||||
-rw-r--r-- | ext/openssl/ossl_pkey_dh.c | 2 | ||||
-rw-r--r-- | ext/openssl/ossl_ssl.c | 4 | ||||
-rw-r--r-- | ext/openssl/ossl_x509name.c | 2 |
5 files changed, 11 insertions, 9 deletions
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h index 69a7df71..09998214 100644 --- a/ext/openssl/openssl_missing.h +++ b/ext/openssl/openssl_missing.h @@ -185,7 +185,7 @@ IMPL_KEY_ACCESSOR3(DSA, pqg, p, q, g, (p == obj->p || q == obj->q || g == obj->g #if !defined(OPENSSL_NO_DH) IMPL_PKEY_GETTER(DH, dh) IMPL_KEY_ACCESSOR2(DH, key, pub_key, priv_key, (pub_key == obj->pub_key || (obj->priv_key && priv_key == obj->priv_key))) -IMPL_KEY_ACCESSOR3(DH, pqg, p, q, g, (p == obj->p || obj->q && q == obj->q || g == obj->g)) +IMPL_KEY_ACCESSOR3(DH, pqg, p, q, g, (p == obj->p || (obj->q && q == obj->q) || g == obj->g)) static inline ENGINE *DH_get0_engine(DH *dh) { return dh->engine; } #endif diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h index a2a9fc0d..0db59305 100644 --- a/ext/openssl/ossl_pkey.h +++ b/ext/openssl/ossl_pkey.h @@ -133,9 +133,9 @@ static VALUE ossl_##_keytype##_set_##_group(VALUE self, VALUE v1, VALUE v2, VALU BIGNUM *bn3 = NULL, *orig_bn3 = NIL_P(v3) ? NULL : GetBNPtr(v3);\ \ Get##_type(self, obj); \ - if (orig_bn1 && !(bn1 = BN_dup(orig_bn1)) || \ - orig_bn2 && !(bn2 = BN_dup(orig_bn2)) || \ - orig_bn3 && !(bn3 = BN_dup(orig_bn3))) { \ + if ((orig_bn1 && !(bn1 = BN_dup(orig_bn1))) || \ + (orig_bn2 && !(bn2 = BN_dup(orig_bn2))) || \ + (orig_bn3 && !(bn3 = BN_dup(orig_bn3)))) { \ BN_clear_free(bn1); \ BN_clear_free(bn2); \ BN_clear_free(bn3); \ @@ -163,8 +163,8 @@ static VALUE ossl_##_keytype##_set_##_group(VALUE self, VALUE v1, VALUE v2) \ BIGNUM *bn2 = NULL, *orig_bn2 = NIL_P(v2) ? NULL : GetBNPtr(v2);\ \ Get##_type(self, obj); \ - if (orig_bn1 && !(bn1 = BN_dup(orig_bn1)) || \ - orig_bn2 && !(bn2 = BN_dup(orig_bn2))) { \ + if ((orig_bn1 && !(bn1 = BN_dup(orig_bn1))) || \ + (orig_bn2 && !(bn2 = BN_dup(orig_bn2)))) { \ BN_clear_free(bn1); \ BN_clear_free(bn2); \ ossl_raise(eBNError, NULL); \ diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c index 31f3b8e7..bf4e3f93 100644 --- a/ext/openssl/ossl_pkey_dh.c +++ b/ext/openssl/ossl_pkey_dh.c @@ -262,7 +262,7 @@ ossl_dh_initialize_copy(VALUE self, VALUE other) BIGNUM *pub2 = BN_dup(pub); BIGNUM *priv2 = BN_dup(priv); - if (!pub2 || priv && !priv2) { + if (!pub2 || (priv && !priv2)) { BN_clear_free(pub2); BN_clear_free(priv2); ossl_raise(eDHError, "BN_dup"); diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 29e7b1d6..6ce9ba6a 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -184,8 +184,10 @@ ossl_sslctx_set_minmax_proto_version(VALUE self, VALUE min_v, VALUE max_v) for (i = 0; i < numberof(options_map); i++) { sum |= options_map[i].opts; - if (min && min > options_map[i].ver || max && max < options_map[i].ver) + if ((min && min > options_map[i].ver) || + (max && max < options_map[i].ver)) { opts |= options_map[i].opts; + } } SSL_CTX_clear_options(ctx, sum); SSL_CTX_set_options(ctx, opts); diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c index 0053f2e3..1ea8400d 100644 --- a/ext/openssl/ossl_x509name.c +++ b/ext/openssl/ossl_x509name.c @@ -270,7 +270,7 @@ x509name_print(VALUE self, unsigned long iflag) if (!out) ossl_raise(eX509NameError, NULL); ret = X509_NAME_print_ex(out, name, 0, iflag); - if (ret < 0 || iflag == XN_FLAG_COMPAT && ret == 0) { + if (ret < 0 || (iflag == XN_FLAG_COMPAT && ret == 0)) { BIO_free(out); ossl_raise(eX509NameError, "X509_NAME_print_ex"); } |