ObjFW  Check-in [0bb3fc850a]

Overview
Comment:Make old GCCs happy.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0bb3fc850aa6e14a1f69830153f3a2b9a89bd35d118b6fd12c18595781677936
User & Date: js on 2013-03-04 18:32:40
Other Links: manifest | tags
Context
2013-03-08
22:44
Document the block types. check-in: e8473b9db8 user: js tags: trunk
2013-03-04
18:32
Make old GCCs happy. check-in: 0bb3fc850a user: js tags: trunk
17:20
Replace BOOL with bool. check-in: c5ef582958 user: js tags: trunk
Changes

Modified generators/TableGenerator.h from [a38ddb6bd9] to [b59b1cc1a3].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

@interface TableGenerator: OFObject
{
	of_unichar_t uppercaseTable[0x110000];
	of_unichar_t lowercaseTable[0x110000];
	of_unichar_t titlecaseTable[0x110000];
	of_unichar_t casefoldingTable[0x110000];
	BOOL uppercaseTableUsed[0x1100];
	BOOL lowercaseTableUsed[0x1100];
	char titlecaseTableUsed[0x1100];
	char casefoldingTableUsed[0x1100];
	size_t uppercaseTableSize;
	size_t lowercaseTableSize;
	size_t titlecaseTableSize;
	size_t casefoldingTableSize;
}

- (void)parseUnicodeData;
- (void)parseCaseFolding;
- (void)writeTablesToFile: (OFString*)path;
- (void)writeHeaderToFile: (OFString*)path;
@end







|
|













20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

@interface TableGenerator: OFObject
{
	of_unichar_t uppercaseTable[0x110000];
	of_unichar_t lowercaseTable[0x110000];
	of_unichar_t titlecaseTable[0x110000];
	of_unichar_t casefoldingTable[0x110000];
	char uppercaseTableUsed[0x1100];
	char lowercaseTableUsed[0x1100];
	char titlecaseTableUsed[0x1100];
	char casefoldingTableUsed[0x1100];
	size_t uppercaseTableSize;
	size_t lowercaseTableSize;
	size_t titlecaseTableSize;
	size_t casefoldingTableSize;
}

- (void)parseUnicodeData;
- (void)parseCaseFolding;
- (void)writeTablesToFile: (OFString*)path;
- (void)writeHeaderToFile: (OFString*)path;
@end

