ruby-changes:52596
From: nobu <ko1@a...>
Date: Fri, 21 Sep 2018 19:31:18 +0900 (JST)
Subject: [ruby-changes:52596] nobu:r64808 (trunk): Suppress more -Wparentheses warnings
nobu 2018-09-21 19:31:11 +0900 (Fri, 21 Sep 2018) New Revision: 64808 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64808 Log: Suppress more -Wparentheses warnings [Fix GH-1958] Modified files: trunk/dir.c trunk/ext/openssl/openssl_missing.h trunk/ext/openssl/ossl_ssl.c trunk/win32/win32.c Index: dir.c =================================================================== --- dir.c (revision 64807) +++ dir.c (revision 64808) @@ -177,7 +177,7 @@ has_nonascii(const char *ptr, size_t len https://github.com/ruby/ruby/blob/trunk/dir.c#L177 #endif #ifndef IFTODT -# define IFTODT(m) (((m) & S_IFMT) / ((~S_IFMT & S_IFMT-1) + 1)) +# define IFTODT(m) (((m) & S_IFMT) / ((~S_IFMT & (S_IFMT-1)) + 1)) #endif typedef enum { Index: win32/win32.c =================================================================== --- win32/win32.c (revision 64807) +++ win32/win32.c (revision 64808) @@ -6686,7 +6686,8 @@ constat_apply(HANDLE handle, struct cons https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L6686 COORD pos; if (!GetConsoleScreenBufferInfo(handle, &csbi)) return; - if (arg0 = (count > 0 && seq[0] > 0)) arg1 = seq[0]; + arg0 = (count > 0 && seq[0] > 0); + if (arg0) arg1 = seq[0]; switch (w) { case L'm': SetConsoleTextAttribute(handle, constat_attr(count, seq, csbi.wAttributes, s->vt100.attr, &s->vt100.reverse)); Index: ext/openssl/ossl_ssl.c =================================================================== --- ext/openssl/ossl_ssl.c (revision 64807) +++ ext/openssl/ossl_ssl.c (revision 64808) @@ -184,8 +184,10 @@ ossl_sslctx_set_minmax_proto_version(VAL https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_ssl.c#L184 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); Index: ext/openssl/openssl_missing.h =================================================================== --- ext/openssl/openssl_missing.h (revision 64807) +++ ext/openssl/openssl_missing.h (revision 64808) @@ -185,7 +185,7 @@ IMPL_KEY_ACCESSOR3(DSA, pqg, p, q, g, (p https://github.com/ruby/ruby/blob/trunk/ext/openssl/openssl_missing.h#L185 #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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/