Overview
Comment: | Use %@ where it is useful. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
d0eace5cd11fa77736e42a0f55724279 |
User & Date: | js on 2011-01-29 19:16:18 |
Other Links: | manifest | tags |
Context
2011-01-30
| ||
00:24 | Allow nil for %@. check-in: e9c2c2c599 user: js tags: trunk | |
2011-01-29
| ||
19:16 | Use %@ where it is useful. check-in: d0eace5cd1 user: js tags: trunk | |
19:01 | Add of_asprintf and allow %@ in format strings. check-in: 4c4608fbba user: js tags: trunk | |
Changes
Modified src/OFApplication.m from [c5833c27ef] to [b6ae30499e].
︙ | ︙ | |||
115 116 117 118 119 120 121 | for (; *env != NULL; env++) { OFString *key; OFString *value; char *sep; if ((sep = strchr(*env, '=')) == NULL) { fprintf(stderr, "Warning: Invalid environment " | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | for (; *env != NULL; env++) { OFString *key; OFString *value; char *sep; if ((sep = strchr(*env, '=')) == NULL) { fprintf(stderr, "Warning: Invalid environment " "variable: %s\n", *env); continue; } key = [OFString stringWithCString: *env length: sep - *env]; value = [OFString stringWithCString: sep + 1]; [environment setObject: value |
︙ | ︙ |
Modified src/OFExceptions.m from [ff08f95514] to [2044606b5e].
︙ | ︙ | |||
496 497 498 499 500 501 502 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | | 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to open file %@ with mode %@ in class %s! " ERRFMT, path, mode, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
661 662 663 664 665 666 667 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | | 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to create directory %@ in class %s! " ERRFMT, path, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
723 724 725 726 727 728 729 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | | 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to change to directory %@ in class %s! " ERRFMT, path, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
790 791 792 793 794 795 796 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | | 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to change mode for file %@ to %d in class %s! " ERRFMT, path, mode, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
869 870 871 872 873 874 875 | - (OFString*)description { if (description != nil) return description; if (group == nil) description = [[OFString alloc] initWithFormat: | | < | | < | | | | | 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 | - (OFString*)description { if (description != nil) return description; if (group == nil) description = [[OFString alloc] initWithFormat: @"Failed to change owner for file %@ to %@ in class %s! " ERRFMT, path, owner, class_getName(inClass), ERRPARAM]; else if (owner == nil) description = [[OFString alloc] initWithFormat: @"Failed to change group for file %@ to %@ in class %s! " ERRFMT, path, group, class_getName(inClass), ERRPARAM]; else description = [[OFString alloc] initWithFormat: @"Failed to change owner for file %@ to %@:%@ in class %s! " ERRFMT, path, owner, group, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
958 959 960 961 962 963 964 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | < | | 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to copy file %@ to %@ in class %s! " ERRFMT, sourcePath, destinationPath, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
1031 1032 1033 1034 1035 1036 1037 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | < | | 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to rename file %@ to %@ in class %s! " ERRFMT, sourcePath, destinationPath, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
1099 1100 1101 1102 1103 1104 1105 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to delete file %@ in class %@! " ERRFMT, path, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { |
︙ | ︙ | |||
1161 1162 1163 1164 1165 1166 1167 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | | 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to delete directory %@ in class %@! " ERRFMT, path, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
1224 1225 1226 1227 1228 1229 1230 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | < | | 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to link file %@ to %@ in class %s! " ERRFMT, sourcePath, destinationPath, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
1292 1293 1294 1295 1296 1297 1298 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | < | | 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to symlink file %@ to %@ in class %s! " ERRFMT, sourcePath, destinationPath, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
1409 1410 1411 1412 1413 1414 1415 | - (OFString*)description { if (description != nil) return description; if (node != nil && service != nil) description = [[OFString alloc] initWithFormat: | | | | | 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 | - (OFString*)description { if (description != nil) return description; if (node != nil && service != nil) description = [[OFString alloc] initWithFormat: @"The service %@ on %@ could not be translated to an " @"address in class %s. This means that either the node was " @"not found, there is no such service on the node, there " @"was a problem with the name server, there was a problem " @"with your network connection or you specified an invalid " @"node or service. " ERRFMT, service, node, class_getName(inClass), AT_ERRPARAM]; else description = [[OFString alloc] initWithFormat: @"An address translation failed in class %s! " ERRFMT, class_getName(inClass), AT_ERRPARAM]; return description; } |
︙ | ︙ | |||
1490 1491 1492 1493 1494 1495 1496 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | | | 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"A connection to service %@ on node %@ could not be established " @"in class %s! " ERRFMT, service, node, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
1563 1564 1565 1566 1567 1568 1569 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | < | 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Binding service %@ on node %@ failed in class %s! " ERRFMT, service, node, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; |
︙ | ︙ | |||
1814 1815 1816 1817 1818 1819 1820 | - (OFString*)description { if (description != nil) return description; if (ns != nil) description = [[OFString alloc] initWithFormat: | | | | | 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 | - (OFString*)description { if (description != nil) return description; if (ns != nil) description = [[OFString alloc] initWithFormat: @"The namespace %@ is not bound in class %s", ns, class_getName(inClass)]; else if (prefix != nil) description = [[OFString alloc] initWithFormat: @"The prefix %@ is not bound to any namespace in %s", prefix, class_getName(inClass)]; return description; } - (OFString*)namespace { return ns; |
︙ | ︙ | |||
1879 1880 1881 1882 1883 1884 1885 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: | | | | 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 | - (OFString*)description { if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"The protocol of URL %@ is not supported by class %s", URL, class_getName(inClass)]; return description; } - (OFURL*)URL { return URL; } @end |
Modified src/OFObject.m from [a02b47cd7d] to [a091595654].
︙ | ︙ | |||
487 488 489 490 491 492 493 | /* Classes containing data should reimplement this! */ return (uint32_t)(uintptr_t)self; } - (OFString*)description { /* Classes containing data should reimplement this! */ | | < | 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | /* Classes containing data should reimplement this! */ return (uint32_t)(uintptr_t)self; } - (OFString*)description { /* Classes containing data should reimplement this! */ return [OFString stringWithFormat: @"<%@: %p>", [self className], self]; } - (void)addMemoryToPool: (void*)ptr { void **memchunks; size_t memchunks_size; |
︙ | ︙ |
Modified src/OFURL.m from [84444b80b2] to [8d89f1d113].
︙ | ︙ | |||
349 350 351 352 353 354 355 | OFString *old = fragment; fragment = [fragment_ copy]; [old release]; } - (OFString*)description { | | | | < | | | | | | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | OFString *old = fragment; fragment = [fragment_ copy]; [old release]; } - (OFString*)description { OFMutableString *desc = [OFMutableString stringWithFormat: @"%@://", scheme]; BOOL needPort = YES; if (user != nil && password != nil) [desc appendFormat: @"%@:%@@", user, password]; else if (user != nil) [desc appendFormat: @"%@@", user]; [desc appendString: host]; if (([scheme isEqual: @"http"] && port == 80) || ([scheme isEqual: @"https"] && port == 443)) needPort = NO; if (needPort) [desc appendFormat: @":%d", port]; if (path != nil) [desc appendFormat: @"/%@", path]; if (parameters != nil) [desc appendFormat: @";%@", parameters]; if (query != nil) [desc appendFormat: @"?%@", query]; if (fragment != nil) [desc appendFormat: @"#%@", fragment]; return desc; } @end |
Modified src/OFXMLElement.m from [866cd32b8c] to [d813f718a7].
︙ | ︙ | |||
207 208 209 210 211 212 213 | OFMutableDictionary *all_namespaces; OFString *def_ns; if (characters != nil) return [characters stringByXMLEscaping]; if (cdata != nil) | | < | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | OFMutableDictionary *all_namespaces; OFString *def_ns; if (characters != nil) return [characters stringByXMLEscaping]; if (cdata != nil) return [OFString stringWithFormat: @"<![CDATA[%@]]>", cdata]; if (comment != nil) { OFMutableString *str; str = [OFMutableString stringWithString: @"<!--"]; [str appendString: comment]; [str appendString: @"-->"]; |
︙ | ︙ |
Modified src/OFXMLParser.m from [8fc69896c1] to [c1d0bcacb5].
︙ | ︙ | |||
586 587 588 589 590 591 592 | [delegate parser: self didEndElement: name withPrefix: prefix namespace: ns]; [namespaces removeNObjects: 1]; } else if (prefix != nil) { | | | < | 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 | [delegate parser: self didEndElement: name withPrefix: prefix namespace: ns]; [namespaces removeNObjects: 1]; } else if (prefix != nil) { OFString *str = [OFString stringWithFormat: @"%@:%@", prefix, name]; [previous addObject: str]; } else [previous addObject: name]; [pool release]; [name release]; |
︙ | ︙ |