[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSStream update
From: |
Andrew Ruder |
Subject: |
Re: NSStream update |
Date: |
Tue, 21 Feb 2006 14:43:30 -0600 |
User-agent: |
Mutt/1.5.9i |
On Tue, Feb 21, 2006 at 11:18:40AM -0800, Derek Zhou wrote:
> I don't have a 64bit machine so I cannot verify, but In
> Foundation/NSRunloop.h there is:
>
> - (void) addEvent: (void*)data
> type: (RunLoopEventType)type
> watcher: (id<RunLoopEvents>)watcher
> forMode: (NSString*)mode;
>
> Where data is the file descriptor (int) in Unix. So how does that
> work?
Well, on an amd64, the compiler complains about a cast from a integer to
a pointer of different sizes. The current kludge that seems to be
employed in -base is to cast your int to (intptr_t) which is defined as
a integer that is at least the same size as a pointer, and then cast to
a pointer from there.
- Andy
--
Andrew Ruder
http://www.aeruder.net