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

* vm_core.h: Introduce UNINITIALIZED_VAR() macro.

* thread.c (do_select): Use UNINITIALIZED_VAR() instead FAKE_FD_ZERO().
	  Also, remove FAKE_FD_ZERO completely. [Feature #3018]




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2010-04-06 14:07:06 +00:00
parent 2bbeb4c0ad
commit 75ce78429e
3 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,9 @@
Tue Apr 6 23:01:35 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* vm_core.h: Introduce UNINITIALIZED_VAR() macro.
* thread.c (do_select): Use UNINITIALIZED_VAR() instead FAKE_FD_ZERO().
Also, remove FAKE_FD_ZERO completely. [Feature #3018]
Tue Apr 6 21:55:25 2010 Tanaka Akira <akr@fsij.org>
* configure.in: test localtime(3) overflow. [ruby-dev:40910]

View file

@ -2415,12 +2415,9 @@ do_select(int n, fd_set *read, fd_set *write, fd_set *except,
struct timeval *timeout)
{
int result, lerrno;
fd_set orig_read, orig_write, orig_except;
#if defined __GNUC__ && defined __x86_64__
#define FAKE_FD_ZERO(f) (*(int *)&(f)=0) /* suppress lots of warnings */
#else
#define FAKE_FD_ZERO(f) ((void)0)
#endif
fd_set UNINITIALIZED_VAR(orig_read);
fd_set UNINITIALIZED_VAR(orig_write);
fd_set UNINITIALIZED_VAR(orig_except);
#ifndef linux
double limit = 0;
@ -2442,11 +2439,9 @@ do_select(int n, fd_set *read, fd_set *write, fd_set *except,
}
#endif
if (read) orig_read = *read; else FAKE_FD_ZERO(orig_read);
if (write) orig_write = *write; else FAKE_FD_ZERO(orig_write);
if (except) orig_except = *except; else FAKE_FD_ZERO(orig_except);
#undef FAKE_FD_ZERO
if (read) orig_read = *read;
if (write) orig_write = *write;
if (except) orig_except = *except;
retry:
lerrno = 0;

View file

@ -106,6 +106,12 @@
#define UNLIKELY(x) (x)
#endif /* __GNUC__ >= 3 */
#if __GNUC__ >= 3
#define UNINITIALIZED_VAR(x) x = x
#else
#define UNINITIALIZED_VAR(x) x
#endif
typedef unsigned long rb_num_t;
/* iseq data type */