bug #76846: r=cls, build bustage fix for 64-bit platforms

This commit is contained in:
scc%mozilla.org 2001-07-04 06:06:22 +00:00
parent 5709f7405c
commit 1ab59fad3a
4 changed files with 68 additions and 12 deletions

View File

@ -65,20 +65,20 @@ class NS_COM nsDependentConcatenation
int
GetCurrentStringFromFragment( const nsReadableFragment<char_type>& aFragment ) const
{
return (NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) & mFragmentIdentifierMask) ? kRightString : kLeftString;
return (aFragment.GetIDAsInt() & mFragmentIdentifierMask) ? kRightString : kLeftString;
}
int
SetLeftStringInFragment( nsReadableFragment<char_type>& aFragment ) const
{
aFragment.mFragmentIdentifier = NS_REINTERPRET_CAST(void*, NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) & ~mFragmentIdentifierMask);
aFragment.SetID(aFragment.GetIDAsInt() & ~mFragmentIdentifierMask);
return kLeftString;
}
int
SetRightStringInFragment( nsReadableFragment<char_type>& aFragment ) const
{
aFragment.mFragmentIdentifier = NS_REINTERPRET_CAST(void*, NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) | mFragmentIdentifierMask);
aFragment.SetID(aFragment.GetIDAsInt() | mFragmentIdentifierMask);
return kRightString;
}
@ -142,20 +142,20 @@ class NS_COM nsDependentCConcatenation
int
GetCurrentStringFromFragment( const nsReadableFragment<char_type>& aFragment ) const
{
return (NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) & mFragmentIdentifierMask) ? kRightString : kLeftString;
return (aFragment.GetIDAsInt() & mFragmentIdentifierMask) ? kRightString : kLeftString;
}
int
SetLeftStringInFragment( nsReadableFragment<char_type>& aFragment ) const
{
aFragment.mFragmentIdentifier = NS_REINTERPRET_CAST(void*, NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) & ~mFragmentIdentifierMask);
aFragment.SetID(aFragment.GetIDAsInt() & ~mFragmentIdentifierMask);
return kLeftString;
}
int
SetRightStringInFragment( nsReadableFragment<char_type>& aFragment ) const
{
aFragment.mFragmentIdentifier = NS_REINTERPRET_CAST(void*, NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) | mFragmentIdentifierMask);
aFragment.SetID(aFragment.GetIDAsInt() | mFragmentIdentifierMask);
return kRightString;
}

View File

@ -65,6 +65,34 @@ struct nsReadableFragment
{
// nothing else to do here
}
void*
GetID() const
{
return mFragmentIdentifier;
}
unsigned long
GetIDAsInt() const
{
typedef char* char_ptr;
typedef unsigned long ulong;
return ulong(char_ptr(mFragmentIdentifier)-char_ptr(0));
}
void
SetID( void* id )
{
mFragmentidentifier = id;
}
void
SetID( unsigned long id )
{
typedef char* char_ptr;
typedef void* void_ptr;
mFragmentIdentifier = void_ptr(char_ptr(0)+id);
}
};

View File

@ -65,20 +65,20 @@ class NS_COM nsDependentConcatenation
int
GetCurrentStringFromFragment( const nsReadableFragment<char_type>& aFragment ) const
{
return (NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) & mFragmentIdentifierMask) ? kRightString : kLeftString;
return (aFragment.GetIDAsInt() & mFragmentIdentifierMask) ? kRightString : kLeftString;
}
int
SetLeftStringInFragment( nsReadableFragment<char_type>& aFragment ) const
{
aFragment.mFragmentIdentifier = NS_REINTERPRET_CAST(void*, NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) & ~mFragmentIdentifierMask);
aFragment.SetID(aFragment.GetIDAsInt() & ~mFragmentIdentifierMask);
return kLeftString;
}
int
SetRightStringInFragment( nsReadableFragment<char_type>& aFragment ) const
{
aFragment.mFragmentIdentifier = NS_REINTERPRET_CAST(void*, NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) | mFragmentIdentifierMask);
aFragment.SetID(aFragment.GetIDAsInt() | mFragmentIdentifierMask);
return kRightString;
}
@ -142,20 +142,20 @@ class NS_COM nsDependentCConcatenation
int
GetCurrentStringFromFragment( const nsReadableFragment<char_type>& aFragment ) const
{
return (NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) & mFragmentIdentifierMask) ? kRightString : kLeftString;
return (aFragment.GetIDAsInt() & mFragmentIdentifierMask) ? kRightString : kLeftString;
}
int
SetLeftStringInFragment( nsReadableFragment<char_type>& aFragment ) const
{
aFragment.mFragmentIdentifier = NS_REINTERPRET_CAST(void*, NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) & ~mFragmentIdentifierMask);
aFragment.SetID(aFragment.GetIDAsInt() & ~mFragmentIdentifierMask);
return kLeftString;
}
int
SetRightStringInFragment( nsReadableFragment<char_type>& aFragment ) const
{
aFragment.mFragmentIdentifier = NS_REINTERPRET_CAST(void*, NS_REINTERPRET_CAST(PRUint32, aFragment.mFragmentIdentifier) | mFragmentIdentifierMask);
aFragment.SetID(aFragment.GetIDAsInt() | mFragmentIdentifierMask);
return kRightString;
}

View File

@ -65,6 +65,34 @@ struct nsReadableFragment
{
// nothing else to do here
}
void*
GetID() const
{
return mFragmentIdentifier;
}
unsigned long
GetIDAsInt() const
{
typedef char* char_ptr;
typedef unsigned long ulong;
return ulong(char_ptr(mFragmentIdentifier)-char_ptr(0));
}
void
SetID( void* id )
{
mFragmentidentifier = id;
}
void
SetID( unsigned long id )
{
typedef char* char_ptr;
typedef void* void_ptr;
mFragmentIdentifier = void_ptr(char_ptr(0)+id);
}
};