ObjFW  Diff

Differences From Artifact [4050f6aba6]:

  • File src/OFString.m — part of check-in [951f530aee] at 2016-07-24 00:06:30 on branch trunk — Rename OFHash to OFCryptoHash

    OFHash is too generic, as this protocol is for cryptographic hashes. It
    also solves the ambiguity of the +[hash] method (which is now
    +[cryptoHash]), which conflicted with -[hash] on the class itself,
    resulting in classes conforming to OFHash not being able to be used as a
    key in an OFDictionary. (user: js, size: 57989) [annotate] [blame] [check-ins using]

To Artifact [719f50f06e]:

  • File src/OFString.m — part of check-in [b7b33247d6] at 2016-08-29 00:05:29 on branch trunk — configure: Add --disable-unicode-tables option

    This is only useful for size-constrained systems and changes the
    behavior as follows:

    * Case-insensitive comparisons only work as expected for ASCII
    characters. This means that while a and A compare equal, ä and Ä do
    not.

    * -[OFMutableString {upper,lower}] and
    -[OFString {upper,lower}caseString] only work on ASCII characters;
    all other characters are left as they are. This means that the upper
    version of a is A, but the upper version of ä is still ä (and vice
    versa for lower). (user: js, size: 58106) [annotate] [blame] [check-ins using]


1356
1357
1358
1359
1360
1361
1362

1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377






1378
1379
1380
1381
1382
1383
1384

	minimumLength = (length > otherLength ? otherLength : length);

	for (size_t i = 0; i < minimumLength; i++) {
		of_unichar_t c = characters[i];
		of_unichar_t oc = otherCharacters[i];


		if (c >> 8 < OF_UNICODE_CASEFOLDING_TABLE_SIZE) {
			of_unichar_t tc =
			    of_unicode_casefolding_table[c >> 8][c & 0xFF];

			if (tc)
				c = tc;
		}

		if (oc >> 8 < OF_UNICODE_CASEFOLDING_TABLE_SIZE) {
			of_unichar_t tc =
			    of_unicode_casefolding_table[oc >> 8][oc & 0xFF];

			if (tc)
				oc = tc;
		}







		if (c > oc) {
			objc_autoreleasePoolPop(pool);
			return OF_ORDERED_DESCENDING;
		}
		if (c < oc) {
			objc_autoreleasePoolPop(pool);







>







<







>
>
>
>
>
>







1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370

1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390

	minimumLength = (length > otherLength ? otherLength : length);

	for (size_t i = 0; i < minimumLength; i++) {
		of_unichar_t c = characters[i];
		of_unichar_t oc = otherCharacters[i];

#ifdef OF_HAVE_UNICODE_TABLES
		if (c >> 8 < OF_UNICODE_CASEFOLDING_TABLE_SIZE) {
			of_unichar_t tc =
			    of_unicode_casefolding_table[c >> 8][c & 0xFF];

			if (tc)
				c = tc;
		}

		if (oc >> 8 < OF_UNICODE_CASEFOLDING_TABLE_SIZE) {
			of_unichar_t tc =
			    of_unicode_casefolding_table[oc >> 8][oc & 0xFF];

			if (tc)
				oc = tc;
		}
#else
		if (c <= 0x7F)
			c = toupper(c);
		if (oc <= 0x7F)
			oc = toupper(oc);
#endif

		if (c > oc) {
			objc_autoreleasePoolPop(pool);
			return OF_ORDERED_DESCENDING;
		}
		if (c < oc) {
			objc_autoreleasePoolPop(pool);