Differences From Artifact [0d55873c55]:
- File
src/OFStreamObserver_select.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 4103) [annotate] [blame] [check-ins using]
To Artifact [855b79f521]:
- File src/OFStreamObserver_select.m — part of check-in [ab9ad6e515] at 2013-04-30 22:47:28 on branch trunk — observeWithTimeout: -> observeForTimeInterval:. (user: js, size: 4165) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | */ #include "config.h" #define __NO_EXT_QNX #include <string.h> #include <unistd.h> #include <sys/time.h> #import "OFStreamObserver_select.h" #import "OFStream.h" #import "OFArray.h" | > | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | */ #include "config.h" #define __NO_EXT_QNX #include <string.h> #include <math.h> #include <unistd.h> #include <sys/time.h> #import "OFStreamObserver_select.h" #import "OFStream.h" #import "OFArray.h" |
︙ | ︙ | |||
67 68 69 70 71 72 73 | { FD_CLR(fd, &_writeFDs); if (!FD_ISSET(fd, &_readFDs)) FD_CLR(fd, &_exceptFDs); } | | | | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | { FD_CLR(fd, &_writeFDs); if (!FD_ISSET(fd, &_readFDs)) FD_CLR(fd, &_exceptFDs); } - (bool)observeForTimeInterval: (double)timeInterval { void *pool = objc_autoreleasePoolPush(); OFStream **objects; fd_set readFDs; fd_set writeFDs; fd_set exceptFDs; struct timeval timeout; size_t i, count, realEvents = 0; [self OF_processQueue]; if ([self OF_processCache]) { objc_autoreleasePoolPop(pool); return true; |
︙ | ︙ | |||
102 103 104 105 106 107 108 | /* * We cast to int before assigning to tv_usec in order to avoid a * warning with Apple GCC on PPC. POSIX defines this as suseconds_t, * however, this is not available on Win32. As an int should always * satisfy the required range, we just cast to int. */ | | | | | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | /* * We cast to int before assigning to tv_usec in order to avoid a * warning with Apple GCC on PPC. POSIX defines this as suseconds_t, * however, this is not available on Win32. As an int should always * satisfy the required range, we just cast to int. */ timeout.tv_sec = (time_t)timeInterval; timeout.tv_usec = (int)lrint((timeInterval - timeout.tv_sec) * 1000); if (select((int)_maxFD + 1, &readFDs, &writeFDs, &exceptFDs, (timeInterval != -1 ? &timeout : NULL)) < 1) return false; if (FD_ISSET(_cancelFD[0], &readFDs)) { char buffer; #ifndef _WIN32 OF_ENSURE(read(_cancelFD[0], &buffer, 1) > 0); #else |
︙ | ︙ |