Permalink
Browse files

fix compiler warnings

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@4047 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
lrz committed May 8, 2010
1 parent 37adc27 commit 4b9b95e2cfcc90699ccc1413e2a6e604d74ee359
Showing with 6 additions and 6 deletions.
  1. +6 −6 ext/etc/etc.c
View
@@ -177,7 +177,7 @@ passwd_iterate(void)
struct passwd *pw;
setpwent();
- while (pw = getpwent()) {
+ while ((pw = getpwent()) != NULL) {
rb_yield(setup_passwd(pw));
}
endpwent();
@@ -214,7 +214,7 @@ etc_passwd(VALUE obj, SEL sel)
passwd_blocking = Qtrue;
rb_ensure(passwd_iterate, 0, passwd_ensure, 0);
}
- if (pw = getpwent()) {
+ if ((pw = getpwent()) != NULL) {
return setup_passwd(pw);
}
#endif
@@ -277,7 +277,7 @@ etc_getpwent(VALUE obj, SEL sel)
#ifdef HAVE_GETPWENT
struct passwd *pw;
- if (pw = getpwent()) {
+ if ((pw = getpwent()) != NULL) {
return setup_passwd(pw);
}
#endif
@@ -381,7 +381,7 @@ group_iterate(void)
struct group *pw;
setgrent();
- while (pw = getgrent()) {
+ while ((pw = getgrent()) != NULL) {
rb_yield(setup_group(pw));
}
endgrent();
@@ -418,7 +418,7 @@ etc_group(VALUE obj, SEL sel)
group_blocking = Qtrue;
rb_ensure(group_iterate, 0, group_ensure, 0);
}
- if (grp = getgrent()) {
+ if ((grp = getgrent()) != NULL) {
return setup_group(grp);
}
#endif
@@ -475,7 +475,7 @@ etc_getgrent(VALUE obj, SEL sel)
#ifdef HAVE_GETGRENT
struct group *gr;
- if (gr = getgrent()) {
+ if ((gr = getgrent()) != NULL) {
return setup_group(gr);
}
#endif

0 comments on commit 4b9b95e

Please sign in to comment.