aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2009-07-25 06:28:16 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2009-07-25 06:28:16 +0000
commit330b922f19394dccb7f3d00ed9dd0d4223787a28 (patch)
treed8fbeeedab192d77af35ac46c8c0b458e3da1838 /libiberty
parent67a6e8167985001be8a50485a8cd8a0d0355a363 (diff)
downloadgcc-330b922f19394dccb7f3d00ed9dd0d4223787a28.zip
gcc-330b922f19394dccb7f3d00ed9dd0d4223787a28.tar.gz
gcc-330b922f19394dccb7f3d00ed9dd0d4223787a28.tar.bz2
re PR bootstrap/40854 (Conflicting crc32 functions in libiberty and zlib)
include/: PR bootstrap/40854 * libiberty.h (xcrc32): Rename from crc32. libiberty/: PR bootstrap/40854 * crc32.c (xcrc32): Rename from crc32. From-SVN: r150075
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/crc32.c15
2 files changed, 19 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 516a90d..6033935 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 2171a3d..c12916b 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--)