ObjFW  Check-in [ff3d9a9225]

Overview
Comment:Small changes to OF_SETTER/OF_GETTER.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 0.5
Files: files | file ages | folders
SHA3-256: ff3d9a9225d60fe0e5c7e1bb89f1579a26b2737f06518bf5c632355f7d132824
User & Date: js on 2011-06-07 14:10:20
Other Links: branch diff | manifest | tags
Context
2011-06-30
18:33
Add -[hash] to OFXMLElement and OFXMLAttribute. check-in: 0ae2dee38f user: js tags: 0.5
2011-06-25
20:47
Fix a possible warning in macros.h. check-in: 4b0f1639b4 user: js tags: 0.5
2011-06-07
14:10
Small changes to OF_SETTER/OF_GETTER. check-in: ff3d9a9225 user: js tags: 0.5
Changes

Modified src/OFStreamObserver.m from [4bdac00ac8] to [0c469136e4].

38
39
40
41
42
43
44


45
46
47
48
49
50
51
# import "OFTCPSocket.h"
#endif
#import "OFAutoreleasePool.h"

#import "OFInitializationFailedException.h"
#import "OFOutOfRangeException.h"



#ifdef _WIN32
# define close(sock) closesocket(sock)
#endif

enum {
	QUEUE_ADD = 0,
	QUEUE_REMOVE = 1,







>
>







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# import "OFTCPSocket.h"
#endif
#import "OFAutoreleasePool.h"

#import "OFInitializationFailedException.h"
#import "OFOutOfRangeException.h"

#import "macros.h"

#ifdef _WIN32
# define close(sock) closesocket(sock)
#endif

enum {
	QUEUE_ADD = 0,
	QUEUE_REMOVE = 1,
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#endif

	[super dealloc];
}

- (id <OFStreamObserverDelegate>)delegate
{
	return [[(id)delegate retain] autorelease];
}

- (void)setDelegate: (id <OFStreamObserverDelegate>)delegate_
{
	[(id)delegate_ retain];
	[(id)delegate release];
	delegate = delegate_;
}

#ifdef OF_HAVE_POLL
- (void)_addStream: (OFStream*)stream
	withEvents: (short)events
{
	struct pollfd *fds_c = [fds cArray];







|




<
<
|







153
154
155
156
157
158
159
160
161
162
163
164


165
166
167
168
169
170
171
172
#endif

	[super dealloc];
}

- (id <OFStreamObserverDelegate>)delegate
{
	OF_GETTER(delegate, YES)
}

- (void)setDelegate: (id <OFStreamObserverDelegate>)delegate_
{


	OF_SETTER(delegate, delegate_, YES, NO)
}

#ifdef OF_HAVE_POLL
- (void)_addStream: (OFStream*)stream
	withEvents: (short)events
{
	struct pollfd *fds_c = [fds cArray];

Modified src/macros.h from [ab000dd8bb] to [e25630d4fc].

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

#ifndef _WIN32
# define OF_PATH_DELIM '/'
#else
# define OF_PATH_DELIM '\\'
#endif

#define OF_IVAR_OFFSET(ivar) ((char*)&ivar - (char*)self)
#define OF_GETTER(ivar, atomic) \
	return objc_getProperty(self, _cmd, OF_IVAR_OFFSET(ivar), atomic);
#define OF_SETTER(ivar, value, atomic, copy) \
	objc_setProperty(self, _cmd, OF_IVAR_OFFSET(ivar), value, atomic, copy);

static OF_INLINE uint16_t OF_CONST_FUNC
of_bswap16_const(uint16_t i)







|







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

#ifndef _WIN32
# define OF_PATH_DELIM '/'
#else
# define OF_PATH_DELIM '\\'
#endif

#define OF_IVAR_OFFSET(ivar) ((intptr_t)&ivar - (intptr_t)self)
#define OF_GETTER(ivar, atomic) \
	return objc_getProperty(self, _cmd, OF_IVAR_OFFSET(ivar), atomic);
#define OF_SETTER(ivar, value, atomic, copy) \
	objc_setProperty(self, _cmd, OF_IVAR_OFFSET(ivar), value, atomic, copy);

static OF_INLINE uint16_t OF_CONST_FUNC
of_bswap16_const(uint16_t i)