Differences From Artifact [f95a522750]:
- File src/OFHashes.m — part of check-in [9c0e2dbc57] at 2008-11-01 18:21:46 on branch trunk — Reduce object calls in OFHashes. (user: js, size: 11001) [annotate] [blame] [check-ins using]
To Artifact [4f4ce61c2e]:
- File
src/OFHashes.m
— part of check-in
[2d936d7aa7]
at
2008-11-01 20:16:56
on branch trunk
— Fix bug I didn't notice thanks to gcc 4.2.
It seems gcc 4.2 globals the variables from the caller of an inline
function to the inline function. (user: js, size: 11102) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
326 327 328 329 330 331 332 | state[1] += b; state[2] += c; state[3] += d; state[4] += e; } static inline void | > | | | | 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | state[1] += b; state[2] += c; state[3] += d; state[4] += e; } static inline void sha1_update(uint32_t *state, uint64_t *count, uint8_t *buffer, const uint8_t *buf, size_t size) { size_t i, j; j = (size_t)((*count >> 3) & 63); *count += (size << 3); if ((j + size) > 63) { memcpy(&buffer[j], buf, (i = 64 - j)); sha1_transform(state, buffer); for (; i + 63 < size; i += 64) |
︙ | ︙ | |||
371 372 373 374 375 376 377 | ofSize: (size_t)size { if (calculated) return self; if (size == 0) return self; | | | | | | 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 | ofSize: (size_t)size { if (calculated) return self; if (size == 0) return self; sha1_update(state, &count, buffer, buf, size); return self; } - (uint8_t*)digest { size_t i; uint8_t finalcount[8]; if (calculated) return digest; for (i = 0; i < 8; i++) /* Endian independent */ finalcount[i] = (uint8_t)((count >> ((7 - (i & 7)) * 8)) & 255); sha1_update(state, &count, buffer, (const uint8_t*)"\200", 1); while ((count & 504) != 448) sha1_update(state, &count, buffer, (const uint8_t*)"\0", 1); /* Should cause a sha1_transform() */ sha1_update(state, &count, buffer, finalcount, 8); for (i = 0; i < SHA1_DIGEST_SIZE; i++) digest[i] = (uint8_t)((state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); return digest; } |
︙ | ︙ |