Comment: | More style improvements. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e76a7f52c11edf01ae14a77a2fd49db4 |
User & Date: | js on 2011-04-22 20:19:54 |
Other Links: | manifest | tags |
2011-04-22
| ||
20:43 | OFStreamObserver: Don't ignore the timeout when using select(). check-in: 4b08544ddd user: js tags: trunk | |
20:19 | More style improvements. check-in: e76a7f52c1 user: js tags: trunk | |
18:22 | Fix double-retain in OFList. check-in: 58d10be52f user: js tags: trunk | |
Modified src/OFCollection.h from [10d2a861f6] to [68e0dd67a3].
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | + - + - + + - + | /** * \returns An OFEnumerator to enumerate through all objects of the collection */ - (OFEnumerator*)objectEnumerator; /** * \param The object which is checked for being in the collection |
Modified src/OFDataArray+Hashing.m from [c3dc8494cf] to [ec54ab978c].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | - + - + - - + + - + - + - + - - + + - + | @implementation OFDataArray (Hashing) - (OFString*)MD5Hash { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFMD5Hash *hash = [OFMD5Hash MD5Hash]; uint8_t *digest; |
Modified src/OFFile.m from [437b42878c] to [521d39c7c0].
︙ | |||
601 602 603 604 605 606 607 | 601 602 603 604 605 606 607 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 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 | - + - + - + - + - + - + - + - + - + - + - + - + | return isAtEndOfStream; } - (size_t)_readNBytes: (size_t)length intoBuffer: (char*)buffer { |
︙ |
Modified src/OFHTTPRequest.h from [cb8dc6b01c] to [55acdcf8df].
︙ | |||
54 55 56 57 58 59 60 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - + - + - + - + | /** * This callback is called when the OFHTTPRequest received data. * * This is useful for example if you want to update a status display. * * \param request The OFHTTPRequest which received data * \param data The data the OFHTTPRequest received |
︙ | |||
110 111 112 113 114 115 116 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | - + - + - + - + - + - + - + - + - + | /** * \return A new, autoreleased OFHTTPRequest */ + request; /** |
︙ | |||
201 202 203 204 205 206 207 | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | - + - + | /** * Sets whether an OFDataArray with the data is created. * * Setting this to NO is only useful if you are using the delegate to handle the * data. * |
︙ |
Modified src/OFHTTPRequest.m from [97fcaf53fd] to [908217ca1f].
︙ | |||
61 62 63 64 65 66 67 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | - + - + - + - + - + - + - + - + - + - + | @implementation OFHTTPRequest + request { return [[[self alloc] init] autorelease]; } |
︙ | |||
164 165 166 167 168 169 170 | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | - + - + | } - (id <OFHTTPRequestDelegate>)delegate { OF_GETTER(delegate, YES) } |
︙ | |||
209 210 211 212 213 214 215 | 209 210 211 212 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 249 250 251 | - - + + - + - + - + - + - + | @try { OFString *line, *path; OFMutableDictionary *serverHeaders; OFDataArray *data; OFEnumerator *enumerator; OFString *key; int status; |
︙ | |||
363 364 365 366 367 368 369 | 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 389 390 391 392 393 | - + - + - + - + - + | withStatusCode: status]; if (storesData) data = [OFDataArray dataArrayWithItemSize: 1]; else data = nil; |
︙ |
Modified src/OFHash.h from [537a82b073] to [0b332e5a5e].
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - + - + | */ + (size_t)blockSize; /** * Adds a buffer to the hash to be calculated. * * \param buf The buffer which should be included into the calculation. |
︙ |
Modified src/OFHash.m from [0f1145ec18] to [528220f4b7].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - + | + (size_t)blockSize { @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } - (void)updateWithBuffer: (const char*)buffer |
︙ |
Modified src/OFList.h from [3cd365a47f] to [e94ed80ca6].
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + | * A struct that contains a pointer to the next list object, the previous list * object and the object. */ struct of_list_object_t { /// A pointer to the next list object in the list of_list_object_t *next; /// A pointer to the previous list object in the list |
︙ | |||
64 65 66 67 68 69 70 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | - + - + - + - + - - + + + + + + + + + + + + + + - + - - - - - - - - - - - - - + - + - + | * \return The last list object in the list */ - (of_list_object_t*)lastListObject; /** * Appends an object to the list. * |
Modified src/OFList.m from [80de30a57f] to [7c3c7d8b0c].
︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 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 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | - + - + - - - - + + + + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - - + + - + - - - - + + + + - + - + - + - - + + - + - - + + - + - - - - + + + + - - + + - + - - + + - + - + - - - - + + + + - - - - + + + + - + - + - + + - + + + - + - + - + - + - + - + - - + + - - + + + - - - - + + + + - - - - + + + + - + - + - + - + - + | } - (of_list_object_t*)lastListObject; { return lastListObject; } |
︙ |
Modified src/OFMD5Hash.h from [bbea038319] to [483543b630].
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + | #define OF_MD5_DIGEST_SIZE 16 /** * \brief A class which provides functions to create an MD5 hash. */ @interface OFMD5Hash: OFHash { |
︙ |
Modified src/OFMD5Hash.m from [8c8aeaf4bf] to [bbf6824f58].
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + - - - - + + + + | #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ (w += f(x, y, z) + data, w = w << s | w >> (32 - s), w += x) static void |
︙ | |||
108 109 110 111 112 113 114 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | - - - - + + + + | MD5STEP(F4, c, d, a, b, in[6] + 0xA3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4E0811A1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xF7537E82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xBD3AF235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2AD7D2BB, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xEB86D391, 21); |
︙ | |||
134 135 136 137 138 139 140 | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 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 249 250 251 | - - - - + + + + - - + + - + - + - + - - + + - + - + - - + + - - + + - + - - + + - + - + - + - + - + | return 64; } - init { self = [super init]; |
Modified src/OFMutableArray.h from [8c6d38e392] to [1c792f75c6].
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - + - + - + - + - - + + - - + + - + - + - - + + - - + + - + - + - + - + - + - + - + | { unsigned long mutations; } /** * Adds an object to the OFArray. * |
︙ |
Modified src/OFMutableArray.m from [d3e5b8eedf] to [26e57101fb].
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | - + - - - - - + + - - + + - + - + - + - - + + + - + - - + - + - + - - + + - + - - - - + + + + - + - - + + - - - + + + - - + + - + - - - - + + + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFOutOfRangeException.h" @implementation OFMutableArray - copy { |
︙ | |||
231 232 233 234 235 236 237 | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | - + - + - + + + - + - + - - - + + + | mutationsPointer: &mutations] autorelease]; } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; |
Modified src/OFObject.h from [9dc78efdb2] to [71473f3fce].
︙ | |||
259 260 261 262 263 264 265 | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - + - + - + - + | * This is mostly for debugging purposes. */ + (OFString*)description; /** * Replaces a class method implementation with another implementation. * |
︙ | |||
363 364 365 366 367 368 369 | 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 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | - + - + - + - + | - (void*)allocMemoryWithSize: (size_t)size; /** * Allocates memory for the specified number of items and stores it in the * object's memory pool so it can be free'd automatically when the object is * deallocated. * |
︙ |
Modified src/OFObject.m from [b8a2ef4dd8] to [f33de6810c].
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - - - + + + - + | # define class_getInstanceSize class_get_instance_size # define class_getName class_get_class_name # define class_getSuperclass class_get_super_class # define sel_registerName sel_get_uid #endif struct pre_ivar { |
︙ | |||
98 99 100 101 102 103 104 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | - + - - + + - + - + | #endif #ifdef NEED_OBJC_PROPERTIES_INIT extern BOOL objc_properties_init(); #endif static void |
︙ | |||
162 163 164 165 166 167 168 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | - + - + - - - + + + - + + - + | + (void)initialize { } + alloc { OFObject *instance; |
︙ | |||
310 311 312 313 314 315 316 | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 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 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + | } + (OFString*)description { return [self className]; } |
︙ | |||
562 563 564 565 566 567 568 | 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 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 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 | - - + + - + - - + + - - + + - + - - - + + + - - + + - + - - + + - - + + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + - - + + - - + + - + - + - - + + - - + + - - + + - + - + - - - + + + - - + + - + - - - + + + | { /* Classes containing data should reimplement this! */ return [OFString stringWithFormat: @"<%@: %p>", [self className], self]; } - (void)addMemoryToPool: (void*)ptr { |
︙ | |||
795 796 797 798 799 800 801 | 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 | - - + + - - + + | destruct(self, cxx_destruct); last = destruct; } else break; } |
︙ | |||
840 841 842 843 844 845 846 | 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 | - + - + | + (void*)allocMemoryWithSize: (size_t)size { @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } |
︙ |
Modified src/OFSHA1Hash.m from [c68eae11dd] to [595fab433e].
︙ | |||
102 103 104 105 106 107 108 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | - + - + - + - + - + | state[2] += c; state[3] += d; state[4] += e; } static inline void sha1_update(uint32_t *state, uint64_t *count, char *buffer, |
︙ | |||
153 154 155 156 157 158 159 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | - - + + - + - + | state[2] = 0x98BADCFE; state[3] = 0x10325476; state[4] = 0xC3D2E1F0; return self; } |
︙ |
Modified src/OFSeekableStream.m from [693313aa14] to [cbcf953b58].
︙ | |||
44 45 46 47 48 49 50 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + - + - + - + - + - + | [self freeMemory: cache]; cache = NULL; cacheLength = 0; } - (off_t)seekForwardWithOffset: (off_t)offset { |
Modified src/OFStreamSocket.m from [7c915a3b62] to [773bb7067f].
︙ | |||
64 65 66 67 68 69 70 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | - + - + - + - + - + - + - + | { return isAtEndOfStream; } - (size_t)_readNBytes: (size_t)length intoBuffer: (char*)buffer { |
︙ |
Modified src/OFString+Hashing.m from [856205c228] to [4e1492dfab].
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - + - + - - + + - + - + - + - - + + - + | @implementation OFString (Hashing) - (OFString*)MD5Hash { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFMD5Hash *hash = [OFMD5Hash MD5Hash]; uint8_t *digest; |
Modified tests/OFListTests.m from [2488afe1b6] to [0db3614a7f].
︙ | |||
52 53 54 55 56 57 58 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - - + + - + | TEST(@"-[firstListObject]->next", [[list firstListObject]->next->object isEqual: strings[1]]) TEST(@"-[lastListObject]", [[list lastListObject]->object isEqual: strings[2]]) |
︙ |
Modified tests/OFMD5HashTests.m from [e94d6df1df] to [e80a1f9b87].
︙ | |||
43 44 45 46 47 48 49 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - + - - - + + + + | TEST(@"+[md5Hash]", (md5 = [OFMD5Hash MD5Hash])) while (![f isAtEndOfStream]) { char buf[64]; size_t len = [f readNBytes: 64 intoBuffer: buf]; [md5 updateWithBuffer: buf |
Modified tests/OFSHA1HashTests.m from [af8da2df4c] to [18f5bdbcf3].
︙ | |||
44 45 46 47 48 49 50 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + - - - + + + + | TEST(@"+[sha1Hash]", (sha1 = [OFSHA1Hash SHA1Hash])) while (![f isAtEndOfStream]) { char buf[64]; size_t len = [f readNBytes: 64 intoBuffer: buf]; [sha1 updateWithBuffer: buf |