diff options
Diffstat (limited to 'crc32.c')
-rw-r--r-- | crc32.c | 41 |
1 files changed, 39 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* crc32.c -- compute the CRC-32 of a data stream | 1 | /* crc32.c -- compute the CRC-32 of a data stream |
2 | * Copyright (C) 1995-2005 Mark Adler | 2 | * Copyright (C) 1995-2006 Mark Adler |
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | * | 4 | * |
5 | * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster | 5 | * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster |
@@ -68,6 +68,12 @@ | |||
68 | local unsigned long gf2_matrix_times OF((unsigned long *mat, | 68 | local unsigned long gf2_matrix_times OF((unsigned long *mat, |
69 | unsigned long vec)); | 69 | unsigned long vec)); |
70 | local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); | 70 | local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); |
71 | #ifdef _LARGEFILE64_SOURCE | ||
72 | local uLong crc32_combine_(uLong crc1, uLong crc2, off64_t len2); | ||
73 | #else | ||
74 | local uLong crc32_combine_(uLong crc1, uLong crc2, z_off_t len2); | ||
75 | #endif | ||
76 | |||
71 | 77 | ||
72 | #ifdef DYNAMIC_CRC_TABLE | 78 | #ifdef DYNAMIC_CRC_TABLE |
73 | 79 | ||
@@ -367,10 +373,14 @@ local void gf2_matrix_square(square, mat) | |||
367 | } | 373 | } |
368 | 374 | ||
369 | /* ========================================================================= */ | 375 | /* ========================================================================= */ |
370 | uLong ZEXPORT crc32_combine(crc1, crc2, len2) | 376 | local uLong crc32_combine_(crc1, crc2, len2) |
371 | uLong crc1; | 377 | uLong crc1; |
372 | uLong crc2; | 378 | uLong crc2; |
379 | #ifdef _LARGEFILE64_SOURCE | ||
380 | off64_t len2; | ||
381 | #else | ||
373 | z_off_t len2; | 382 | z_off_t len2; |
383 | #endif | ||
374 | { | 384 | { |
375 | int n; | 385 | int n; |
376 | unsigned long row; | 386 | unsigned long row; |
@@ -421,3 +431,30 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2) | |||
421 | crc1 ^= crc2; | 431 | crc1 ^= crc2; |
422 | return crc1; | 432 | return crc1; |
423 | } | 433 | } |
434 | |||
435 | /* ========================================================================= */ | ||
436 | uLong ZEXPORT crc32_combine(crc1, crc2, len2) | ||
437 | uLong crc1; | ||
438 | uLong crc2; | ||
439 | z_off_t len2; | ||
440 | { | ||
441 | return crc32_combine_(crc1, crc2, len2); | ||
442 | } | ||
443 | |||
444 | #ifdef _LARGEFILE64_SOURCE | ||
445 | uLong ZEXPORT crc32_combine64(crc1, crc2, len2) | ||
446 | uLong crc1; | ||
447 | uLong crc2; | ||
448 | off64_t len2; | ||
449 | { | ||
450 | return crc32_combine_(crc1, crc2, len2); | ||
451 | } | ||
452 | #else | ||
453 | uLong ZEXPORT crc32_combine64(crc1, crc2, len2) | ||
454 | uLong crc1; | ||
455 | uLong crc2; | ||
456 | z_off_t len2; | ||
457 | { | ||
458 | return crc32_combine_(crc1, crc2, len2); | ||
459 | } | ||
460 | #endif | ||