summaryrefslogtreecommitdiff
path: root/ace/Basic_Types.i
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2003-02-20 17:04:19 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2003-02-20 17:04:19 +0000
commit29b1f2b8f8d739783db173628961cdc19b272f31 (patch)
tree60955587fb9ffb8b0581545b140807cc62000d0e /ace/Basic_Types.i
parent9cf80f9de4604004951879e2c249c05ed1b1f098 (diff)
downloadATCD-29b1f2b8f8d739783db173628961cdc19b272f31.tar.gz
ChangeLogTag:Thu Feb 20 09:01:55 2003 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'ace/Basic_Types.i')
-rw-r--r--ace/Basic_Types.i54
1 files changed, 53 insertions, 1 deletions
diff --git a/ace/Basic_Types.i b/ace/Basic_Types.i
index 0012b00defb..d0858fa03b7 100644
--- a/ace/Basic_Types.i
+++ b/ace/Basic_Types.i
@@ -1,4 +1,5 @@
-/* -*- C++ -*- */
+// -*- C++ -*-
+//
// $Id$
#if defined (ACE_LACKS_LONGLONG_T)
@@ -135,6 +136,37 @@ ACE_U_LongLong::operator= (const ACE_U_LongLong &n)
return *this;
}
+ACE_INLINE ACE_U_LongLong &
+ACE_U_LongLong::operator= (const ACE_INT32 &rhs)
+{
+ if (rhs >= 0)
+ {
+ l_ () = ACE_static_cast (ACE_UINT32, rhs);
+ h_ () = 0;
+ }
+ else
+ {
+ // We do not handle the case where a negative 32 bit integer is
+ // assigned to this representation of a 64 bit unsigned integer.
+ // The "undefined behavior" behavior performed by this
+ // implementation is to simply set all bits to zero.
+ l_ () = 0;
+ h_ () = 0;
+ }
+
+ return *this;
+}
+
+ACE_INLINE ACE_U_LongLong &
+ACE_U_LongLong::operator= (const ACE_UINT32 &rhs)
+{
+ l_ () = rhs;
+ h_ () = 0;
+
+ return *this;
+}
+
+
ACE_INLINE ACE_U_LongLong
ACE_U_LongLong::operator+ (const ACE_U_LongLong &n) const
{
@@ -358,6 +390,26 @@ ACE_U_LongLong::operator-- ()
return *this;
}
+ACE_INLINE const ACE_U_LongLong
+ACE_U_LongLong::operator++ (int)
+{
+ // Post-increment operator should always be implemented in terms of
+ // the pre-increment operator to enforce consistent semantics.
+ ACE_U_LongLong temp (*this);
+ ++*this;
+ return *temp;
+}
+
+ACE_INLINE const ACE_U_LongLong
+ACE_U_LongLong::operator-- (int)
+{
+ // Post-decrement operator should always be implemented in terms of
+ // the pre-decrement operator to enforce consistent semantics.
+ ACE_U_LongLong temp (*this);
+ --*this;
+ return *temp;
+}
+
ACE_INLINE ACE_U_LongLong &
ACE_U_LongLong::operator|= (const ACE_U_LongLong n)
{