Changeset 673df40c in rtems
 Timestamp:
 Mar 18, 2011, 10:11:03 AM (9 years ago)
 Branches:
 4.11, master
 Children:
 f369a50
 Parents:
 c6b49cb
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

cpukit/zlib/crc32.c
rc6b49cb r673df40c 1 1 /* crc32.c  compute the CRC32 of a data stream 2 * Copyright (C) 1995200 5Mark Adler2 * Copyright (C) 19952006 Mark Adler 3 3 * For conditions of distribution and use, see copyright notice in zlib.h 4 4 * … … 54 54 /* Definitions for doing the crc four data bytes at a time. */ 55 55 #ifdef BYFOUR 56 # define REV(w) ((( w)>>24)+(((w)>>8)&0xff00)+ \56 # define REV(w) ((((w)>>24)&0xff)+(((w)>>8)&0xff00)+ \ 57 57 (((w)&0xff00)<<8)+(((w)&0xff)<<24)) 58 58 local unsigned long crc32_little OF((unsigned long, … … 69 69 unsigned long vec)); 70 70 local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); 71 local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2); 72 71 73 72 74 #ifdef DYNAMIC_CRC_TABLE … … 368 370 369 371 /* ========================================================================= */ 370 uLong ZEXPORT crc32_combine(crc1, crc2, len2)372 local uLong crc32_combine_(crc1, crc2, len2) 371 373 uLong crc1; 372 374 uLong crc2; 373 z_off _t len2;375 z_off64_t len2; 374 376 { 375 377 int n; … … 378 380 unsigned long odd[GF2_DIM]; /* oddpoweroftwo zeros operator */ 379 381 380 /* degenerate case */381 if (len2 == 0)382 /* degenerate case (also disallow negative lengths) */ 383 if (len2 <= 0) 382 384 return crc1; 383 385 384 386 /* put operator for one zero bit in odd */ 385 odd[0] = 0xedb88320 L;/* CRC32 polynomial */387 odd[0] = 0xedb88320UL; /* CRC32 polynomial */ 386 388 row = 1; 387 389 for (n = 1; n < GF2_DIM; n++) { … … 422 424 return crc1; 423 425 } 426 427 /* ========================================================================= */ 428 uLong ZEXPORT crc32_combine(crc1, crc2, len2) 429 uLong crc1; 430 uLong crc2; 431 z_off_t len2; 432 { 433 return crc32_combine_(crc1, crc2, len2); 434 } 435 436 uLong ZEXPORT crc32_combine64(crc1, crc2, len2) 437 uLong crc1; 438 uLong crc2; 439 z_off64_t len2; 440 { 441 return crc32_combine_(crc1, crc2, len2); 442 }
Note: See TracChangeset
for help on using the changeset viewer.