Overview
Comment: | Use char* instead of uint8_t* for OFStreams and OFHashes. This way, less casts are needed when using C libraries. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
722b6213c04a219cd6ed3ca37579e16b |
User & Date: | js on 2009-04-09 13:55:55 |
Other Links: | manifest | tags |
Context
2009-04-10
| ||
00:52 |
Fix warnings on Leopard in OFConstString. As there are no warnings anymore, reintroduce -Werror. check-in: 72af773f72 user: js tags: trunk | |
2009-04-09
| ||
13:55 |
Use char* instead of uint8_t* for OFStreams and OFHashes. This way, less casts are needed when using C libraries. check-in: 722b6213c0 user: js tags: trunk | |
2009-04-08
| ||
17:11 | Ouch. Really. Fixed recursion loop in OFExceptions. check-in: 0c8a28c5ac user: js tags: trunk | |
Changes
Modified src/OFFile.h from [8001780b38] to [938ce6b8f3].
︙ | |||
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 141 | - + - + | * The buffer MUST be at least size * nitems big! * \param nitems nitem The number of items to read * The buffer MUST be at least size * nitems big! * \return The number of bytes read */ - (size_t)readNItems: (size_t)nitems ofSize: (size_t)size |
Modified src/OFFile.m from [2951d584dc] to [08cbbc44cd].
︙ | |||
104 105 106 107 108 109 110 | 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 | - + - + - + - + - + | - (BOOL)atEndOfFile { return (feof(fp) == 0 ? NO : YES); } - (size_t)readNItems: (size_t)nitems ofSize: (size_t)size |
Modified src/OFHashes.h from [d9a99aea79] to [6473ae53f6].
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 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 | - + - + - + - - + + - + - + | /** * The OFMD5Hash class provides functions to create an MD5 hash. */ @interface OFMD5Hash: OFObject { uint32_t buf[4]; uint32_t bits[2]; |
Modified src/OFHashes.m from [78e42ea05b] to [fb812c0e73].
︙ | |||
133 134 135 136 137 138 139 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + | calculated = NO; } return self; } |
︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | - + | bits[1] += size >> 29; /* Bytes already in shsInfo->data */ t = (t >> 3) & 0x3F; /* Handle any leading odd-sized chunks */ if (t) { |
︙ | |||
188 189 190 191 192 193 194 | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | - + - + - + | /* Handle any remaining bytes of data. */ memcpy(in, buffer, size); return self; } |
︙ | |||
229 230 231 232 233 234 235 | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | - + - + | OF_BSWAP_V(in, 14); /* Append length in bits and transform */ ((uint32_t*)in)[14] = bits[0]; ((uint32_t*)in)[15] = bits[1]; md5_transform(buf, (uint32_t*)in); |
︙ | |||
278 279 280 281 282 283 284 | 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | - + - + - + | z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + OF_ROL(v, 5); \ w = OF_ROL(w, 30); #define R4(v, w, x, y, z, i) \ z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + OF_ROL(v, 5); \ w = OF_ROL(w, 30); typedef union { |
︙ | |||
330 331 332 333 334 335 336 | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | - - + + | state[1] += b; state[2] += c; state[3] += d; state[4] += e; } static inline void |
︙ | |||
373 374 375 376 377 378 379 | 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 | - + - + - + - - + + - + - + | state[3] = 0x10325476; state[4] = 0xC3D2E1F0; } return self; } |
Modified src/OFStream.h from [ed38ea4d16] to [7f1379bb1f].
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - + - + | * * \param buf The buffer into which the data is read * \param size The size of the data that should be read. * The buffer MUST be at least size big! * \return The number of bytes read */ - (size_t)readNBytes: (size_t)size |
︙ |
Modified src/OFTCPSocket.m from [86db944fc0] to [b0a40b2d84].
︙ | |||
219 220 221 222 223 224 225 | 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 | - + - + - + - + - + | [newsock setSocketAddress: addr withLength: addrlen]; return newsock; } - (size_t)readNBytes: (size_t)size |
︙ |
Modified tests/OFHashes/OFHashes.m from [c778845c1b] to [4b23857f2b].
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - - + + | const uint8_t testfile_sha1[SHA1_DIGEST_SIZE] = "\xC9\x9A\xB8\x7E\x1E\xC8\xEC\x65\xD5\xEB\xE4\x2E\x0D\xA6\x80\x96\xF5" "\x94\xE7\x17"; int main() { |
︙ |
Modified tests/OFTCPSocket/OFTCPSocket.m from [ba29c3b0ba] to [7883bf415d].
︙ | |||
54 55 56 57 58 59 60 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | - + | [client connectTo: "localhost" onPort: port]; accepted = [server accept]; [client writeCString: "Hallo!"]; [accepted readNBytes: 6 |
︙ | |||
86 87 88 89 90 91 92 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | - + | [client connectTo: "::1" onPort: port]; accepted = [server accept]; [client writeCString: "IPv6:)"]; [accepted readNBytes: 6 |
︙ |