summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-23 06:31:08 +0000
committerjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-23 06:31:08 +0000
commit6516b856698de3e4028e4bb00c482a82b7ecdadf (patch)
tree22e217e2f5d52048c110fadcd22b84a6cac82984
parentd3f32a32478e4c1200eef33f9a339438663cdf05 (diff)
downloadATCD-6516b856698de3e4028e4bb00c482a82b7ecdadf.tar.gz
ChangeLogTag: Wed Sep 22 14:40:15 2004 J.T. Conklin <jtc@acorntoolworks.com>
-rw-r--r--ChangeLog15
-rw-r--r--NEWS3
-rw-r--r--ace/ACE.cpp38
-rw-r--r--ace/ACE.h6
4 files changed, 29 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index 31411481d81..6e7d51f91d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,22 @@
+Wed Sep 22 14:40:15 2004 J.T. Conklin <jtc@acorntoolworks.com>
+
+ * ace/ACE.cpp:
+
+ Changed ACE::crc32() family of functions to NOT fold in the
+ length of the string/buffer/iovec into the CRC.
+
+ * ace/ACE.cpp:
+ * ace/ACE.h:
+
+ Changed return type of ACE::crc32() family of functions from
+ u_long to ACE_UINT32.
+
Wed Sep 22 13:46:01 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu>
* bin/msvc_cidlc.pl:
CIDLC cannot be compiled in release mode. Enable only debug
- mode.
+ mode.
Wed Sep 22 10:35:18 2004 J.T. Conklin <jtc@acorntoolworks.com>
diff --git a/NEWS b/NEWS
index ed619097d75..49743abe27a 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,9 @@ PLANNED MAJOR CHANGES TARGETED FOR ACE-5.4.3
Wed Aug 25 14:58:51 2004 Rich Seibel <seibel_r@ociweb.com>
Wed Aug 25 14:49:11 2004 Rich Seibel <seibel_r@ociweb.com>
+. Changed ACE::crc32() family of functions to NOT fold in the length
+ of the string/buffer/iovec into the CRC.
+
USER VISIBLE CHANGES BETWEEN ACE-5.4.1 and ACE-5.4.2
====================================================
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index 8749dc05295..b4393bfcd6b 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -422,7 +422,7 @@ ACE::hash_pjw (const wchar_t *str)
namespace ACE
{
- const u_long crc_table_[] =
+ const ACE_UINT32 crc_table_[] =
{
0x0,
0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
@@ -483,36 +483,28 @@ namespace ACE
// computes the CRC for it (it stops on the first '\0' character).
// UNICOS UINT32's are 64-bit on the Cray PVP architecture
-#if defined(_UNICOS) || (ACE_SIZEOF_LONG == 8)
+#if defined(_UNICOS)
# define COMPUTE(var, ch) (var) = ( 0x00000000ffffffff & ((var) << 8)) ^ ACE::crc_table_[(((var) >> 24) ^ (ch))&0xff]
#else /* _UNICOS */
# define COMPUTE(var, ch) (var) = ((var) << 8) ^ ACE::crc_table_[(((var) >> 24) ^ (ch))&0xff]
#endif /* _UNICOS */
-u_long
+ACE_UINT32
ACE::crc32 (const char *string)
{
register ACE_UINT32 crc = 0;
- u_long len = 0;
-
for (const char *p = string;
*p != 0;
++p)
{
COMPUTE (crc, *p);
- ++len;
}
- // Include the length of the string.
-
- for (; len != 0; len >>= 8)
- COMPUTE (crc, len & 0xff);
-
return ~crc;
}
-u_long
+ACE_UINT32
ACE::crc32 (const char *buffer, ACE_UINT32 len)
{
register ACE_UINT32 crc = 0;
@@ -520,38 +512,26 @@ ACE::crc32 (const char *buffer, ACE_UINT32 len)
for (const char *p = buffer;
p != buffer + len;
++p)
- COMPUTE (crc, *p);
-
- // Include the length of the string.
-
- for (; len != 0; len >>= 8)
- COMPUTE (crc, len & 0xff);
-
+ {
+ COMPUTE (crc, *p);
+ }
+
return ~crc;
}
-u_long
+ACE_UINT32
ACE::crc32 (iovec *iov, int len)
{
register ACE_UINT32 crc = 0;
- int total_len = 0;
-
for (int i = 0; i < len; ++i)
{
for (const char *p = (char *) iov[i].iov_base;
p != (char *) iov[i].iov_base + iov[i].iov_len;
++p)
COMPUTE (crc, *p);
-
- total_len += iov[i].iov_len;
}
- // Include the length of the string.
-
- for (; total_len != 0; total_len >>= 8)
- COMPUTE (crc, total_len & 0xff);
-
return ~crc;
}
diff --git a/ace/ACE.h b/ace/ACE.h
index 3a0e4063394..6ac6e8fb8b1 100644
--- a/ace/ACE.h
+++ b/ace/ACE.h
@@ -538,15 +538,15 @@ namespace ACE
/// Computes the ISO 8802-3 standard 32 bits CRC for the string
/// (not for a file).
- extern ACE_Export u_long crc32 (const char *str);
+ extern ACE_Export ACE_UINT32 crc32 (const char *str);
/// Computes the ISO 8802-3 standard 32 bits CRC for the given
/// buffer (the length is included in the CRC).
- extern ACE_Export u_long crc32 (const char *buf, ACE_UINT32 len);
+ extern ACE_Export ACE_UINT32 crc32 (const char *buf, ACE_UINT32 len);
/// Computes the ISO 8802-3 standard 32 bits CRC for the
/// @ len iovec buffers.
- extern ACE_Export u_long crc32 (iovec *iov, int len);
+ extern ACE_Export ACE_UINT32 crc32 (iovec *iov, int len);
/// Euclid's greatest common divisor algorithm.
extern ACE_Export u_long gcd (u_long x, u_long y);