summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2013-09-26 22:18:54 +0000
committerSteve Huston <shuston@riverace.com>2013-09-26 22:18:54 +0000
commit9d29781b87c948a46cfa9be0f12ce978cb06846b (patch)
treed9520582729effd061bc0ebe3c28c09c3136462d
parent6a7b1f8101bfe9d914b56a371fa0527d2293e353 (diff)
downloadATCD-9d29781b87c948a46cfa9be0f12ce978cb06846b.tar.gz
ChangeLogTag:Thu Sep 26 20:22:53 UTC 2013 Steve Huston <shuston@riverace.com> and Thu Aug 29 22:06:55 UTC 2013 Steve Huston <shuston@riverace.com>
-rw-r--r--ACE/ChangeLog16
-rw-r--r--ACE/ace/ACE.cpp3
-rw-r--r--ACE/ace/OS_NS_unistd.inl5
-rw-r--r--ACE/ace/README2
-rw-r--r--ACE/ace/config-win32-common.h4
-rw-r--r--ACE/tests/OS_Test.cpp26
6 files changed, 54 insertions, 2 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index ff740f76495..f80fced2d1f 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,19 @@
+Thu Sep 26 20:22:53 UTC 2013 Steve Huston <shuston@riverace.com>
+
+ * ace/ACE.cpp (recvv_n_i): Resolve 64-bit compile warning on Windows.
+
+Thu Aug 29 22:06:55 UTC 2013 Steve Huston <shuston@riverace.com>
+
+ * ace/OS_NS_unistd.inl (swab): Added support for ACE_HAS_INT_SWAB for
+ platforms where the 'length' arg to swab() is an int instead of
+ the standard ssize_t.
+
+ * ace/config-win32-common.h: Added ACE_HAS_INT_SWAB
+
+ * tests/OS_Test.cpp: Added a ACE_OS::swab() test.
+
+ * ace/README: Added ACE_HAS_INT_SWAB description.
+
Mon May 27 10:09:24 CEST 2013 Johnny Willemsen <jwillemsen@remedy.nl>
* ACE version 6.2.0 released.
diff --git a/ACE/ace/ACE.cpp b/ACE/ace/ACE.cpp
index 8d635d8f399..6328905e882 100644
--- a/ACE/ace/ACE.cpp
+++ b/ACE/ace/ACE.cpp
@@ -1013,7 +1013,8 @@ ACE::recvv_n_i (ACE_HANDLE handle,
{
char *base = static_cast<char *> (iov[s].iov_base);
iov[s].iov_base = base + n;
- iov[s].iov_len = iov[s].iov_len - n;
+ // This blind cast is safe because n < iov_len, after above loop.
+ iov[s].iov_len = iov[s].iov_len - static_cast<u_long> (n);
}
}
diff --git a/ACE/ace/OS_NS_unistd.inl b/ACE/ace/OS_NS_unistd.inl
index af393eb36be..bdc05b320df 100644
--- a/ACE/ace/OS_NS_unistd.inl
+++ b/ACE/ace/OS_NS_unistd.inl
@@ -1009,7 +1009,12 @@ ACE_OS::swab (const void *src,
const char *tmp = static_cast<const char*> (src);
char *from = const_cast<char *> (tmp);
char *to = static_cast<char *> (dest);
+# if defined (ACE_HAS_INT_SWAB)
+ int ilength = ACE_Utils::truncate_cast<int> (length);
+ ::swab (from, to, ilength);
+# else
::swab (from, to, length);
+# endif /* ACE_HAS_INT_SWAB */
#elif defined (ACE_HAS_CONST_CHAR_SWAB)
const char *from = static_cast<const char*> (src);
char *to = static_cast<char *> (dest);
diff --git a/ACE/ace/README b/ACE/ace/README
index 520e218e443..4a5b989f807 100644
--- a/ACE/ace/README
+++ b/ACE/ace/README
@@ -332,6 +332,8 @@ ACE_HAS_IDTYPE_T Compiler/platform supports
ACE_HAS_INLINED_OSCALLS Inline all the static class OS
methods to remove call
overhead
+ACE_HAS_INT_SWAB Platform's swab function has length
+ argument of type int, not ssize_t.
ACE_HAS_IP_MULTICAST Platform supports IP multicast
ACE_HAS_IPV6 Platform supports IPv6.
ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED gethostbyaddr does not handle
diff --git a/ACE/ace/config-win32-common.h b/ACE/ace/config-win32-common.h
index 5846e3e9730..f0b53719116 100644
--- a/ACE/ace/config-win32-common.h
+++ b/ACE/ace/config-win32-common.h
@@ -603,8 +603,10 @@
#define ACE_LACKS_ALPHASORT
#define ACE_LACKS_MKSTEMP
#define ACE_LACKS_LSTAT
-// Looks like Win32 has a non-const swab function
+// Looks like Win32 has a non-const swab function, and it takes the
+// non-standard int len (rather than ssize_t).
#define ACE_HAS_NONCONST_SWAB
+#define ACE_HAS_INT_SWAB
// gethostbyaddr does not handle IPv6-mapped-IPv4 addresses
#define ACE_HAS_BROKEN_GETHOSTBYADDR_V4MAPPED
diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp
index f89fba70922..ee0e4e3a1e9 100644
--- a/ACE/tests/OS_Test.cpp
+++ b/ACE/tests/OS_Test.cpp
@@ -1374,6 +1374,29 @@ log2_test (void)
}
int
+swab_test (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Testing swab method\n")));
+
+ int error_count = 0;
+ char from[] = "BADCFEHGJILKNMPORQTSVUXWZY";
+ char to[] = "..........................";
+ char expect[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ ACE_OS::swab (from, to, sizeof (from));
+ if (ACE_OS::strcmp (to, expect) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("swab error: %C, expected %C\n"),
+ to, expect));
+ ++error_count;
+ }
+
+ return error_count;
+}
+
+int
run_main (int, ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("OS_Test"));
@@ -1440,6 +1463,9 @@ run_main (int, ACE_TCHAR *[])
if ((result = ace_ctype_test ()) != 0)
status = result;
+ if ((result = swab_test ()) != 0)
+ status = result;
+
if ((result = compiler_test ()) != 0)
status = result;