summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2009-09-28 17:45:23 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2009-09-28 17:45:23 +0000
commit3ff47a18ae536330ee6f1cf5338b9677f1192fea (patch)
tree2fde2a0049538658ed9e33047351f1eef2115089 /ACE
parent041554937a9541c8a24678f6dd26d78053cacec4 (diff)
downloadATCD-3ff47a18ae536330ee6f1cf5338b9677f1192fea.tar.gz
Mon Sep 28 17:45:44 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/Message_Block.h: Doxygen change * ace/CDR_Base.{h,cpp}: Changed consolidate to have a return value because setting the new size can fail. Return 0 on ok, -1 on failure. Thanks to Annette Wilson <awilson at raytheonvtc dot com>
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ChangeLog10
-rw-r--r--ACE/ace/CDR_Base.cpp13
-rw-r--r--ACE/ace/CDR_Base.h14
-rw-r--r--ACE/ace/Message_Block.h4
4 files changed, 29 insertions, 12 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index b3c7bacd5e3..521fc587211 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,13 @@
+Mon Sep 28 17:45:44 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Message_Block.h:
+ Doxygen change
+
+ * ace/CDR_Base.{h,cpp}:
+ Changed consolidate to have a return value because setting the
+ new size can fail. Return 0 on ok, -1 on failure. Thanks to
+ Annette Wilson <awilson at raytheonvtc dot com>
+
Mon Sep 28 13:14:44 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/make_release.py:
diff --git a/ACE/ace/CDR_Base.cpp b/ACE/ace/CDR_Base.cpp
index eb6f0bb0514..ae32a7a8365 100644
--- a/ACE/ace/CDR_Base.cpp
+++ b/ACE/ace/CDR_Base.cpp
@@ -549,20 +549,22 @@ ACE_CDR::total_length (const ACE_Message_Block* begin,
return l;
}
-void
+int
ACE_CDR::consolidate (ACE_Message_Block *dst,
const ACE_Message_Block *src)
{
if (src == 0)
- return;
+ return 0;
- size_t newsize =
+ size_t const newsize =
ACE_CDR::first_size (ACE_CDR::total_length (src, 0)
+ ACE_CDR::MAX_ALIGNMENT);
- dst->size (newsize);
+
+ if (dst->size (newsize) == -1)
+ return -1;
#if !defined (ACE_CDR_IGNORE_ALIGNMENT)
- // We must copy the contents of <src> into the new buffer, but
+ // We must copy the contents of src into the new buffer, but
// respecting the alignment.
ptrdiff_t srcalign =
ptrdiff_t(src->rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT;
@@ -586,6 +588,7 @@ ACE_CDR::consolidate (ACE_Message_Block *dst,
else
dst->wr_ptr (i->length ());
}
+ return 0;
}
#if defined (NONNATIVE_LONGLONG)
diff --git a/ACE/ace/CDR_Base.h b/ACE/ace/CDR_Base.h
index 94d28a4dd86..2cddbc0c12b 100644
--- a/ACE/ace/CDR_Base.h
+++ b/ACE/ace/CDR_Base.h
@@ -124,7 +124,7 @@ public:
/// Use whichever byte order is native to this machine.
BYTE_ORDER_NATIVE = ACE_CDR_BYTE_ORDER
};
-
+
/**
* Do byte swapping for each basic IDL type size. There exist only
* routines to put byte, halfword (2 bytes), word (4 bytes),
@@ -177,10 +177,14 @@ public:
*/
static int grow (ACE_Message_Block *mb, size_t minsize);
- /// Copy a message block chain into a single message block,
- /// preserving the alignment of the first message block of the
- /// original stream, not the following message blocks.
- static void consolidate (ACE_Message_Block *dst,
+ /**
+ * Copy a message block chain into a single message block,
+ * preserving the alignment of the first message block of the
+ * original stream, not the following message blocks.
+ * @retval -1 Failure
+ * @retval 0 Success.
+ */
+ static int consolidate (ACE_Message_Block *dst,
const ACE_Message_Block *src);
static size_t total_length (const ACE_Message_Block *begin,
diff --git a/ACE/ace/Message_Block.h b/ACE/ace/Message_Block.h
index 443f6552d3a..449df677d4b 100644
--- a/ACE/ace/Message_Block.h
+++ b/ACE/ace/Message_Block.h
@@ -505,8 +505,8 @@ public:
/**
* Set the number of bytes in the top-level Message_Block,
- * reallocating space if necessary. However, the <rd_ptr_> and
- * <wr_ptr_> remain at the original offsets into the buffer, even if
+ * reallocating space if necessary. However, the @c rd_ptr_ and
+ * @c wr_ptr_ remain at the original offsets into the buffer, even if
* it is reallocated. Returns 0 if successful, else -1.
*/
int size (size_t length);