summaryrefslogtreecommitdiff
path: root/ext/etc
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 /ext/etc
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
Diffstat (limited to 'ext/etc')
-rw-r--r--ext/etc/etc.c12
1 files changed, 6 insertions, 6 deletions
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