summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ACE/ChangeLog22
-rw-r--r--ACE/ace/Log_Msg.h28
-rw-r--r--ACE/ace/Message_Block.cpp10
-rw-r--r--ACE/ace/OS_NS_sys_socket.inl9
-rw-r--r--ACE/ace/SOCK_Dgram.cpp15
-rw-r--r--ACE/ace/SOCK_IO.cpp5
-rw-r--r--ACE/ace/Select_Reactor_T.cpp5
-rw-r--r--ACE/ace/config-linux-common.h2
-rw-r--r--ACE/ace/config-sunos5.9.h2
9 files changed, 65 insertions, 33 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index b32e6820b0c..86f4aa2a08c 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,25 @@
+Fri Jan 22 15:44:01 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Log_Msg.h:
+ Only define the ACE_DEBUG/ACE_ERROR* when they are not defined
+ yet when ACE_NLOGGING is defined. This makes it possible for
+ users to globally disable logging but then just enable ACE_ERROR
+
+ * ace/Message_Block.cpp:
+ Code layout changes
+
+ * ace/SOCK_IO.cpp:
+ * ace/SOCK_Dgram.cpp:
+ * ace/Select_Reactor_T.cpp:
+ Just define select_width twice and directly assign it
+
+ * ace/OS_NS_sys_socket.inl:
+ Move local variables into the loop
+
+ * ace/config-sunos5.9.h:
+ * ace/config-linux-common.h:
+ Define ACE_HAS_SENDFILE to 1
+
Thu Jan 22 13:51:01 UTC 2009 Marcel Smit <msmit@remedy.nl>
* tests/Bug_3500_Regression_Test.cpp:
diff --git a/ACE/ace/Log_Msg.h b/ACE/ace/Log_Msg.h
index 81817028517..a59e34390f1 100644
--- a/ACE/ace/Log_Msg.h
+++ b/ACE/ace/Log_Msg.h
@@ -32,13 +32,27 @@
#include "ace/Assert.h"
#if defined (ACE_NLOGGING)
-#define ACE_HEX_DUMP(X) do {} while (0)
-#define ACE_RETURN(Y) do { return (Y); } while (0)
-#define ACE_ERROR_RETURN(X, Y) return (Y)
-#define ACE_ERROR_BREAK(X) { break; }
-#define ACE_ERROR(X) do {} while (0)
-#define ACE_DEBUG(X) do {} while (0)
-#define ACE_ERROR_INIT(VALUE, FLAGS)
+#if !defined (ACE_HEX_DUMP)
+# define ACE_HEX_DUMP(X) do {} while (0)
+#endif
+#if !defined (ACE_RETURN)
+# define ACE_RETURN(Y) do { return (Y); } while (0)
+#endif
+#if !defined (ACE_ERROR_RETURN)
+# define ACE_ERROR_RETURN(X, Y) return (Y)
+#endif
+#if !defined (ACE_ERROR_BREAK)
+# define ACE_ERROR_BREAK(X) { break; }
+#endif
+#if !defined (ACE_ERROR)
+# define ACE_ERROR(X) do {} while (0)
+#endif
+#if !defined (ACE_DEBUG)
+# define ACE_DEBUG(X) do {} while (0)
+#endif
+#if !defined (ACE_ERROR_INIT)
+# define ACE_ERROR_INIT(VALUE, FLAGS)
+#endif
#else
#if !defined (ACE_HEX_DUMP)
#define ACE_HEX_DUMP(X) \
diff --git a/ACE/ace/Message_Block.cpp b/ACE/ace/Message_Block.cpp
index 8a73512f3c2..78594a04442 100644
--- a/ACE/ace/Message_Block.cpp
+++ b/ACE/ace/Message_Block.cpp
@@ -815,8 +815,10 @@ ACE_Data_Block::release_no_delete (ACE_Lock *lock)
}
// This is the case when no lock was passed in
else
- // Lock to be used is our lock
- lock_to_be_used = this->locking_strategy_;
+ {
+ // Lock to be used is our lock
+ lock_to_be_used = this->locking_strategy_;
+ }
// If there's a locking strategy then we need to acquire the lock
// before decrementing the count.
@@ -827,7 +829,9 @@ ACE_Data_Block::release_no_delete (ACE_Lock *lock)
result = this->release_i ();
}
else
- result = this->release_i ();
+ {
+ result = this->release_i ();
+ }
return result;
}
diff --git a/ACE/ace/OS_NS_sys_socket.inl b/ACE/ace/OS_NS_sys_socket.inl
index 041f9a2da23..3b84c06a5d2 100644
--- a/ACE/ace/OS_NS_sys_socket.inl
+++ b/ACE/ace/OS_NS_sys_socket.inl
@@ -520,15 +520,12 @@ ACE_OS::recvv (ACE_HANDLE handle,
0,
0);
# else
- int i, chunklen;
- char *chunkp = 0;
-
// Step through the buffers requested by caller; for each one, cycle
// through reads until it's filled or an error occurs.
- for (i = 0; i < n && result > 0; ++i)
+ for (int i = 0; i < n && result > 0; ++i)
{
- chunkp = buffers[i].iov_base; // Point to part of chunk being read
- chunklen = buffers[i].iov_len; // Track how much to read to chunk
+ char *chunkp = buffers[i].iov_base; // Point to part of chunk being read
+ int chunklen = buffers[i].iov_len; // Track how much to read to chunk
while (chunklen > 0 && result > 0)
{
result = ::recv ((SOCKET) handle, chunkp, chunklen, 0);
diff --git a/ACE/ace/SOCK_Dgram.cpp b/ACE/ace/SOCK_Dgram.cpp
index 2a76eafd02b..28acd86b0b4 100644
--- a/ACE/ace/SOCK_Dgram.cpp
+++ b/ACE/ace/SOCK_Dgram.cpp
@@ -60,13 +60,12 @@ ACE_SOCK_Dgram::recv (iovec *io_vec,
// Check the status of the current socket to make sure there's data
// to recv (or time out).
- int select_width;
# if defined (ACE_WIN32)
// This arg is ignored on Windows and causes pointer truncation
// warnings on 64-bit compiles.
- select_width = 0;
+ int select_width = 0;
# else
- select_width = int (this->get_handle ()) + 1;
+ int select_width = int (this->get_handle ()) + 1;
# endif /* ACE_WIN32 */
switch (ACE_OS::select (select_width,
handle_set,
@@ -459,13 +458,12 @@ ACE_SOCK_Dgram::recv (void *buf,
handle_set.set_bit (this->get_handle ());
// Check the status of the current socket.
- int select_width;
#if defined (ACE_WIN32)
// This arg is ignored on Windows and causes pointer truncation
// warnings on 64-bit compiles.
- select_width = 0;
+ int select_width = 0;
#else
- select_width = int (this->get_handle ()) + 1;
+ int select_width = int (this->get_handle ()) + 1;
#endif /* ACE_WIN32 */
switch (ACE_OS::select (select_width,
handle_set,
@@ -498,13 +496,12 @@ ACE_SOCK_Dgram::send (const void *buf,
handle_set.set_bit (this->get_handle ());
// Check the status of the current socket.
- int select_width;
#if defined (ACE_WIN32)
// This arg is ignored on Windows and causes pointer truncation
// warnings on 64-bit compiles.
- select_width = 0;
+ int select_width = 0;
#else
- select_width = int (this->get_handle ()) + 1;
+ int select_width = int (this->get_handle ()) + 1;
#endif /* ACE_WIN32 */
switch (ACE_OS::select (select_width,
0,
diff --git a/ACE/ace/SOCK_IO.cpp b/ACE/ace/SOCK_IO.cpp
index 18f52ad1efd..36a7d171456 100644
--- a/ACE/ace/SOCK_IO.cpp
+++ b/ACE/ace/SOCK_IO.cpp
@@ -44,13 +44,12 @@ ACE_SOCK_IO::recvv (iovec *io_vec,
io_vec->iov_base = 0;
// Check the status of the current socket.
- int select_width;
# if defined (ACE_WIN32)
// This arg is ignored on Windows and causes pointer truncation
// warnings on 64-bit compiles.
- select_width = 0;
+ int select_width = 0;
# else
- select_width = int (this->get_handle ()) + 1;
+ int select_width = int (this->get_handle ()) + 1;
# endif /* ACE_WIN32 */
switch (ACE_OS::select (select_width,
handle_set,
diff --git a/ACE/ace/Select_Reactor_T.cpp b/ACE/ace/Select_Reactor_T.cpp
index 1eb5a17d79d..57f5f9f36bf 100644
--- a/ACE/ace/Select_Reactor_T.cpp
+++ b/ACE/ace/Select_Reactor_T.cpp
@@ -1493,13 +1493,12 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::check_handles (void)
// variant since fstat always returns an error on socket FDs.
rd_mask.set_bit (h);
- int select_width;
# if defined (ACE_WIN32)
// This arg is ignored on Windows and causes pointer truncation
// warnings on 64-bit compiles.
- select_width = 0;
+ int select_width = 0;
# else
- select_width = int (h) + 1;
+ int select_width = int (h) + 1;
# endif /* ACE_WIN32 */
if (ACE_OS::select (select_width,
diff --git a/ACE/ace/config-linux-common.h b/ACE/ace/config-linux-common.h
index 1cc841a66ea..7122d00a974 100644
--- a/ACE/ace/config-linux-common.h
+++ b/ACE/ace/config-linux-common.h
@@ -387,7 +387,7 @@
#define ACE_HAS_TERMIOS
// Linux implements sendfile().
-#define ACE_HAS_SENDFILE
+#define ACE_HAS_SENDFILE 1
#define ACE_HAS_VOIDPTR_MMAP
diff --git a/ACE/ace/config-sunos5.9.h b/ACE/ace/config-sunos5.9.h
index 42043928fec..c34f54c8e37 100644
--- a/ACE/ace/config-sunos5.9.h
+++ b/ACE/ace/config-sunos5.9.h
@@ -12,7 +12,7 @@
// #include the SunOS 5.8 config, then add any SunOS 5.9 updates below.
#include "ace/config-sunos5.8.h"
-#define ACE_HAS_SENDFILE
+#define ACE_HAS_SENDFILE 1
#define ACE_LACKS_THR_CONCURRENCY_FUNCS
#endif /* ACE_CONFIG_H */