Differences From Artifact [851bfffddf]:
- File
src/OFKernelEventObserver_select.m
— part of check-in
[e74fc30f5b]
at
2016-05-28 14:56:45
on branch trunk
— OFKernelEventObserver_select: Cast to of_socket_t
This makes sure the correct type is used for FD_*. (user: js, size: 5045) [annotate] [blame] [check-ins using]
To Artifact [8eb037b6d9]:
- File
src/OFKernelEventObserver_select.m
— part of check-in
[d9398f2439]
at
2016-05-29 18:36:44
on branch trunk
— OFKernelEventObserver: Cast FD_SETSIZE to int
FreeBSD stupidly defines this as 1024U, which breaks -Wsign-compare. (user: js, size: 5070) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
44 45 46 47 48 49 50 | @implementation OFKernelEventObserver_select - init { self = [super init]; #ifndef OF_WINDOWS | | | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | @implementation OFKernelEventObserver_select - init { self = [super init]; #ifndef OF_WINDOWS if (_cancelFD[0] >= (int)FD_SETSIZE) @throw [OFInitializationFailedException exception]; #endif FD_ZERO(&_readFDs); FD_ZERO(&_writeFDs); FD_SET(_cancelFD[0], &_readFDs); |
︙ | ︙ | |||
68 69 70 71 72 73 74 | { int fd = [object fileDescriptorForReading]; if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; #ifndef OF_WINDOWS | | | | | | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | { int fd = [object fileDescriptorForReading]; if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; #ifndef OF_WINDOWS if (fd >= (int)FD_SETSIZE) @throw [OFOutOfRangeException exception]; #endif if (fd > _maxFD) _maxFD = fd; FD_SET((of_socket_t)fd, &_readFDs); } - (void)OF_addObjectForWriting: (id <OFReadyForWritingObserving>)object { int fd = [object fileDescriptorForWriting]; if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; #ifndef OF_WINDOWS if (fd >= (int)FD_SETSIZE) @throw [OFOutOfRangeException exception]; #endif if (fd > _maxFD) _maxFD = fd; FD_SET((of_socket_t)fd, &_writeFDs); } - (void)OF_removeObjectForReading: (id <OFReadyForReadingObserving>)object { /* TODO: Adjust _maxFD */ int fd = [object fileDescriptorForReading]; if (fd < 0) @throw [OFOutOfRangeException exception]; #ifndef OF_WINDOWS if (fd >= (int)FD_SETSIZE) @throw [OFOutOfRangeException exception]; #endif FD_CLR((of_socket_t)fd, &_readFDs); } - (void)OF_removeObjectForWriting: (id <OFReadyForWritingObserving>)object { /* TODO: Adjust _maxFD */ int fd = [object fileDescriptorForWriting]; if (fd < 0) @throw [OFOutOfRangeException exception]; #ifndef OF_WINDOWS if (fd >= (int)FD_SETSIZE) @throw [OFOutOfRangeException exception]; #endif FD_CLR((of_socket_t)fd, &_writeFDs); } - (void)observeForTimeInterval: (of_time_interval_t)timeInterval |
︙ | ︙ |