diff options
author | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-09-24 19:00:53 +0000 |
---|---|---|
committer | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-09-24 19:00:53 +0000 |
commit | d3315e8f5289b13ebd375d96ab9ab5ec70af7f5e (patch) | |
tree | 32bb369a539c43dd26e7568800990464d36ca2ef /ace | |
parent | 7c9d7207024dc658c99a760f1083e0aef885031a (diff) | |
download | ATCD-d3315e8f5289b13ebd375d96ab9ab5ec70af7f5e.tar.gz |
ChangeLogTag: Fri Sep 24 11:07:03 2004 J.T. Conklin <jtc@acorntoolworks.com>
Diffstat (limited to 'ace')
-rw-r--r-- | ace/ACE.h | 12 | ||||
-rw-r--r-- | ace/ACE_crc32.cpp | 8 | ||||
-rw-r--r-- | ace/ACE_crc_ccitt.cpp | 8 |
3 files changed, 16 insertions, 12 deletions
diff --git a/ace/ACE.h b/ace/ACE.h index fe6c599398d..cb600792613 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -540,20 +540,24 @@ namespace ACE extern ACE_Export ACE_UINT16 crc_ccitt(const char *str); /// Computes CRC-CCITT for the buffer. - extern ACE_Export ACE_UINT16 crc_ccitt(const void *buf, size_t len); + extern ACE_Export ACE_UINT16 crc_ccitt(const void *buf, size_t len, + ACE_UINT16 crc = 0); /// Computes CRC-CCITT for the @ len iovec buffers. - extern ACE_Export ACE_UINT16 crc_ccitt(const iovec *iov, int len); + extern ACE_Export ACE_UINT16 crc_ccitt(const iovec *iov, int len, + ACE_UINT16 crc = 0); /// Computes the ISO 8802-3 standard 32 bits CRC for the string. extern ACE_Export ACE_UINT32 crc32 (const char *str); /// Computes the ISO 8802-3 standard 32 bits CRC for the buffer. - extern ACE_Export ACE_UINT32 crc32 (const void *buf, size_t len); + extern ACE_Export ACE_UINT32 crc32 (const void *buf, size_t len, + ACE_UINT32 crc = 0); /// Computes the ISO 8802-3 standard 32 bits CRC for the /// @ len iovec buffers. - extern ACE_Export ACE_UINT32 crc32 (const iovec *iov, int len); + extern ACE_Export ACE_UINT32 crc32 (const iovec *iov, int len, + ACE_UINT32 crc = 0); /// Euclid's greatest common divisor algorithm. extern ACE_Export u_long gcd (u_long x, u_long y); diff --git a/ace/ACE_crc32.cpp b/ace/ACE_crc32.cpp index fb13fefbc31..b842daa86cf 100644 --- a/ace/ACE_crc32.cpp +++ b/ace/ACE_crc32.cpp @@ -120,9 +120,9 @@ ACE::crc32 (const char *string) } ACE_UINT32 -ACE::crc32 (const void *buffer, size_t len) +ACE::crc32 (const void *buffer, size_t len, ACE_UINT32 crc) { - ACE_UINT32 crc = 0xFFFFFFFF; + crc = ~crc; for (const char *p = (const char *) buffer, *e = (const char *) buffer + len; @@ -136,9 +136,9 @@ ACE::crc32 (const void *buffer, size_t len) } ACE_UINT32 -ACE::crc32 (const iovec *iov, int len) +ACE::crc32 (const iovec *iov, int len, ACE_UINT32 crc) { - ACE_UINT32 crc = 0xFFFFFFFF; + crc = ~crc; for (int i = 0; i < len; ++i) { diff --git a/ace/ACE_crc_ccitt.cpp b/ace/ACE_crc_ccitt.cpp index 5f16270abb7..894f8166532 100644 --- a/ace/ACE_crc_ccitt.cpp +++ b/ace/ACE_crc_ccitt.cpp @@ -87,9 +87,9 @@ ACE::crc_ccitt (const char *string) } ACE_UINT16 -ACE::crc_ccitt (const void *buffer, size_t len) +ACE::crc_ccitt (const void *buffer, size_t len, ACE_UINT16 crc) { - ACE_UINT16 crc = 0xFFFF; + crc = ~crc; for (const char *p = (const char *) buffer, *e = (const char *) buffer + len; @@ -103,9 +103,9 @@ ACE::crc_ccitt (const void *buffer, size_t len) } ACE_UINT16 -ACE::crc_ccitt (const iovec *iov, int len) +ACE::crc_ccitt (const iovec *iov, int len, ACE_UINT16 crc) { - ACE_UINT16 crc = 0xFFFF; + crc = ~crc; for (int i = 0; i < len; ++i) { |