Comment: | A few renames.
OFArray: OFAutoreleasePool: OFDataArray: OFObject: |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
526d04018df1b77543b844afcfd69440 |
User & Date: | js on 2009-05-23 21:53:20 |
Other Links: | manifest | tags |
2009-05-23
| ||
22:07 | Add a new convenience method to OFString. check-in: 88163bd172 user: js tags: trunk | |
21:53 | A few renames. check-in: 526d04018d user: js tags: trunk | |
21:02 | Add replaceOccurrencesOfString:withString: to OFString. check-in: bc71bde0dd user: js tags: trunk | |
Modified src/OFArray.h from [74b613ec1f] to [ac035c3b46].
︙ | |||
96 97 98 99 100 101 102 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - + - + | * \return The specified object of the OFArray */ - (id)objectAtIndex: (size_t)index; /** * \return The last object of the OFDataArray */ |
︙ |
Modified src/OFArray.m from [dbe234c97f] to [c29a774dc8].
︙ | |||
65 66 67 68 69 70 71 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - + | } - initWithObject: (OFObject*)obj { self = [self init]; @try { |
︙ | |||
97 98 99 100 101 102 103 | 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 | - + - + - + | andArgList: (va_list)args { id obj; self = [self init]; @try { |
︙ | |||
167 168 169 170 171 172 173 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | - + - + | } - (id)objectAtIndex: (size_t)index { return *((OFObject**)[array itemAtIndex: index]); } |
︙ | |||
196 197 198 199 200 201 202 | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | - + | for (i = 0; i < len; i++) if (![objs[i] isEqual: objs2[i]]) return NO; return YES; } |
︙ |
Modified src/OFAutoreleasePool.h from [d4653e60d0] to [9729efb348].
︙ | |||
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 | - + - - + | /** * Adds an object to the autorelease pool at the top of the thread-specific * stack. * * \param obj The object to add to the autorelease pool */ |
Modified src/OFAutoreleasePool.m from [2fd942db62] to [bd25c897fc].
︙ | |||
40 41 42 43 44 45 46 | 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 | - + - + | { if (self != [OFAutoreleasePool class]) return; pool_list_key = [[OFTLSKey alloc] initWithDestructor: release_list]; } |
︙ | |||
121 122 123 124 125 126 127 | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | - + - + | [self releaseObjects]; [[OFThread objectForTLSKey: pool_list_key] remove: listobj]; [super dealloc]; } |
︙ |
Modified src/OFDataArray.h from [2aac6c3e48] to [399b8674b6].
︙ | |||
73 74 75 76 77 78 79 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - + - + | * \return The specified item of the OFDataArray */ - (void*)itemAtIndex: (size_t)index; /** * \return The last item of the OFDataArray */ |
︙ |
Modified src/OFDataArray.m from [2e56b1156a] to [388224bcd6].
︙ | |||
67 68 69 70 71 72 73 | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | - + - + | { if (index >= count) @throw [OFOutOfRangeException newWithClass: isa]; return data + index * itemsize; } |
︙ | |||
189 190 191 192 193 194 195 | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | - + | if (lastpagebyte == 0) lastpagebyte = getpagesize() - 1; return self; } |
︙ |
Modified src/OFMutableArray.m from [2c171c36e2] to [b43784b0eb].
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + - + | for (i = 0; i < len; i++) [objs[i] retain]; return new; } |
︙ |
Modified src/OFObject.h from [ee8a3d67d3] to [7205341d87].
︙ | |||
130 131 132 133 134 135 136 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | - + | * Adds a pointer to the memory pool. * * This is useful to add memory allocated by functions such as asprintf to the * pool so it gets free'd automatically when the object is deallocated. * * \param ptr A pointer to add to the memory pool */ |
︙ |
Modified src/OFObject.m from [74f9d21734] to [8454e38c50].
︙ | |||
182 183 184 185 186 187 188 | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | - + | - (uint32_t)hash { /* Classes containing data should reimplement this! */ return (uint32_t)(intptr_t)self; } |
︙ | |||
354 355 356 357 358 359 360 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | - + | PRE_IVAR->retain_count++; return self; } - autorelease { |
︙ |
Modified src/OFString.m from [f339ad2a58] to [7338b9f854].
︙ | |||
218 219 220 221 222 223 224 | 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | - + | free(string); c = isa; [super dealloc]; @throw [OFInvalidEncodingException newWithClass: c]; } @try { |
︙ | |||
350 351 352 353 354 355 356 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | - + | array = [OFMutableArray array]; if (delim_len > length) { str = [self copy]; @try { |
︙ | |||
382 383 384 385 386 387 388 | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | - + - + | tmp[i - last] = '\0'; @try { str = [OFString stringWithCString: tmp]; } @finally { free(tmp); } |
Modified tests/OFArray/OFArray.m from [3882b8f32d] to [26a02ce961].
︙ | |||
41 42 43 44 45 46 47 | 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 | - - - + + + - + - + - + | int main() { OFArray *a = [OFArray arrayWithObjects: @"Foo", @"Bar", @"Baz", nil]; OFArray *b = [OFMutableArray array]; OFArray *c = [OFArray arrayWithCArray: c_array]; |
Modified tests/OFDataArray/OFDataArray.m from [6aad159bdb] to [ec34977a16].
︙ | |||
40 41 42 43 44 45 46 | 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 | - - - + + + - + - - - + + + - + - + - - + + - - + + | CATCH_EXCEPTION([a addNItems: SIZE_MAX \ fromCArray: NULL], \ OFOutOfRangeException) \ \ puts("Trying to add something after that error..."); \ p = [a allocWithSize: 4096]; \ memset(p, 255, 4096); \ |
︙ | |||
99 100 101 102 103 104 105 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | - - + + | \ [a release]; \ \ puts("Creating new array and using it to build a string..."); \ a = [[type alloc] initWithItemSize: 1]; \ \ for (i = 0; i < strlen(str); i++) \ |
︙ | |||
140 141 142 143 144 145 146 | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | - + | } if ([x hash] != [y hash]) { puts("FAIL 2!"); return 1; } |
︙ | |||
165 166 167 168 169 170 171 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | - + | fromCArray: "abc"]; y = [x copy]; if ([x compare: y]) { puts("FAIL 5!"); return 1; } |