diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-25 06:28:16 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-25 06:28:16 +0000 |
commit | 75d716e297bc9012a549da20ef1fa6180d8f050e (patch) | |
tree | d8fbeeedab192d77af35ac46c8c0b458e3da1838 | |
parent | 57811700d42143f211f94f83de8806a537e2a16a (diff) | |
download | gcc-75d716e297bc9012a549da20ef1fa6180d8f050e.tar.gz |
include/:
PR bootstrap/40854
* libiberty.h (xcrc32): Rename from crc32.
libiberty/:
PR bootstrap/40854
* crc32.c (xcrc32): Rename from crc32.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150075 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/libiberty.h | 2 | ||||
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/crc32.c | 15 |
4 files changed, 25 insertions, 2 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 6aba7751e75..4bd5e81f66e 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,10 @@ 2009-07-24 Ian Lance Taylor <iant@google.com> + PR bootstrap/40854 + * libiberty.h (xcrc32): Rename from crc32. + +2009-07-24 Ian Lance Taylor <iant@google.com> + * libiberty.h (crc32): Declare. 2009-07-20 Cary Coutant <ccoutant@google.com> diff --git a/include/libiberty.h b/include/libiberty.h index e50ad64712e..a7716e4a414 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -313,7 +313,7 @@ extern double physmem_total (void); extern double physmem_available (void); /* Compute the 32-bit CRC of a block of memory. */ -extern unsigned int crc32 (const unsigned char *, int, unsigned int); +extern unsigned int xcrc32 (const unsigned char *, int, unsigned int); /* These macros provide a K&R/C89/C++-friendly way of allocating structures with nice encapsulation. The XDELETE*() macros are technically diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 516a90d58fc..6033935edc3 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,5 +1,10 @@ 2009-07-24 Ian Lance Taylor <iant@google.com> + PR bootstrap/40854 + * crc32.c (xcrc32): Rename from crc32. + +2009-07-24 Ian Lance Taylor <iant@google.com> + * crc32.c: New file. * Makefile.in: Rebuild dependencies. (CFILES): Add crc32.c. diff --git a/libiberty/crc32.c b/libiberty/crc32.c index 2171a3d1c7f..c12916b5216 100644 --- a/libiberty/crc32.c +++ b/libiberty/crc32.c @@ -150,12 +150,25 @@ protocol for the @samp{qCRC} command. In order to get the same results as gdb for a block of data, you must pass the first CRC parameter as @code{0xffffffff}. +This CRC can be specified as: + + Width : 32 + Poly : 0x04c11db7 + Init : parameter, typically 0xffffffff + RefIn : false + RefOut : false + XorOut : 0 + +This differs from the "standard" CRC-32 algorithm in that the values +are not reflected, and there is no final XOR value. These differences +make it easy to compose the values of multiple blocks. + @end deftypefn */ unsigned int -crc32 (const unsigned char *buf, int len, unsigned int init) +xcrc32 (const unsigned char *buf, int len, unsigned int init) { unsigned int crc = init; while (len--) |