ObjFW  Check-in [3c7bf2e50c]

Overview
Comment:Don't return void expressions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3c7bf2e50cf06f681a9a1d4f59f8ca07079049a7e0212c4933f76c917a6ae2ac
User & Date: js on 2014-05-15 04:07:14
Other Links: manifest | tags
Context
2014-05-15
15:17
Work around Apple's API breaking the C standard check-in: 469553637d user: js tags: trunk
04:07
Don't return void expressions check-in: 3c7bf2e50c user: js tags: trunk
04:06
Remove usage of empty initializer extension check-in: f178d11592 user: js tags: trunk
Changes

Modified src/OFArray_subarray.m from [4711cab830] to [fffe4c972d].

70
71
72
73
74
75
76
77

78
79
80
81
82
83
84
70
71
72
73
74
75
76

77
78
79
80
81
82
83
84







-
+







{
	if (range.length > SIZE_MAX - range.location ||
	    range.location + range.length > _range.length)
		@throw [OFOutOfRangeException exception];

	range.location += _range.location;

	return [_array getObjects: buffer
	[_array getObjects: buffer
			  inRange: range];
}

- (size_t)indexOfObject: (id)object
{
	size_t index = [_array indexOfObject: object];

Modified src/OFConstantString.m from [dca68d3ede] to [1ddb7fb002].

344
345
346
347
348
349
350
351

352
353
354
355
356
357
358
344
345
346
347
348
349
350

351
352
353
354
355
356
357
358







-
+







}

- (void)getCharacters: (of_unichar_t*)buffer
	      inRange: (of_range_t)range
{
	[self finishInitialization];

	return [self getCharacters: buffer
	[self getCharacters: buffer
			   inRange: range];
}

- (of_range_t)rangeOfString: (OFString*)string
{
	[self finishInitialization];

608
609
610
611
612
613
614
615

616
617
618
619
620
621
622
623

624
625
626
627
628
629
630
631
632

633
634
635
608
609
610
611
612
613
614

615
616
617
618
619
620
621
622

623
624
625
626
627
628
629
630
631

632
633
634
635







-
+







-
+








-
+



	return [self UTF32StringWithByteOrder: byteOrder];
}

- (void)writeToFile: (OFString*)path
{
	[self finishInitialization];

	return [self writeToFile: path];
	[self writeToFile: path];
}

- (void)writeToFile: (OFString*)path
	   encoding: (of_string_encoding_t)encoding
{
	[self finishInitialization];

	return [self writeToFile: path
	[self writeToFile: path
			encoding: encoding];
}

#ifdef OF_HAVE_BLOCKS
- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block
{
	[self finishInitialization];

	return [self enumerateLinesUsingBlock: block];
	[self enumerateLinesUsingBlock: block];
}
#endif
@end

Modified src/OFMutableString.m from [6564d3d79b] to [9ed108e4c1].

299
300
301
302
303
304
305
306

307
308
309
310
311
312
313
299
300
301
302
303
304
305

306
307
308
309
310
311
312
313







-
+







			    withString: string];

	objc_autoreleasePoolPop(pool);
}

- (void)appendString: (OFString*)string
{
	return [self insertString: string
	[self insertString: string
			  atIndex: [self length]];
}

- (void)appendCharacters: (of_unichar_t*)characters
		  length: (size_t)length
{
	void *pool = objc_autoreleasePoolPush();
391
392
393
394
395
396
397
398

399
400
401
402
403
404
405
391
392
393
394
395
396
397

398
399
400
401
402
403
404
405







-
+







	} @finally {
		free(UTF8String);
	}
}

- (void)prependString: (OFString*)string
{
	return [self insertString: string
	[self insertString: string
			  atIndex: 0];
}

- (void)reverse
{
	size_t i, j, length = [self length];

Modified src/OFMutableString_UTF8.m from [d5efe167c0] to [bd98368f71].

330
331
332
333
334
335
336
337

338
339
340
341
342
343
344
330
331
332
333
334
335
336

337
338
339
340
341
342
343
344







-
+








	_s->cString[_s->cStringLength] = 0;
}

- (void)appendCString: (const char*)cString
	     encoding: (of_string_encoding_t)encoding
{
	return [self appendCString: cString
	[self appendCString: cString
			  encoding: encoding
			    length: strlen(cString)];
}

- (void)appendCString: (const char*)cString
	     encoding: (of_string_encoding_t)encoding
	       length: (size_t)cStringLength

Modified src/OFString.m from [f4d00fc2db] to [ab26efe707].

2418
2419
2420
2421
2422
2423
2424
2425

2426
2427
2428
2429
2430
2431
2432
2418
2419
2420
2421
2422
2423
2424

2425
2426
2427
2428
2429
2430
2431
2432







-
+








	return ret;
}

#ifdef OF_HAVE_FILES
- (void)writeToFile: (OFString*)path
{
	return [self writeToFile: path
	[self writeToFile: path
			encoding: OF_STRING_ENCODING_UTF_8];
}

- (void)writeToFile: (OFString*)path
	   encoding: (of_string_encoding_t)encoding
{
	void *pool = objc_autoreleasePoolPush();

Modified src/OFXMLElement.m from [424885b85a] to [e9f05c1971].

871
872
873
874
875
876
877
878
879




880
881
882
883
884
885
886
871
872
873
874
875
876
877


878
879
880
881
882
883
884
885
886
887
888







-
-
+
+
+
+








- (void)removeAttributeForName: (OFString*)attributeName
		     namespace: (OFString*)attributeNS
{
	OFXMLAttribute **objects;
	size_t i, count;

	if (attributeNS == nil)
		return [self removeAttributeForName: attributeName];
	if (attributeNS == nil) {
		[self removeAttributeForName: attributeName];
		return;
	}

	objects = [_attributes objects];
	count = [_attributes count];

	for (i = 0; i < count; i++) {
		if ([objects[i]->_namespace isEqual: attributeNS] &&
		    [objects[i]->_name isEqual: attributeName]) {