mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
initialize variables
* string.c (rb_str_enumerate_lines): initialize conditionally used variable. * thread.c (rb_fd_no_init): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c59f2b0382
commit
957e6e4b14
2 changed files with 3 additions and 11 deletions
6
string.c
6
string.c
|
@ -7493,8 +7493,7 @@ rb_str_enumerate_lines(int argc, VALUE *argv, VALUE str, int wantarray)
|
|||
const char *ptr, *pend, *subptr, *subend, *rsptr, *hit, *adjusted;
|
||||
long pos, len, rslen;
|
||||
int rsnewline = 0;
|
||||
|
||||
VALUE MAYBE_UNUSED(ary);
|
||||
VALUE ary = 0;
|
||||
|
||||
if (rb_scan_args(argc, argv, "01:", &rs, &opts) == 0)
|
||||
rs = rb_rs;
|
||||
|
@ -7517,9 +7516,6 @@ rb_str_enumerate_lines(int argc, VALUE *argv, VALUE str, int wantarray)
|
|||
wantarray = 0;
|
||||
#endif
|
||||
}
|
||||
#if defined __GNUC__ && !defined __clang__
|
||||
ASSUME(wantarray || !ary); /* if wantarray, ary does not matter */
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (wantarray)
|
||||
|
|
8
thread.c
8
thread.c
|
@ -3573,9 +3573,7 @@ rb_fd_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds, rb_fdset_t *excep
|
|||
return select(n, r, w, e, timeout);
|
||||
}
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 5
|
||||
# define rb_fd_no_init(fds) ASSUME(!(fds)->fdset && !(fds)->maxfd)
|
||||
#endif
|
||||
#define rb_fd_no_init(fds) (((fds)->fdset = 0), ((fds)->maxfd = 0))
|
||||
|
||||
#undef FD_ZERO
|
||||
#undef FD_SET
|
||||
|
@ -3640,9 +3638,7 @@ rb_fd_set(int fd, rb_fdset_t *set)
|
|||
#define FD_CLR(i, f) rb_fd_clr((i), (f))
|
||||
#define FD_ISSET(i, f) rb_fd_isset((i), (f))
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 5
|
||||
# define rb_fd_no_init(fds) ASSUME(!(fds)->fdset)
|
||||
#endif
|
||||
#define rb_fd_no_init(fds) ((fds)->fdset = 0)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue