summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-19 03:19:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-19 03:19:20 +0000
commit038c0e5a804f1736e884f6741b9d7e84606580d7 (patch)
tree4505d88a455683259c327e042217988ed550ba67
parentab32fbdbf980661c38a8129809b8c9129bb54e1c (diff)
ext: suppress warnings
* ext/{etc,openssl,tk}: Adding parens and comparisons around assignments to get rid of Wparentheses warnings. [Fix GH-875] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/etc/etc.c12
-rw-r--r--ext/openssl/ossl_ssl.c2
-rw-r--r--ext/tk/tkutil/tkutil.c8
4 files changed, 16 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index e1d0b2b..3e4ea1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Apr 19 12:19:17 2015 Chad Brewbaker <crb002@gmail.com>
+
+ * ext/{etc,openssl,tk}: Adding parens and comparisons around
+ assignments to get rid of Wparentheses warnings. [Fix GH-875]
+
Sun Apr 19 10:42:54 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (get_env_cstr): environment variables must be ASCII
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 4173d33..ddd9441 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -241,7 +241,7 @@ passwd_iterate(void)
struct passwd *pw;
setpwent();
- while (pw = getpwent()) {
+ while ((pw = getpwent()) != 0) {
rb_yield(setup_passwd(pw));
}
return Qnil;
@@ -287,7 +287,7 @@ etc_passwd(VALUE obj)
if (rb_block_given_p()) {
each_passwd();
}
- else if (pw = getpwent()) {
+ else if ((pw = getpwent()) != 0) {
return setup_passwd(pw);
}
#endif
@@ -369,7 +369,7 @@ etc_getpwent(VALUE obj)
#ifdef HAVE_GETPWENT
struct passwd *pw;
- if (pw = getpwent()) {
+ if ((pw = getpwent()) != 0) {
return setup_passwd(pw);
}
#endif
@@ -485,7 +485,7 @@ group_iterate(void)
struct group *pw;
setgrent();
- while (pw = getgrent()) {
+ while ((pw = getgrent()) != 0) {
rb_yield(setup_group(pw));
}
return Qnil;
@@ -527,7 +527,7 @@ etc_group(VALUE obj)
if (rb_block_given_p()) {
each_group();
}
- else if (grp = getgrent()) {
+ else if ((grp = getgrent()) != 0) {
return setup_group(grp);
}
#endif
@@ -606,7 +606,7 @@ etc_getgrent(VALUE obj)
#ifdef HAVE_GETGRENT
struct group *gr;
- if (gr = getgrent()) {
+ if ((gr = getgrent()) != 0) {
return setup_group(gr);
}
#endif
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 2e12835..9306b1e 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1124,7 +1124,7 @@ ossl_ssl_shutdown(SSL *ssl)
* Ignore the case SSL_shutdown returns -1. Empty handshake_func
* must not happen.
*/
- if (rc = SSL_shutdown(ssl))
+ if ((rc = SSL_shutdown(ssl)) != 0)
break;
}
SSL_clear(ssl);
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index c1c4e3fa..9fcae0e 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -1356,7 +1356,7 @@ cbsubst_sym_to_subst(self, sym)
*(ptr++) = '%';
- if (len = inf->keylen[idx]) {
+ if ((len = inf->keylen[idx]) != 0) {
/* longname */
strncpy(ptr, inf->key[idx], len);
ptr += len;
@@ -1426,7 +1426,7 @@ cbsubst_get_subst_arg(argc, argv, self)
*(ptr++) = '%';
- if (len = inf->keylen[idx]) {
+ if ((len = inf->keylen[idx]) != 0) {
/* longname */
strncpy(ptr, inf->key[idx], len);
ptr += len;
@@ -1523,7 +1523,7 @@ cbsubst_get_all_subst_keys(self)
*(ptr++) = '%';
- if (len = inf->keylen[idx]) {
+ if ((len = inf->keylen[idx]) != 0) {
/* longname */
strncpy(ptr, inf->key[idx], len);
ptr += len;
@@ -1691,7 +1691,7 @@ cbsubst_scan_args(self, arg_key, val_ary)
} else if (*(keyptr + idx) == ' ') {
proc = Qnil;
} else {
- if (type_chr = inf->type[*(keyptr + idx)]) {
+ if ((type_chr = inf->type[*(keyptr + idx)]) != 0) {
proc = rb_hash_aref(inf->proc, INT2FIX((int)type_chr));
} else {
proc = Qnil;