Modified generators/TableGenerator.m from [d6bc06fa8f] to [e55aa0b71d].

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
	for (i = 0; i < 0x110000; i += 0x100) {
		bool isEmpty = true;

		for (j = i; j < i + 0x100; j++) {
			if (uppercaseTable[j] != 0) {
				isEmpty = false;
				uppercaseTableSize = i >> 8;
				uppercaseTableUsed[uppercaseTableSize] = YES;
				break;
			}
		}

		if (!isEmpty) {
			void *pool2 = objc_autoreleasePoolPush();








|







182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
	for (i = 0; i < 0x110000; i += 0x100) {
		bool isEmpty = true;

		for (j = i; j < i + 0x100; j++) {
			if (uppercaseTable[j] != 0) {
				isEmpty = false;
				uppercaseTableSize = i >> 8;
				uppercaseTableUsed[uppercaseTableSize] = 1;
				break;
			}
		}

		if (!isEmpty) {
			void *pool2 = objc_autoreleasePoolPush();

220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
	for (i = 0; i < 0x110000; i += 0x100) {
		bool isEmpty = true;

		for (j = i; j < i + 0x100; j++) {
			if (lowercaseTable[j] != 0) {
				isEmpty = false;
				lowercaseTableSize = i >> 8;
				lowercaseTableUsed[lowercaseTableSize] = YES;
				break;
			}
		}

		if (!isEmpty) {
			void *pool2 = objc_autoreleasePoolPush();








|







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
	for (i = 0; i < 0x110000; i += 0x100) {
		bool isEmpty = true;

		for (j = i; j < i + 0x100; j++) {
			if (lowercaseTable[j] != 0) {
				isEmpty = false;
				lowercaseTableSize = i >> 8;
				lowercaseTableUsed[lowercaseTableSize] = 1;
				break;
			}
		}

		if (!isEmpty) {
			void *pool2 = objc_autoreleasePoolPush();

Modified src/OFArray_adjacent.m from [712ba693de] to [ad2d762abe].

213
214
215
216
217
218
219


220
221
222
223
224


225
226
227
228


229
230
231
232
233


234
235
236
237
238
239
240
- (id*)objects
{
	return [_array items];
}

- (id)objectAtIndex: (size_t)index
{


	@try {
		return *((id*)[_array itemAtIndex: index]);
	} @catch (OFOutOfRangeException *e) {
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];
	}


}

- (id)objectAtIndexedSubscript: (size_t)index
{


	@try {
		return *((id*)[_array itemAtIndex: index]);
	} @catch (OFOutOfRangeException *e) {
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];
	}


}

- (void)getObjects: (id*)buffer
	   inRange: (of_range_t)range
{
	id *objects = [_array items];
	size_t i, count = [_array count];







>
>

|



>
>




>
>

|



>
>







213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
- (id*)objects
{
	return [_array items];
}

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

	@try {
		ret = *((id*)[_array itemAtIndex: index]);
	} @catch (OFOutOfRangeException *e) {
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];
	}

	return ret;
}

- (id)objectAtIndexedSubscript: (size_t)index
{
	id ret;

	@try {
		ret = *((id*)[_array itemAtIndex: index]);
	} @catch (OFOutOfRangeException *e) {
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];
	}

	return ret;
}

- (void)getObjects: (id*)buffer
	   inRange: (of_range_t)range
{
	id *objects = [_array items];
	size_t i, count = [_array count];

Modified src/OFDictionary_hashtable.m from [df272a2515] to [312b1063e8].

303
304
305
306
307
308
309


310
311
312
313
314
315
316


317
318
319
320
321
322
323
	[_mapTable dealloc];

	[super dealloc];
}

- (id)objectForKey: (id)key
{


	@try {
		return [_mapTable valueForKey: key];
	} @catch (OFInvalidArgumentException *e) {
		@throw [OFInvalidArgumentException
		    exceptionWithClass: [self class]
			      selector: _cmd];
	}


}

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








>
>

|





>
>







303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
	[_mapTable dealloc];

	[super dealloc];
}

- (id)objectForKey: (id)key
{
	id ret;

	@try {
		ret = [_mapTable valueForKey: key];
	} @catch (OFInvalidArgumentException *e) {
		@throw [OFInvalidArgumentException
		    exceptionWithClass: [self class]
			      selector: _cmd];
	}

	return ret;
}

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

Modified src/bridge/NSArray_OFArray.m from [434089e7ff] to [fcfeb7640b].

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
	return self;
}

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

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

	return object;
}

- (NSUInteger)count
{







|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
	return self;
}

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

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

	return object;
}

- (NSUInteger)count
{

Modified src/bridge/NSDictionary_OFDictionary.m from [f733fe8d7e] to [5fb2d6b00a].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
	return self;
}

- (id)objectForKey: (id)key
{
	id object;

	if ([key conformsToProtocol: @protocol(NSBridging)])
		key = [key OFObject];

	object = [_dictionary objectForKey: key];

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

	return object;
}

- (NSUInteger)count
{







|




|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
	return self;
}

- (id)objectForKey: (id)key
{
	id object;

	if ([(NSObject*)key conformsToProtocol: @protocol(NSBridging)])
		key = [key OFObject];

	object = [_dictionary objectForKey: key];

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

	return object;
}

- (NSUInteger)count
{

Modified src/bridge/OFArray_NSArray.m from [550babc622] to [0b7f7cf63f].

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
	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







|










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

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

	object = [_array objectAtIndex: index];

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

	return object;
}

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

Modified src/bridge/OFDictionary_NSDictionary.m from [cb3b31f5ab] to [a9f8dc35d5].

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	return self;
}

- (id)objectForKey: (id)key
{
	id object;

	if ([key conformsToProtocol: @protocol(OFBridging)])
		key = [key NSObject];

	object = [_dictionary objectForKey: key];

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

	return object;
}

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







|




|










42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
	return self;
}

- (id)objectForKey: (id)key
{
	id object;

	if ([(OFObject*)key conformsToProtocol: @protocol(OFBridging)])
		key = [key NSObject];

	object = [_dictionary objectForKey: key];

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

	return object;
}

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