diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-22 08:49:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-22 08:49:47 +0000 |
commit | 083b923ea80ae15cb4b623bca71d92d083073da4 (patch) | |
tree | 9b9e4b1fbe3b2e91c24557e276d57ad6d0819bde | |
parent | a0ef626241b3438361f98ab7cc289150cc286d98 (diff) | |
download | ruby-083b923ea80ae15cb4b623bca71d92d083073da4.tar.gz |
* win32/win32.c (_pioinfo): make an inline function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | win32/win32.c | 9 |
2 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Tue Nov 22 17:49:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * win32/win32.c (_pioinfo): make an inline function. + Tue Nov 22 11:26:08 2011 NARUSE, Yui <naruse@ruby-lang.org> Tue Nov 22 11:33:58 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> diff --git a/win32/win32.c b/win32/win32.c index 89bca5ac4f..a2b24c764d 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2159,7 +2159,6 @@ EXTERN_C _CRTIMP ioinfo * __pioinfo[]; #define IOINFO_L2E 5 #define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) -#define _pioinfo(i) ((ioinfo*)((char*)(__pioinfo[i >> IOINFO_L2E]) + (i & (IOINFO_ARRAY_ELTS - 1)) * (sizeof(ioinfo) + pioinfo_extra))) #define _osfhnd(i) (_pioinfo(i)->osfhnd) #define _osfile(i) (_pioinfo(i)->osfile) #define _pipech(i) (_pioinfo(i)->pipech) @@ -2190,6 +2189,14 @@ set_pioinfo_extra(void) #define pioinfo_extra 0 #endif +static inline ioinfo* +_pioinfo(int fd) +{ + const size_t sizeof_ioinfo = sizeof(ioinfo) + pioinfo_extra; + return (ioinfo*)((char*)__pioinfo[fd >> IOINFO_L2E] + + (fd & (IOINFO_ARRAY_ELTS - 1)) * sizeof_ioinfo); +} + #define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh) #define _set_osflags(fh, flags) (_osfile(fh) = (flags)) |