dbertoni 01/08/10 10:50:09
Modified: c/src/PlatformSupport DoubleSupport.cpp DoubleSupport.hpp
Log:
Use new macro for unaligned objects.
Revision Changes Path
1.27 +15 -12 xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp
Index: DoubleSupport.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- DoubleSupport.cpp 2001/08/06 01:32:36 1.26
+++ DoubleSupport.cpp 2001/08/10 17:50:08 1.27
@@ -97,36 +97,39 @@
#endif
+typedef DoubleSupport::DWORDPointerType
DWORDPointerType;
+typedef DoubleSupport::UnalignedDWORDPointerType
UnalignedDWORDPointerType;
-const unsigned int* const DoubleSupport::s_NaNFirstDWORD =
+
+const DWORDPointerType
DoubleSupport::s_NaNFirstDWORD =
#if defined(XALAN_OLD_STYLE_CASTS)
- (const unsigned int*)&s_NaN;
+ (DWORDPointerType)&s_NaN;
#else
- reinterpret_cast<const unsigned
int*>(&s_NaN);
+
reinterpret_cast<DWORDPointerType>(&s_NaN);
#endif
-const unsigned int* const DoubleSupport::s_NaNSecondDWORD =
+const UnalignedDWORDPointerType DoubleSupport::s_NaNSecondDWORD
=
s_NaNFirstDWORD + 1;
-const unsigned int* const DoubleSupport::s_positiveZeroFirstDWORD =
+const DWORDPointerType
DoubleSupport::s_positiveZeroFirstDWORD =
#if defined(XALAN_OLD_STYLE_CASTS)
- (const unsigned int*)&s_positiveZero;
+ (DWORDPointerType)&s_positiveZero;
#else
- reinterpret_cast<const unsigned
int*>(&s_positiveZero);
+
reinterpret_cast<DWORDPointerType>(&s_positiveZero);
#endif
-const unsigned int* const DoubleSupport::s_positiveZeroSecondDWORD =
s_positiveZeroFirstDWORD + 1;
+const UnalignedDWORDPointerType
DoubleSupport::s_positiveZeroSecondDWORD = s_positiveZeroFirstDWORD + 1;
-const unsigned int* const DoubleSupport::s_negativeZeroFirstDWORD =
+const DWORDPointerType
DoubleSupport::s_negativeZeroFirstDWORD =
#if defined(XALAN_OLD_STYLE_CASTS)
- (const unsigned int*)&s_negativeZero;
+ (DWORDPointerType)&s_negativeZero;
#else
- reinterpret_cast<const unsigned
int*>(&s_negativeZero);
+
reinterpret_cast<DWORDPointerType>(&s_negativeZero);
#endif
-const unsigned int* const DoubleSupport::s_negativeZeroSecondDWORD =
s_negativeZeroFirstDWORD + 1;
+const UnalignedDWORDPointerType
DoubleSupport::s_negativeZeroSecondDWORD = s_negativeZeroFirstDWORD + 1;
1.13 +26 -23 xml-xalan/c/src/PlatformSupport/DoubleSupport.hpp
Index: DoubleSupport.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DoubleSupport.hpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DoubleSupport.hpp 2001/07/27 05:27:38 1.12
+++ DoubleSupport.hpp 2001/08/10 17:50:08 1.13
@@ -92,14 +92,14 @@
isNaN(double theNumber)
{
// Compare the two DWORDs of the double as unsigned longs.
- const unsigned int* const theFirstDWORD =
+ const DWORDPointerType theFirstDWORD =
#if defined(XALAN_OLD_STYLE_CASTS)
- (const unsigned int*)&theNumber;
+ (DWORDPointerType)&theNumber;
#else
- reinterpret_cast<const unsigned int*>(&theNumber);
+ reinterpret_cast<DWORDPointerType>(&theNumber);
#endif
- const unsigned int* const theSecondDWORD =
+ const UnalignedDWORDPointerType theSecondDWORD =
theFirstDWORD + 1;
return *theFirstDWORD == *s_NaNFirstDWORD &&
@@ -140,14 +140,14 @@
isPositiveZero(double theNumber)
{
// Compare the two DWORDs of the double as unsigned longs.
- const unsigned int* const theFirstDWORD =
+ const DWORDPointerType theFirstDWORD =
#if defined(XALAN_OLD_STYLE_CASTS)
- (const unsigned int*)&theNumber;
+ (DWORDPointerType)&theNumber;
#else
- reinterpret_cast<const unsigned int*>(&theNumber);
+ reinterpret_cast<DWORDPointerType>(&theNumber);
#endif
- const unsigned int* const theSecondDWORD =
+ const UnalignedDWORDPointerType theSecondDWORD =
theFirstDWORD + 1;
return *theFirstDWORD == *s_positiveZeroFirstDWORD &&
@@ -164,14 +164,14 @@
isNegativeZero(double theNumber)
{
// Compare the two DWORDs of the double as unsigned longs.
- const unsigned int* const theFirstDWORD =
+ const DWORDPointerType theFirstDWORD =
#if defined(XALAN_OLD_STYLE_CASTS)
- (const unsigned int*)&theNumber;
+ (DWORDPointerType)&theNumber;
#else
- reinterpret_cast<const unsigned int*>(&theNumber);
+ reinterpret_cast<DWORDPointerType>(&theNumber);
#endif
- const unsigned int* const theSecondDWORD =
+ const UnalignedDWORDPointerType theSecondDWORD =
theFirstDWORD + 1;
return *theFirstDWORD == *s_negativeZeroFirstDWORD &&
@@ -603,22 +603,25 @@
static double
round(double theValue);
+ typedef const unsigned int*
DWORDPointerType;
+ typedef XALAN_UNALIGNED const unsigned int*
UnalignedDWORDPointerType;
+
private:
- static const double s_NaN;
- static const double
s_positiveInfinity;
- static const double
s_negativeInfinity;
- static const double s_positiveZero;
- static const double s_negativeZero;
+ static const double s_NaN;
+ static const double s_positiveInfinity;
+ static const double s_negativeInfinity;
+ static const double s_positiveZero;
+ static const double s_negativeZero;
- static const unsigned int* const s_NaNFirstDWORD;
- static const unsigned int* const s_NaNSecondDWORD;
+ static const DWORDPointerType s_NaNFirstDWORD;
+ static const UnalignedDWORDPointerType s_NaNSecondDWORD;
- static const unsigned int* const s_positiveZeroFirstDWORD;
- static const unsigned int* const s_positiveZeroSecondDWORD;
+ static const DWORDPointerType
s_positiveZeroFirstDWORD;
+ static const UnalignedDWORDPointerType s_positiveZeroSecondDWORD;
- static const unsigned int* const s_negativeZeroFirstDWORD;
- static const unsigned int* const s_negativeZeroSecondDWORD;
+ static const DWORDPointerType
s_negativeZeroFirstDWORD;
+ static const UnalignedDWORDPointerType s_negativeZeroSecondDWORD;
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]