ObjFW  Check-in [7e8ee9b1f9]

Overview
Comment:Make Apple GCC happy
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7e8ee9b1f9edae3ae7c6bdfe4f7bb3053364975f0b930d9eb0cd0a0cf2d00bc8
User & Date: js on 2017-05-13 19:51:35
Other Links: manifest | tags
Context
2017-05-13
20:11
OFObject: Make Foundation check work on macOS 10.5 check-in: 9f9898eb8b user: js tags: trunk
19:51
Make Apple GCC happy check-in: 7e8ee9b1f9 user: js tags: trunk
19:38
Do not use atomic_powerpc.h with Apple GCC check-in: 636533772e user: js tags: trunk
Changes

Modified src/OFHTTPResponse.m from [b039102173] to [a5f10ef207].

40
41
42
43
44
45
46

47
48
49
50
51
52
53
		STATE_PARAM_NAME,
		STATE_PARAM_VALUE_OR_QUOTE,
		STATE_PARAM_VALUE,
		STATE_PARAM_QUOTED_VALUE,
		STATE_AFTER_PARAM_VALUE
	} state = STATE_TYPE;
	OFString *name = nil, *value = nil, *charset = nil;


	last = 0;
	for (size_t i = 0; i < length; i++) {
		switch (state) {
		case STATE_TYPE:
			if (UTF8String[i] == ';') {
				state = STATE_BEFORE_PARAM_NAME;







>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
		STATE_PARAM_NAME,
		STATE_PARAM_VALUE_OR_QUOTE,
		STATE_PARAM_VALUE,
		STATE_PARAM_QUOTED_VALUE,
		STATE_AFTER_PARAM_VALUE
	} state = STATE_TYPE;
	OFString *name = nil, *value = nil, *charset = nil;
	of_string_encoding_t ret;

	last = 0;
	for (size_t i = 0; i < length; i++) {
		switch (state) {
		case STATE_TYPE:
			if (UTF8String[i] == ';') {
				state = STATE_BEFORE_PARAM_NAME;
123
124
125
126
127
128
129
130
131
132
133


134
135
136
137
138
139
140
		value = [value stringByDeletingTrailingWhitespaces];

		if ([name isEqual: @"charset"])
			charset = value;
	}

	@try {
		return of_string_parse_encoding(charset);
	} @catch (OFInvalidEncodingException *e) {
		return OF_STRING_ENCODING_AUTODETECT;
	}


}

@implementation OFHTTPResponse
@synthesize statusCode = _statusCode, headers = _headers, cookies = _cookies;

- init
{







|

|

>
>







124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
		value = [value stringByDeletingTrailingWhitespaces];

		if ([name isEqual: @"charset"])
			charset = value;
	}

	@try {
		ret = of_string_parse_encoding(charset);
	} @catch (OFInvalidEncodingException *e) {
		ret = OF_STRING_ENCODING_AUTODETECT;
	}

	return ret;
}

@implementation OFHTTPResponse
@synthesize statusCode = _statusCode, headers = _headers, cookies = _cookies;

- init
{

Modified src/OFObject.m from [3eb86842c6] to [43cde2e0c7].

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#if defined(OF_HAVE_ATOMIC_OPS)
# import "atomic.h"
#elif defined(OF_HAVE_THREADS)
# import "threading.h"
#endif

#ifdef OF_APPLE_RUNTIME
static double NSFoundationVersionNumber
    OF_WEAK_REF("NSFoundationVersionNumber");
#endif

#if defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR)
extern id of_forward(id, SEL, ...);
extern struct stret of_forward_stret(id, SEL, ...);
#else
# define of_forward of_method_not_found







|
<







56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
#if defined(OF_HAVE_ATOMIC_OPS)
# import "atomic.h"
#elif defined(OF_HAVE_THREADS)
# import "threading.h"
#endif

#ifdef OF_APPLE_RUNTIME
extern double NSFoundationVersionNumber;

#endif

#if defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR)
extern id of_forward(id, SEL, ...);
extern struct stret of_forward_stret(id, SEL, ...);
#else
# define of_forward of_method_not_found

Modified src/OFTarArchive.m from [8c89569c12] to [de5a95ce6d].

50
51
52
53
54
55
56
57
58
59
60


61
62
63
64
65
66
67

#ifdef OF_HAVE_FILES
- initWithPath: (OFString *)path
{
	OFFile *file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];
	@try {
		return [self initWithStream: file];
	} @finally {
		[file release];
	}


}
#endif

- (void)dealloc
{
	[_stream release];
	[_lastReturnedEntry release];







|



>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

#ifdef OF_HAVE_FILES
- initWithPath: (OFString *)path
{
	OFFile *file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];
	@try {
		self = [self initWithStream: file];
	} @finally {
		[file release];
	}

	return self;
}
#endif

- (void)dealloc
{
	[_stream release];
	[_lastReturnedEntry release];

Modified src/OFZIPArchive.m from [160928f0d5] to [426a03f6cb].

172
173
174
175
176
177
178
179
180
181
182


183
184
185
186
187
188
189

#ifdef OF_HAVE_FILES
- initWithPath: (OFString *)path
{
	OFFile *file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];
	@try {
		return [self initWithSeekableStream: file];
	} @finally {
		[file release];
	}


}
#endif

- (void)dealloc
{
	[_stream release];
	[_archiveComment release];







|



>
>







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191

#ifdef OF_HAVE_FILES
- initWithPath: (OFString *)path
{
	OFFile *file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];
	@try {
		self = [self initWithSeekableStream: file];
	} @finally {
		[file release];
	}

	return self;
}
#endif

- (void)dealloc
{
	[_stream release];
	[_archiveComment release];

Modified src/bridge/NSArray_OFArray.h from [2873e13ef4] to [e49dabc4d5].

12
13
14
15
16
17
18
19




20
21
22
23
24
25
26
27
28
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import <Foundation/NSArray.h>

OF_ASSUME_NONNULL_BEGIN





@class OFArray;

@interface NSArray_OFArray: NSArray
{
	OFArray *_array;
}

- initWithOFArray: (OFArray *)array;







|
>
>
>
>

|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import <Foundation/NSArray.h>

#ifdef OF_BRIDGE_LOCAL_INCLUDES
# import "OFArray.h"
#else
# import <ObjFW/OFArray.h>
#endif

OF_ASSUME_NONNULL_BEGIN

@interface NSArray_OFArray: NSArray
{
	OFArray *_array;
}

- initWithOFArray: (OFArray *)array;

Modified src/bridge/NSDictionary_OFDictionary.h from [6ee7aa0263] to [45e47f81ae].

12
13
14
15
16
17
18
19




20
21
22
23
24
25
26
27
28
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import <Foundation/NSDictionary.h>

OF_ASSUME_NONNULL_BEGIN





@class OFDictionary;

@interface NSDictionary_OFDictionary: NSDictionary
{
	OFDictionary *_dictionary;
}

- initWithOFDictionary: (OFDictionary *)dictionary;







|
>
>
>
>

|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import <Foundation/NSDictionary.h>

#ifdef OF_BRIDGE_LOCAL_INCLUDES
# import "OFDictionary.h"
#else
# import <ObjFW/OFDictionary.h>
#endif

OF_ASSUME_NONNULL_BEGIN

@interface NSDictionary_OFDictionary: NSDictionary
{
	OFDictionary *_dictionary;
}

- initWithOFDictionary: (OFDictionary *)dictionary;