1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2015-04-19 03:19:20 +00:00
parent ab32fbdbf9
commit 038c0e5a80
4 changed files with 16 additions and 11 deletions

View file

@ -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

View file

@ -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

View file

@ -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);

View file

@ -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;