summaryrefslogtreecommitdiff
path: root/ace/Name_Request_Reply.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-12-06 03:51:24 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-12-06 03:51:24 +0000
commitd08502998eefaf7727f3a9f1c45c0c02a1f30a80 (patch)
tree3092dd6f689b783883392dd7dccd21094699662b /ace/Name_Request_Reply.cpp
parent942b23f5cdf5eab07091eee3a9ded00804b0f28c (diff)
downloadATCD-d08502998eefaf7727f3a9f1c45c0c02a1f30a80.tar.gz
added if NDEBUG protection to some local variables and ACE_UNUSED_ARG to some parameters to avoid compiler warnings when ACE_DEBUG is disabled.
Diffstat (limited to 'ace/Name_Request_Reply.cpp')
-rw-r--r--ace/Name_Request_Reply.cpp103
1 files changed, 52 insertions, 51 deletions
diff --git a/ace/Name_Request_Reply.cpp b/ace/Name_Request_Reply.cpp
index 61e8f735b3f..9b47196b6d9 100644
--- a/ace/Name_Request_Reply.cpp
+++ b/ace/Name_Request_Reply.cpp
@@ -1,4 +1,3 @@
-// Name_Request_Reply.cpp
// $Id$
#define ACE_BUILD_DLL
@@ -13,16 +12,16 @@ ACE_Name_Request::ACE_Name_Request (void)
ACE_TRACE ("ACE_Name_Request::ACE_Name_Request");
}
-// Create a ACE_Name_Request message.
+// Create a ACE_Name_Request message.
ACE_Name_Request::ACE_Name_Request (ACE_INT32 t, // Type of request.
- const ACE_USHORT16 name[], // Name
- const size_t name_length, // size in bytes
- const ACE_USHORT16 value[], //
- const size_t value_length, // size in bytes
- const char type[], //
- const size_t type_length, // size in bytes
- ACE_Time_Value *timeout) // Max time waiting for request.
+ const ACE_USHORT16 name[], // Name
+ const size_t name_length, // size in bytes
+ const ACE_USHORT16 value[], //
+ const size_t value_length, // size in bytes
+ const char type[], //
+ const size_t type_length, // size in bytes
+ ACE_Time_Value *timeout) // Max time waiting for request.
{
ACE_TRACE ("ACE_Name_Request::ACE_Name_Request");
this->msg_type (t);
@@ -62,7 +61,7 @@ ACE_Name_Request::ACE_Name_Request (ACE_INT32 t, // Type of request.
// Compute size of the fixed portion of the message...
size_t len = sizeof this->transfer_ - sizeof this->transfer_.data_;
-
+
// ... then add in the amount of the variable-sized portion.
len += name_length + value_length + type_length ;
@@ -80,14 +79,14 @@ ACE_Name_Request::init (void)
// = Set/get the length of the encoded/decoded message.
-ACE_UINT32
+ACE_UINT32
ACE_Name_Request::length (void) const
{
ACE_TRACE ("ACE_Name_Request::length");
return this->transfer_.length_;
}
-void
+void
ACE_Name_Request::length (ACE_UINT32 l)
{
ACE_TRACE ("ACE_Name_Request::length");
@@ -96,14 +95,14 @@ ACE_Name_Request::length (ACE_UINT32 l)
// = Set/get the type of the message.
-ACE_INT32
+ACE_INT32
ACE_Name_Request::msg_type (void) const
{
ACE_TRACE ("ACE_Name_Request::msg_type");
return this->transfer_.msg_type_;
}
-void
+void
ACE_Name_Request::msg_type (ACE_INT32 t)
{
ACE_TRACE ("ACE_Name_Request::msg_type");
@@ -112,14 +111,14 @@ ACE_Name_Request::msg_type (ACE_INT32 t)
// = Set/get the len of the name
-ACE_UINT32
+ACE_UINT32
ACE_Name_Request::name_len (void) const
{
ACE_TRACE ("ACE_Name_Request::name_len");
return this->transfer_.name_len_;
}
-void
+void
ACE_Name_Request::name_len (ACE_UINT32 t)
{
ACE_TRACE ("ACE_Name_Request::name_len");
@@ -128,14 +127,14 @@ ACE_Name_Request::name_len (ACE_UINT32 t)
// = Set/get the len of the value
-ACE_UINT32
+ACE_UINT32
ACE_Name_Request::value_len (void) const
{
ACE_TRACE ("ACE_Name_Request::value_len");
return this->transfer_.value_len_;
}
-void
+void
ACE_Name_Request::value_len (ACE_UINT32 t)
{
ACE_TRACE ("ACE_Name_Request::value_len");
@@ -144,14 +143,14 @@ ACE_Name_Request::value_len (ACE_UINT32 t)
// = Set/get the len of the type
-ACE_UINT32
+ACE_UINT32
ACE_Name_Request::type_len (void) const
{
ACE_TRACE ("ACE_Name_Request::type_len");
return this->transfer_.type_len_;
}
-void
+void
ACE_Name_Request::type_len (ACE_UINT32 t)
{
ACE_TRACE ("ACE_Name_Request::type_len");
@@ -167,7 +166,7 @@ ACE_Name_Request::block_forever (void) const
return this->transfer_.block_forever_;
}
-void
+void
ACE_Name_Request::block_forever (ACE_UINT32 bs)
{
ACE_TRACE ("ACE_Name_Request::block_forever");
@@ -184,7 +183,7 @@ ACE_Name_Request::timeout (void) const
this->transfer_.usec_timeout_);
}
-void
+void
ACE_Name_Request::timeout (const ACE_Time_Value timeout)
{
ACE_TRACE ("ACE_Name_Request::timeout");
@@ -201,7 +200,7 @@ ACE_Name_Request::name (void) const
return this->name_;
}
-void
+void
ACE_Name_Request::name (const ACE_USHORT16 *t)
{
ACE_TRACE ("ACE_Name_Request::name");
@@ -219,7 +218,7 @@ ACE_Name_Request::value (void) const
return this->value_;
}
-void
+void
ACE_Name_Request::value (const ACE_USHORT16 *c)
{
ACE_TRACE ("ACE_Name_Request::value");
@@ -238,7 +237,7 @@ ACE_Name_Request::type (void) const
return this->type_;
}
-void
+void
ACE_Name_Request::type (const char *c)
{
ACE_TRACE ("ACE_Name_Request::type");
@@ -259,7 +258,7 @@ ACE_Name_Request::encode (void *&buf)
ssize_t len = this->length ();
size_t nv_data_len =
- (this->transfer_.name_len_ + this->transfer_.value_len_)
+ (this->transfer_.name_len_ + this->transfer_.value_len_)
/ sizeof (ACE_USHORT16);
for (size_t i = 0; i < nv_data_len; i++)
@@ -268,7 +267,7 @@ ACE_Name_Request::encode (void *&buf)
buf = (void *) &this->transfer_;
this->transfer_.block_forever_ = htonl (this->transfer_.block_forever_);
- this->transfer_.usec_timeout_ = htonl (this->transfer_.usec_timeout_);
+ this->transfer_.usec_timeout_ = htonl (this->transfer_.usec_timeout_);
this->transfer_.sec_timeout_ = htonl (this->transfer_.sec_timeout_);
this->transfer_.length_ = htonl (this->transfer_.length_);
this->transfer_.msg_type_ = htonl (this->transfer_.msg_type_);
@@ -288,7 +287,7 @@ ACE_Name_Request::decode (void)
ACE_TRACE ("ACE_Name_Request::decode");
// Decode the fixed-sized portion first.
this->transfer_.block_forever_ = ntohl (this->transfer_.block_forever_);
- this->transfer_.usec_timeout_ = ntohl (this->transfer_.usec_timeout_);
+ this->transfer_.usec_timeout_ = ntohl (this->transfer_.usec_timeout_);
this->transfer_.sec_timeout_ = ntohl (this->transfer_.sec_timeout_);
this->transfer_.length_ = ntohl (this->transfer_.length_);
this->transfer_.msg_type_ = ntohl (this->transfer_.msg_type_);
@@ -297,7 +296,7 @@ ACE_Name_Request::decode (void)
this->transfer_.type_len_ = ntohl (this->transfer_.type_len_);
size_t nv_data_len =
- (this->transfer_.name_len_ + this->transfer_.value_len_)
+ (this->transfer_.name_len_ + this->transfer_.value_len_)
/ sizeof (ACE_USHORT16);
for (size_t i = 0; i < nv_data_len; i++)
@@ -320,8 +319,8 @@ ACE_Name_Request::dump (void) const
{
ACE_TRACE ("ACE_Name_Request::dump");
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("*******\nlength = %d\n"),
- this->length ()));
+ ASYS_TEXT ("*******\nlength = %d\n"),
+ this->length ()));
ACE_DEBUG ((LM_DEBUG,
ASYS_TEXT ("message-type = ")));
@@ -379,18 +378,20 @@ ACE_Name_Request::dump (void) const
ASYS_TEXT ("blocking forever\n")));
else
{
+#if !defined (ACE_NDEBUG)
ACE_Time_Value tv = this->timeout ();
+#endif /* ! ACE_NDEBUG */
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("waiting for %ld secs and %ld usecs\n"),
- tv.sec (),
+ ASYS_TEXT ("waiting for %ld secs and %ld usecs\n"),
+ tv.sec (),
tv.usec ()));
}
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("*******\nname_len = %d\n"),
- this->name_len ()));
+ ASYS_TEXT ("*******\nname_len = %d\n"),
+ this->name_len ()));
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("*******\nvalue_len = %d\n"),
- this->value_len ()));
+ ASYS_TEXT ("*******\nvalue_len = %d\n"),
+ this->value_len ()));
ACE_DEBUG ((LM_DEBUG,
ASYS_TEXT ("+++++++\n")));
@@ -408,11 +409,11 @@ ACE_Name_Reply::ACE_Name_Reply (void)
this->length (sizeof this->transfer_);
}
-// Create a ACE_Name_Reply message.
+// Create a ACE_Name_Reply message.
ACE_Name_Reply::ACE_Name_Reply (ACE_UINT32 t, ACE_UINT32 err) // Type of reply.
{
- ACE_TRACE ("ACE_Name_Reply::ACE_Name_Reply");
+ ACE_TRACE ("ACE_Name_Reply::ACE_Name_Reply");
this->msg_type (t);
this->errnum (err);
this->length (sizeof this->transfer_);
@@ -429,14 +430,14 @@ ACE_Name_Reply::init (void)
// = Set/get the length of the encoded/decoded message.
-ACE_UINT32
+ACE_UINT32
ACE_Name_Reply::length (void) const
{
ACE_TRACE ("ACE_Name_Reply::length");
return this->transfer_.length_;
}
-void
+void
ACE_Name_Reply::length (ACE_UINT32 l)
{
ACE_TRACE ("ACE_Name_Reply::length");
@@ -445,14 +446,14 @@ ACE_Name_Reply::length (ACE_UINT32 l)
// = Set/get the type of the message.
-ACE_INT32
+ACE_INT32
ACE_Name_Reply::msg_type (void) const
{
ACE_TRACE ("ACE_Name_Reply::msg_type");
return this->transfer_.type_;
}
-void
+void
ACE_Name_Reply::msg_type (ACE_INT32 t)
{
ACE_TRACE ("ACE_Name_Reply::msg_type");
@@ -461,7 +462,7 @@ ACE_Name_Reply::msg_type (ACE_INT32 t)
// Get the status of the reply (0 == success, -1 == failure).
-ACE_INT32
+ACE_INT32
ACE_Name_Reply::status (void) const
{
ACE_TRACE ("ACE_Name_Reply::status");
@@ -470,7 +471,7 @@ ACE_Name_Reply::status (void) const
// Set the status of the reply (0 == success, -1 == failure).
-void
+void
ACE_Name_Reply::status (ACE_INT32 s)
{
ACE_TRACE ("ACE_Name_Reply::status");
@@ -481,21 +482,21 @@ ACE_Name_Reply::status (ACE_INT32 s)
}
// = Set/get the errno of a failed reply.
-ACE_UINT32
+ACE_UINT32
ACE_Name_Reply::errnum (void) const
{
ACE_TRACE ("ACE_Name_Reply::errnum");
return this->transfer_.errno_;
}
-void
+void
ACE_Name_Reply::errnum (ACE_UINT32 e)
{
ACE_TRACE ("ACE_Name_Reply::errnum");
this->transfer_.errno_ = e;
}
-// Encode the transfer buffer into network byte order
+// Encode the transfer buffer into network byte order
// so that it can be sent to the client.
int
@@ -530,9 +531,9 @@ void
ACE_Name_Reply::dump (void) const
{
ACE_TRACE ("ACE_Name_Reply::dump");
- ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("*******\nlength = %d\nerrnum = %d"),
- this->length (),
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("*******\nlength = %d\nerrnum = %d"),
+ this->length (),
this->errnum ()));
ACE_DEBUG ((LM_DEBUG,
ASYS_TEXT ("type = ")));