summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-16 15:33:25 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-16 15:33:25 +0000
commit5781496de5a3c2427110e1858b0025a386e64e38 (patch)
treee59659be84ad8c3be47c8b320c9843c48308fd19
parenta44e0ef5f2de8a5b902b012e25216566478cd327 (diff)
downloadATCD-5781496de5a3c2427110e1858b0025a386e64e38.tar.gz
(ACE_U_LongLong): use ACE_UIN32 instead of u_long for data members, to ensure that its sizeof is 8 bytes
-rw-r--r--ace/Basic_Types.h88
-rw-r--r--ace/Basic_Types.i14
2 files changed, 51 insertions, 51 deletions
diff --git a/ace/Basic_Types.h b/ace/Basic_Types.h
index 2c7aa32ee5e..9ea2676cdba 100644
--- a/ace/Basic_Types.h
+++ b/ace/Basic_Types.h
@@ -150,58 +150,58 @@
# endif /* ACE_SIZEOF_INT != 8 && ACE_SIZEOF_LONG != 8 */
# else /* ! ACE_HAS_LONGLONG_T */
-class ACE_Export ACE_U_LongLong
- // = TITLE
- // Unsigned long long for platforms that don't have one.
- //
- // = DESCRIPTION
- // Provide our own unsigned long long. This is intended to be
- // use with ACE_High_Res_Timer, so the division operator assumes
- // that the quotient fits into a u_long.
- // Please note that the constructor takes (optionally) two values.
- // The high one contributes 0x100000000 times its value. So,
- // for example, (0, 2) is _not_ 20000000000, but instead
- // 0x200000000. To emphasize this, the default values are expressed
- // in hex, and dump () outputs the value in hex.
-{
-public:
- // = Initialization and termination methods.
- ACE_U_LongLong (const u_long lo = 0x0, const u_long hi = 0x0);
- ACE_U_LongLong (const ACE_U_LongLong &);
- ACE_U_LongLong &operator= (const ACE_U_LongLong &);
- ~ACE_U_LongLong (void);
+ class ACE_Export ACE_U_LongLong
+ // = TITLE
+ // Unsigned long long for platforms that don't have one.
+ //
+ // = DESCRIPTION
+ // Provide our own unsigned long long. This is intended to be
+ // use with ACE_High_Res_Timer, so the division operator assumes
+ // that the quotient fits into a u_long.
+ // Please note that the constructor takes (optionally) two values.
+ // The high one contributes 0x100000000 times its value. So,
+ // for example, (0, 2) is _not_ 20000000000, but instead
+ // 0x200000000. To emphasize this, the default values are expressed
+ // in hex, and dump () outputs the value in hex.
+ {
+ public:
+ // = Initialization and termination methods.
+ ACE_U_LongLong (const ACE_UINT32 lo = 0x0, const ACE_UINT32 hi = 0x0);
+ ACE_U_LongLong (const ACE_U_LongLong &);
+ ACE_U_LongLong &operator= (const ACE_U_LongLong &);
+ ~ACE_U_LongLong (void);
- // = Overloaded relation operators.
- int operator== (const ACE_U_LongLong &) const;
- int operator!= (const ACE_U_LongLong &) const;
- int operator< (const ACE_U_LongLong &) const;
- int operator<= (const ACE_U_LongLong &) const;
- int operator> (const ACE_U_LongLong &) const;
- int operator>= (const ACE_U_LongLong &) const;
+ // = Overloaded relation operators.
+ int operator== (const ACE_U_LongLong &) const;
+ int operator!= (const ACE_U_LongLong &) const;
+ int operator< (const ACE_U_LongLong &) const;
+ int operator<= (const ACE_U_LongLong &) const;
+ int operator> (const ACE_U_LongLong &) const;
+ int operator>= (const ACE_U_LongLong &) const;
- ACE_U_LongLong operator+ (const ACE_U_LongLong &) const;
- ACE_U_LongLong operator- (const ACE_U_LongLong &) const;
- u_long operator/ (const u_long) const;
+ ACE_U_LongLong operator+ (const ACE_U_LongLong &) const;
+ ACE_U_LongLong operator- (const ACE_U_LongLong &) const;
+ ACE_UINT32 operator/ (const ACE_UINT32) const;
- ACE_U_LongLong &operator+= (const ACE_U_LongLong &);
- ACE_U_LongLong &operator-= (const ACE_U_LongLong &);
+ ACE_U_LongLong &operator+= (const ACE_U_LongLong &);
+ ACE_U_LongLong &operator-= (const ACE_U_LongLong &);
- // = Helper methods.
- void output (FILE * = stdout) const;
- // Outputs the value to the FILE, in hex.
+ // = Helper methods.
+ void output (FILE * = stdout) const;
+ // Outputs the value to the FILE, in hex.
- u_long hi (void) const;
- u_long lo (void) const;
+ ACE_UINT32 hi (void) const;
+ ACE_UINT32 lo (void) const;
- void hi (const u_long hi);
- void lo (const u_long lo);
+ void hi (const ACE_UINT32 hi);
+ void lo (const ACE_UINT32 lo);
- ACE_ALLOC_HOOK_DECLARE;
+ ACE_ALLOC_HOOK_DECLARE;
-private:
- u_long hi_;
- u_long lo_;
-};
+ private:
+ ACE_UINT32 hi_;
+ ACE_UINT32 lo_;
+ };
# define ACE_SIZEOF_LONG_LONG 8
# if ACE_SIZEOF_INT != 8 && ACE_SIZEOF_LONG != 8
diff --git a/ace/Basic_Types.i b/ace/Basic_Types.i
index 585f0dde4ba..4eb872481ab 100644
--- a/ace/Basic_Types.i
+++ b/ace/Basic_Types.i
@@ -3,31 +3,31 @@
#if !defined (ACE_WIN32) && !defined (ACE_HAS_LONGLONG_T)
ACE_INLINE
-ACE_U_LongLong::ACE_U_LongLong (const u_long lo, const u_long hi)
+ACE_U_LongLong::ACE_U_LongLong (const ACE_UINT32 lo, const ACE_UINT32 hi)
: hi_ (hi), lo_ (lo)
{
}
-ACE_INLINE u_long
+ACE_INLINE ACE_UINT32
ACE_U_LongLong::hi (void) const
{
return hi_;
}
-ACE_INLINE u_long
+ACE_INLINE ACE_UINT32
ACE_U_LongLong::lo (void) const
{
return lo_;
}
ACE_INLINE void
-ACE_U_LongLong::hi (const u_long hi)
+ACE_U_LongLong::hi (const ACE_UINT32 hi)
{
hi_ = hi;
}
ACE_INLINE void
-ACE_U_LongLong::lo (const u_long lo)
+ACE_U_LongLong::lo (const ACE_UINT32 lo)
{
lo_ = lo;
}
@@ -112,8 +112,8 @@ ACE_U_LongLong::operator- (const ACE_U_LongLong &ll) const
return ret;
}
-ACE_INLINE u_long
-ACE_U_LongLong::operator/ (const u_long ul) const
+ACE_INLINE ACE_UINT32
+ACE_U_LongLong::operator/ (const ACE_UINT32 ul) const
{
return hi_ / ul * ULONG_MAX + lo_ / ul;
}