mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1091594 - Added explicit integer casts to char16ptr_t. r=jmathies
--HG-- extra : rebase_source : b351ddfcd263c8dfee436f00ab8a917d8bfc36e2
This commit is contained in:
parent
12d083ae32
commit
9117e49fc5
@ -105,6 +105,30 @@ public:
|
||||
{
|
||||
return const_cast<wchar_t*>(static_cast<const wchar_t*>(*this));
|
||||
}
|
||||
explicit operator int() const
|
||||
{
|
||||
return reinterpret_cast<intptr_t>(mPtr);
|
||||
}
|
||||
explicit operator unsigned int() const
|
||||
{
|
||||
return reinterpret_cast<uintptr_t>(mPtr);
|
||||
}
|
||||
explicit operator long() const
|
||||
{
|
||||
return reinterpret_cast<intptr_t>(mPtr);
|
||||
}
|
||||
explicit operator unsigned long() const
|
||||
{
|
||||
return reinterpret_cast<uintptr_t>(mPtr);
|
||||
}
|
||||
explicit operator long long() const
|
||||
{
|
||||
return reinterpret_cast<intptr_t>(mPtr);
|
||||
}
|
||||
explicit operator unsigned long long() const
|
||||
{
|
||||
return reinterpret_cast<uintptr_t>(mPtr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Some Windows API calls accept BYTE* but require that data actually be
|
||||
@ -150,7 +174,27 @@ public:
|
||||
{
|
||||
return mPtr != nullptr;
|
||||
}
|
||||
char16ptr_t operator+(size_t aValue) const
|
||||
char16ptr_t operator+(int aValue) const
|
||||
{
|
||||
return char16ptr_t(mPtr + aValue);
|
||||
}
|
||||
char16ptr_t operator+(unsigned int aValue) const
|
||||
{
|
||||
return char16ptr_t(mPtr + aValue);
|
||||
}
|
||||
char16ptr_t operator+(long aValue) const
|
||||
{
|
||||
return char16ptr_t(mPtr + aValue);
|
||||
}
|
||||
char16ptr_t operator+(unsigned long aValue) const
|
||||
{
|
||||
return char16ptr_t(mPtr + aValue);
|
||||
}
|
||||
char16ptr_t operator+(long long aValue) const
|
||||
{
|
||||
return char16ptr_t(mPtr + aValue);
|
||||
}
|
||||
char16ptr_t operator+(unsigned long long aValue) const
|
||||
{
|
||||
return char16ptr_t(mPtr + aValue);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user