Differences From Artifact [8827a4d942]:
- File src/OFStreamObserver_kqueue.m — part of check-in [a39a0d7bec] at 2012-10-09 22:02:40 on branch trunk — Silence warnings about implicit float to int casts (user: js, size: 3662) [annotate] [blame] [check-ins using]
To Artifact [1e1bf29b71]:
- File
src/OFStreamObserver_kqueue.m
— part of check-in
[19df6b304d]
at
2012-12-11 23:26:49
on branch trunk
— OFStreamObserver_kqueue: Integer overflow check.
This is only relevant for platforms on which kqueue uses int for the
number of events instead of size_t. (user: js, size: 3904) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #include <sys/time.h> #import "OFStreamObserver_kqueue.h" #import "OFDataArray.h" #import "OFInitializationFailedException.h" #import "OFOutOfMemoryException.h" #import "autorelease.h" #import "macros.h" #define EVENTLIST_SIZE 64 @implementation OFStreamObserver_kqueue | > | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | #include <sys/time.h> #import "OFStreamObserver_kqueue.h" #import "OFDataArray.h" #import "OFInitializationFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" #define EVENTLIST_SIZE 64 @implementation OFStreamObserver_kqueue |
︙ | ︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | [super dealloc]; } - (void)OF_addFileDescriptorForReading: (int)fd { struct kevent event; EV_SET(&event, fd, EVFILT_READ, EV_ADD, 0, 0, 0); [changeList addItem: &event]; } - (void)OF_addFileDescriptorForWriting: (int)fd { struct kevent event; EV_SET(&event, fd, EVFILT_WRITE, EV_ADD, 0, 0, 0); [changeList addItem: &event]; } - (void)OF_removeFileDescriptorForReading: (int)fd { struct kevent event; | > > > > > > | 67 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 | [super dealloc]; } - (void)OF_addFileDescriptorForReading: (int)fd { struct kevent event; if ([changeList count] >= INT_MAX) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; EV_SET(&event, fd, EVFILT_READ, EV_ADD, 0, 0, 0); [changeList addItem: &event]; } - (void)OF_addFileDescriptorForWriting: (int)fd { struct kevent event; if ([changeList count] >= INT_MAX) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; EV_SET(&event, fd, EVFILT_WRITE, EV_ADD, 0, 0, 0); [changeList addItem: &event]; } - (void)OF_removeFileDescriptorForReading: (int)fd { struct kevent event; |
︙ | ︙ |