ObjFW  Diff

Differences From Artifact [bfd221d698]:

  • File src/OFMutableString.m — part of check-in [545b6f740e] at 2013-01-13 13:07:52 on branch trunk — Add of_char{16,32}_t.

    For ObjC++, these are defined to char{16,32}_t if C++11 is used. This
    means passing e.g. a C++11 UTF-16 string to -[initWithUTF16String:]
    works without a warning.

    For C11, this is not necessary, as char{16,32}_t are just typedef'd to
    uint_least{16,32}_t in <uchar.h> and thus compatible to the definition
    of of_char{16,32}_t. The reason for not defining of_char{16,32}_t to
    char{16,32}_t when using C11 is that <uchar.h> might be missing and that
    char{16,32}_t are not required to be UTF-{16,32}, whereas in C++, they
    are required to be UTF-{16,32}. (user: js, size: 13108) [annotate] [blame] [check-ins using]

To Artifact [ab8d403b2b]:


266
267
268
269
270
271
272
273

274
275
276
277
278
279
280
266
267
268
269
270
271
272

273
274
275
276
277
278
279
280







-
+







		     wordMiddleTable: (const of_unichar_t *const[])middleTable
		  wordStartTableSize: (size_t)startTableSize
		 wordMiddleTableSize: (size_t)middleTableSize
{
	void *pool = objc_autoreleasePoolPush();
	const of_unichar_t *characters = [self characters];
	size_t i, length = [self length];
	BOOL isStart = YES;
	bool isStart = true;

	for (i = 0; i < length; i++) {
		const of_unichar_t *const *table;
		size_t tableSize;
		of_unichar_t c = characters[i];

		if (isStart) {
290
291
292
293
294
295
296
297

298
299
300

301
302
303
304
305
306
307
290
291
292
293
294
295
296

297
298
299

300
301
302
303
304
305
306
307







-
+


-
+







				   atIndex: i];

		switch (c) {
		case ' ':
		case '\t':
		case '\n':
		case '\r':
			isStart = YES;
			isStart = true;
			break;
		default:
			isStart = NO;
			isStart = false;
			break;
		}
	}

	objc_autoreleasePoolPop(pool);
}