ObjFW  Check-in [4b6dc80314]

Overview
Comment:Bridge: Fix some type inconsistencies.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4b6dc80314cbf77f14adaaca36dd9641486990a07b29fcb36aca91bccacb93ef
User & Date: js on 2012-11-16 21:26:28
Other Links: manifest | tags
Context
2012-11-16
23:07
Implement forwarding target for Apple/i386. check-in: 1ec18e57bc user: js tags: trunk
21:26
Bridge: Fix some type inconsistencies. check-in: 4b6dc80314 user: js tags: trunk
21:16
Implement forwarding target for the Apple runtime. check-in: 2b20e164d7 user: js tags: trunk
Changes

Modified src/bridge/NSArray_OFArray.m from [95b8f127f3] to [790a0ce7fc].

14
15
16
17
18
19
20


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48





49
 * file.
 */

#import "NSArray_OFArray.h"
#import "OFArray.h"
#import "OFBridging.h"



@implementation NSArray_OFArray
- initWithOFArray: (OFArray*)array_
{
	if ((self = [super init]) != nil) {
		@try {
			array = [array_ retain];
		} @catch (id e) {
			return nil;
		}
	}

	return self;
}

- (id)objectAtIndex: (size_t)index
{
	id object = [array objectAtIndex: index];

	if ([object conformsToProtocol: @protocol(OFBridging)])
		return [object NSObject];

	return object;
}

- (size_t)count
{
	return [array count];
}





@end







>
>














|









|

|
|
>
>
>
>
>

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 * file.
 */

#import "NSArray_OFArray.h"
#import "OFArray.h"
#import "OFBridging.h"

#import "OFOutOfRangeException.h"

@implementation NSArray_OFArray
- initWithOFArray: (OFArray*)array_
{
	if ((self = [super init]) != nil) {
		@try {
			array = [array_ retain];
		} @catch (id e) {
			return nil;
		}
	}

	return self;
}

- (id)objectAtIndex: (NSUInteger)index
{
	id object = [array objectAtIndex: index];

	if ([object conformsToProtocol: @protocol(OFBridging)])
		return [object NSObject];

	return object;
}

- (NSUInteger)count
{
	size_t count = [array count];

	if (count > NSUIntegerMax)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	return (NSUInteger)count;
}
@end

Modified src/bridge/NSDictionary_OFDictionary.m from [68c180ab17] to [6dc78687a9].

15
16
17
18
19
20
21


22
23
24
25
26
27
28
 */

#import "NSDictionary_OFDictionary.h"
#import "OFDictionary.h"

#import "NSBridging.h"
#import "OFBridging.h"



@implementation NSDictionary_OFDictionary
- initWithOFDictionary: (OFDictionary*)dictionary_
{
	if ((self = [super init]) != nil) {
		@try {
			dictionary = [dictionary_ retain];







>
>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 */

#import "NSDictionary_OFDictionary.h"
#import "OFDictionary.h"

#import "NSBridging.h"
#import "OFBridging.h"

#import "OFOutOfRangeException.h"

@implementation NSDictionary_OFDictionary
- initWithOFDictionary: (OFDictionary*)dictionary_
{
	if ((self = [super init]) != nil) {
		@try {
			dictionary = [dictionary_ retain];
45
46
47
48
49
50
51
52
53
54
55





56

	if ([object conformsToProtocol: @protocol(OFBridging)])
		return [object NSObject];

	return object;
}

- (size_t)count
{
	return [dictionary count];
}





@end







|

|
|
>
>
>
>
>

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

	if ([object conformsToProtocol: @protocol(OFBridging)])
		return [object NSObject];

	return object;
}

- (NSUInteger)count
{
	size_t count = [dictionary count];

	if (count > NSUIntegerMax)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	return (NSUInteger)count;
}
@end

Modified src/bridge/OFArray_NSArray.m from [e60dcc6ae6] to [2617909132].

16
17
18
19
20
21
22

23
24
25
26
27
28
29

#import <Foundation/NSArray.h>

#import "OFArray_NSArray.h"
#import "NSBridging.h"

#import "OFInitializationFailedException.h"


@implementation OFArray_NSArray
- initWithNSArray: (NSArray*)array_
{
	self = [super init];

	@try {







>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#import <Foundation/NSArray.h>

#import "OFArray_NSArray.h"
#import "NSBridging.h"

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

@implementation OFArray_NSArray
- initWithNSArray: (NSArray*)array_
{
	self = [super init];

	@try {
38
39
40
41
42
43
44





45
46
47
48
49
50
51
52
53
54
55
56
57
	}

	return self;
}

- (id)objectAtIndex: (size_t)index
{





	id object = [array objectAtIndex: index];

	if ([object conformsToProtocol: @protocol(NSBridging)])
		return [object OFObject];

	return object;
}

- (size_t)count
{
	return [array count];
}
@end







>
>
>
>
>
|












39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
	}

	return self;
}

- (id)objectAtIndex: (size_t)index
{
	id object;

	if (index > NSUIntegerMax)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	object = [array objectAtIndex: index];

	if ([object conformsToProtocol: @protocol(NSBridging)])
		return [object OFObject];

	return object;
}

- (size_t)count
{
	return [array count];
}
@end