mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 791906: Replace NSPR integer limit constants with stdint ones; r=ehsan
This commit is contained in:
parent
e1be457e78
commit
0cc4b12d36
@ -955,7 +955,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
// Create accessible for visible text frames.
|
||||
if (content->IsNodeOfType(nsINode::eTEXT)) {
|
||||
nsAutoString text;
|
||||
weakFrame->GetRenderedText(&text, nullptr, nullptr, 0, PR_UINT32_MAX);
|
||||
weakFrame->GetRenderedText(&text, nullptr, nullptr, 0, UINT32_MAX);
|
||||
if (text.IsEmpty()) {
|
||||
if (aIsSubtreeHidden)
|
||||
*aIsSubtreeHidden = true;
|
||||
|
@ -452,7 +452,7 @@ public:
|
||||
* then text form start offset till the end is appended
|
||||
*/
|
||||
virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
|
||||
uint32_t aLength = PR_UINT32_MAX);
|
||||
uint32_t aLength = UINT32_MAX);
|
||||
|
||||
/**
|
||||
* Assert if child not in parent's cache if the cache was initialized at this
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
// Accessible
|
||||
virtual mozilla::a11y::role NativeRole();
|
||||
virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
|
||||
uint32_t aLength = PR_UINT32_MAX);
|
||||
uint32_t aLength = UINT32_MAX);
|
||||
virtual ENameValueFlag Name(nsString& aName);
|
||||
|
||||
// TextLeafAccessible
|
||||
|
@ -86,7 +86,7 @@ public:
|
||||
virtual a11y::role NativeRole();
|
||||
virtual uint64_t NativeState();
|
||||
virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
|
||||
uint32_t aLength = PR_UINT32_MAX);
|
||||
uint32_t aLength = UINT32_MAX);
|
||||
|
||||
// HTMLListBulletAccessible
|
||||
|
||||
|
@ -271,7 +271,7 @@ interface nsIScriptSecurityManager : nsIXPCSecurityManager
|
||||
|
||||
|
||||
const unsigned long NO_APP_ID = 0;
|
||||
const unsigned long UNKNOWN_APP_ID = 4294967295; // PR_UINT32_MAX
|
||||
const unsigned long UNKNOWN_APP_ID = 4294967295; // UINT32_MAX
|
||||
|
||||
/**
|
||||
* Returns the extended origin for the uri.
|
||||
|
@ -1264,7 +1264,7 @@ WebSocket::Send(nsIDOMBlob* aData,
|
||||
return;
|
||||
}
|
||||
|
||||
if (msgLength > PR_UINT32_MAX) {
|
||||
if (msgLength > UINT32_MAX) {
|
||||
aRv.Throw(NS_ERROR_FILE_TOO_BIG);
|
||||
return;
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ public:
|
||||
* @return whether the value could be parsed
|
||||
*/
|
||||
bool ParseIntValue(const nsAString& aString) {
|
||||
return ParseIntWithBounds(aString, PR_INT32_MIN, PR_INT32_MAX);
|
||||
return ParseIntWithBounds(aString, INT32_MIN, INT32_MAX);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -291,7 +291,7 @@ public:
|
||||
* @return whether the value could be parsed
|
||||
*/
|
||||
bool ParseIntWithBounds(const nsAString& aString, int32_t aMin,
|
||||
int32_t aMax = PR_INT32_MAX);
|
||||
int32_t aMax = INT32_MAX);
|
||||
|
||||
/**
|
||||
* Parse a string value into a non-negative integer.
|
||||
|
@ -577,7 +577,7 @@ nsContentList::Item(uint32_t aIndex, bool aDoFlush)
|
||||
}
|
||||
|
||||
if (mState != LIST_UP_TO_DATE)
|
||||
PopulateSelf(NS_MIN(aIndex, PR_UINT32_MAX - 1) + 1);
|
||||
PopulateSelf(NS_MIN(aIndex, UINT32_MAX - 1) + 1);
|
||||
|
||||
ASSERT_IN_SYNC;
|
||||
NS_ASSERTION(!mRootNode || mState != LIST_DIRTY,
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
// Magic namespace id that means "match all namespaces". This is
|
||||
// negative so it won't collide with actual namespace constants.
|
||||
#define kNameSpaceID_Wildcard PR_INT32_MIN
|
||||
#define kNameSpaceID_Wildcard INT32_MIN
|
||||
|
||||
// This is a callback function type that can be used to implement an
|
||||
// arbitrary matching algorithm. aContent is the content that may
|
||||
|
@ -653,7 +653,7 @@ nsDOMMemoryFile::CreateSlice(uint64_t aStart, uint64_t aLength,
|
||||
NS_IMETHODIMP
|
||||
nsDOMMemoryFile::GetInternalStream(nsIInputStream **aStream)
|
||||
{
|
||||
if (mLength > PR_INT32_MAX)
|
||||
if (mLength > INT32_MAX)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return DataOwnerAdapter::Create(mDataOwner, mStart, mLength, aStream);
|
||||
|
@ -294,7 +294,7 @@ nsDOMFileReader::DoOnDataAvailable(nsIRequest *aRequest,
|
||||
NS_ASSERTION(mResult.Length() == aOffset,
|
||||
"unexpected mResult length");
|
||||
uint32_t oldLen = mResult.Length();
|
||||
if (uint64_t(oldLen) + aCount > PR_UINT32_MAX)
|
||||
if (uint64_t(oldLen) + aCount > UINT32_MAX)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
PRUnichar *buf = nullptr;
|
||||
@ -314,7 +314,7 @@ nsDOMFileReader::DoOnDataAvailable(nsIRequest *aRequest,
|
||||
}
|
||||
else {
|
||||
//Update memory buffer to reflect the contents of the file
|
||||
if (aOffset + aCount > PR_UINT32_MAX) {
|
||||
if (aOffset + aCount > UINT32_MAX) {
|
||||
// PR_Realloc doesn't support over 4GB memory size even if 64-bit OS
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -8238,7 +8238,7 @@ nsresult
|
||||
nsIDocument::ScheduleFrameRequestCallback(nsIFrameRequestCallback* aCallback,
|
||||
int32_t *aHandle)
|
||||
{
|
||||
if (mFrameRequestCallbackCounter == PR_INT32_MAX) {
|
||||
if (mFrameRequestCallbackCounter == INT32_MAX) {
|
||||
// Can't increment without overflowing; bail out
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
@ -901,11 +901,11 @@ nsFrameScriptExecutor::TryCacheLoadAndCompileScript(const nsAString& aURL,
|
||||
nsString dataString;
|
||||
uint64_t avail64 = 0;
|
||||
if (input && NS_SUCCEEDED(input->Available(&avail64)) && avail64) {
|
||||
if (avail64 > PR_UINT32_MAX) {
|
||||
if (avail64 > UINT32_MAX) {
|
||||
return;
|
||||
}
|
||||
nsCString buffer;
|
||||
uint32_t avail = (uint32_t)NS_MIN(avail64, (uint64_t)PR_UINT32_MAX);
|
||||
uint32_t avail = (uint32_t)NS_MIN(avail64, (uint64_t)UINT32_MAX);
|
||||
if (NS_FAILED(NS_ReadInputStreamToString(input, buffer, avail))) {
|
||||
return;
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ nsNodeInfo::nsNodeInfo(nsIAtom *aName, nsIAtom *aPrefix, int32_t aNamespaceID,
|
||||
SetDOMStringToNull(mLocalName);
|
||||
break;
|
||||
default:
|
||||
NS_ABORT_IF_FALSE(aNodeType == PR_UINT16_MAX,
|
||||
NS_ABORT_IF_FALSE(aNodeType == UINT16_MAX,
|
||||
"Unknown node type");
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ CheckValidNodeInfo(uint16_t aNodeType, nsIAtom *aName, int32_t aNamespaceID,
|
||||
aNodeType == nsIDOMNode::DOCUMENT_NODE ||
|
||||
aNodeType == nsIDOMNode::DOCUMENT_TYPE_NODE ||
|
||||
aNodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE ||
|
||||
aNodeType == PR_UINT16_MAX,
|
||||
aNodeType == UINT16_MAX,
|
||||
"Invalid nodeType");
|
||||
NS_ABORT_IF_FALSE((aNodeType == nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
|
||||
aNodeType == nsIDOMNode::DOCUMENT_TYPE_NODE) ==
|
||||
@ -89,7 +89,7 @@ CheckValidNodeInfo(uint16_t aNodeType, nsIAtom *aName, int32_t aNamespaceID,
|
||||
"Supply aExtraName for and only for PIs and doctypes");
|
||||
NS_ABORT_IF_FALSE(aNodeType == nsIDOMNode::ELEMENT_NODE ||
|
||||
aNodeType == nsIDOMNode::ATTRIBUTE_NODE ||
|
||||
aNodeType == PR_UINT16_MAX ||
|
||||
aNodeType == UINT16_MAX ||
|
||||
aNamespaceID == kNameSpaceID_None,
|
||||
"Only attributes and elements can be in a namespace");
|
||||
NS_ABORT_IF_FALSE(aName && aName != nsGkAtoms::_empty, "Invalid localName");
|
||||
|
@ -342,7 +342,7 @@ nsSyncLoadService::PushSyncStreamToListener(nsIInputStream* aIn,
|
||||
if (NS_FAILED(rv)) {
|
||||
chunkSize = 4096;
|
||||
}
|
||||
chunkSize = NS_MIN(int32_t(PR_UINT16_MAX), chunkSize);
|
||||
chunkSize = NS_MIN(int32_t(UINT16_MAX), chunkSize);
|
||||
|
||||
rv = NS_NewBufferedInputStream(getter_AddRefs(bufferedStream), aIn,
|
||||
chunkSize);
|
||||
@ -366,11 +366,11 @@ nsSyncLoadService::PushSyncStreamToListener(nsIInputStream* aIn,
|
||||
break;
|
||||
}
|
||||
|
||||
if (readCount > PR_UINT32_MAX)
|
||||
readCount = PR_UINT32_MAX;
|
||||
if (readCount > UINT32_MAX)
|
||||
readCount = UINT32_MAX;
|
||||
|
||||
rv = aListener->OnDataAvailable(aChannel, nullptr, aIn,
|
||||
(uint32_t)NS_MIN(sourceOffset, (uint64_t)PR_UINT32_MAX),
|
||||
(uint32_t)NS_MIN(sourceOffset, (uint64_t)UINT32_MAX),
|
||||
(uint32_t)readCount);
|
||||
if (NS_FAILED(rv)) {
|
||||
break;
|
||||
|
@ -2443,7 +2443,7 @@ GetRequestBody(nsIDOMDocument* aDoc, nsIInputStream** aResult,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIStorageStream> storStream;
|
||||
rv = NS_NewStorageStream(4096, PR_UINT32_MAX, getter_AddRefs(storStream));
|
||||
rv = NS_NewStorageStream(4096, UINT32_MAX, getter_AddRefs(storStream));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIOutputStream> output;
|
||||
|
@ -181,7 +181,7 @@ static uint32_t CountNewlinesInXPLength(nsIContent* aContent,
|
||||
return 0;
|
||||
// For automated tests, we should abort on debug build.
|
||||
NS_ABORT_IF_FALSE(
|
||||
(aXPLength == PR_UINT32_MAX || aXPLength <= text->GetLength()),
|
||||
(aXPLength == UINT32_MAX || aXPLength <= text->GetLength()),
|
||||
"aXPLength is out-of-bounds");
|
||||
const uint32_t length = NS_MIN(aXPLength, text->GetLength());
|
||||
uint32_t newlines = 0;
|
||||
@ -204,7 +204,7 @@ static uint32_t CountNewlinesInNativeLength(nsIContent* aContent,
|
||||
}
|
||||
// For automated tests, we should abort on debug build.
|
||||
NS_ABORT_IF_FALSE(
|
||||
(aNativeLength == PR_UINT32_MAX || aNativeLength <= text->GetLength() * 2),
|
||||
(aNativeLength == UINT32_MAX || aNativeLength <= text->GetLength() * 2),
|
||||
"aNativeLength is unexpected value");
|
||||
const uint32_t xpLength = text->GetLength();
|
||||
uint32_t newlines = 0;
|
||||
@ -222,7 +222,7 @@ static uint32_t CountNewlinesInNativeLength(nsIContent* aContent,
|
||||
}
|
||||
#endif
|
||||
|
||||
static uint32_t GetNativeTextLength(nsIContent* aContent, uint32_t aMaxLength = PR_UINT32_MAX)
|
||||
static uint32_t GetNativeTextLength(nsIContent* aContent, uint32_t aMaxLength = UINT32_MAX)
|
||||
{
|
||||
if (aContent->IsNodeOfType(nsINode::eTEXT)) {
|
||||
uint32_t textLengthDifference =
|
||||
|
@ -5252,7 +5252,7 @@ nsEventStateManager::DeltaAccumulator::Reset()
|
||||
{
|
||||
mX = mY = 0.0;
|
||||
mPendingScrollAmountX = mPendingScrollAmountY = 0.0;
|
||||
mHandlingDeltaMode = PR_UINT32_MAX;
|
||||
mHandlingDeltaMode = UINT32_MAX;
|
||||
mHandlingPixelOnlyDevice = false;
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ protected:
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
bool IsInTransaction() { return mHandlingDeltaMode != PR_UINT32_MAX; }
|
||||
bool IsInTransaction() { return mHandlingDeltaMode != UINT32_MAX; }
|
||||
|
||||
/**
|
||||
* InitLineOrPageDelta() stores pixel delta values of WheelEvents which are
|
||||
@ -585,7 +585,7 @@ protected:
|
||||
private:
|
||||
DeltaAccumulator() :
|
||||
mX(0.0), mY(0.0), mPendingScrollAmountX(0.0), mPendingScrollAmountY(0.0),
|
||||
mHandlingDeltaMode(PR_UINT32_MAX), mHandlingPixelOnlyDevice(false)
|
||||
mHandlingDeltaMode(UINT32_MAX), mHandlingPixelOnlyDevice(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -545,7 +545,7 @@ nsHTMLCanvasElement::ToDataURLImpl(const nsAString& aMimeType,
|
||||
uint64_t count;
|
||||
rv = stream->Available(&count);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_TRUE(count <= PR_UINT32_MAX, NS_ERROR_FILE_TOO_BIG);
|
||||
NS_ENSURE_TRUE(count <= UINT32_MAX, NS_ERROR_FILE_TOO_BIG);
|
||||
|
||||
return Base64EncodeInputStream(stream, aDataURL, (uint32_t)count, aDataURL.Length());
|
||||
}
|
||||
@ -585,7 +585,7 @@ nsHTMLCanvasElement::MozGetAsFileImpl(const nsAString& aName,
|
||||
uint64_t imgSize;
|
||||
rv = stream->Available(&imgSize);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_TRUE(imgSize <= PR_UINT32_MAX, NS_ERROR_FILE_TOO_BIG);
|
||||
NS_ENSURE_TRUE(imgSize <= UINT32_MAX, NS_ERROR_FILE_TOO_BIG);
|
||||
|
||||
void* imgData = nullptr;
|
||||
rv = NS_ReadInputStreamToBuffer(stream, &imgData, (uint32_t)imgSize);
|
||||
|
@ -161,7 +161,7 @@ AudioSegment::WriteTo(nsAudioStream* aOutput)
|
||||
uint32_t frameSize = GetSampleSize(aOutput->GetFormat())*mChannels;
|
||||
for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) {
|
||||
AudioChunk& c = *ci;
|
||||
if (frameSize*c.mDuration > PR_UINT32_MAX) {
|
||||
if (frameSize*c.mDuration > UINT32_MAX) {
|
||||
NS_ERROR("Buffer overflow");
|
||||
return;
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ nsresult FileBlockCache::Read(int64_t aOffset,
|
||||
{
|
||||
MonitorAutoLock mon(mDataMonitor);
|
||||
|
||||
if (!mFD || (aOffset / BLOCK_SIZE) > PR_INT32_MAX)
|
||||
if (!mFD || (aOffset / BLOCK_SIZE) > INT32_MAX)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
int32_t bytesToRead = aLength;
|
||||
|
@ -1069,7 +1069,7 @@ void FileMediaResource::EnsureSizeInitialized()
|
||||
// Get the file size and inform the decoder.
|
||||
uint64_t size;
|
||||
nsresult res = mInput->Available(&size);
|
||||
if (NS_SUCCEEDED(res) && size <= PR_INT64_MAX) {
|
||||
if (NS_SUCCEEDED(res) && size <= INT64_MAX) {
|
||||
mSize = (int64_t)size;
|
||||
nsCOMPtr<nsIRunnable> event = new LoadedEvent(mDecoder);
|
||||
NS_DispatchToMainThread(event, NS_DISPATCH_NORMAL);
|
||||
|
@ -16,7 +16,7 @@ namespace mozilla {
|
||||
*/
|
||||
typedef int64_t MediaTime;
|
||||
const int64_t MEDIA_TIME_FRAC_BITS = 20;
|
||||
const int64_t MEDIA_TIME_MAX = PR_INT64_MAX;
|
||||
const int64_t MEDIA_TIME_MAX = INT64_MAX;
|
||||
|
||||
inline MediaTime MillisecondsToMediaTime(int32_t aMS)
|
||||
{
|
||||
@ -41,7 +41,7 @@ inline double MediaTimeToSeconds(MediaTime aTime)
|
||||
* 2^MEDIA_TIME_FRAC_BITS doesn't overflow, so we set its max accordingly.
|
||||
*/
|
||||
typedef int64_t TrackTicks;
|
||||
const int64_t TRACK_TICKS_MAX = PR_INT64_MAX >> MEDIA_TIME_FRAC_BITS;
|
||||
const int64_t TRACK_TICKS_MAX = INT64_MAX >> MEDIA_TIME_FRAC_BITS;
|
||||
|
||||
/**
|
||||
* A MediaSegment is a chunk of media data sequential in time. Different
|
||||
|
@ -81,13 +81,13 @@ public:
|
||||
/**
|
||||
* Returns the final value of the function. If aTime is non-null,
|
||||
* sets aTime to the time at which the function changes to that final value.
|
||||
* If there are no changes after the current time, returns PR_INT64_MIN in aTime.
|
||||
* If there are no changes after the current time, returns INT64_MIN in aTime.
|
||||
*/
|
||||
const T& GetLast(Time* aTime = nullptr) const
|
||||
{
|
||||
if (mChanges.IsEmpty()) {
|
||||
if (aTime) {
|
||||
*aTime = PR_INT64_MIN;
|
||||
*aTime = INT64_MIN;
|
||||
}
|
||||
return mCurrent;
|
||||
}
|
||||
@ -119,10 +119,10 @@ public:
|
||||
/**
|
||||
* Returns the value of the function at time aTime.
|
||||
* If aEnd is non-null, sets *aEnd to the time at which the function will
|
||||
* change from the returned value to a new value, or PR_INT64_MAX if that
|
||||
* change from the returned value to a new value, or INT64_MAX if that
|
||||
* never happens.
|
||||
* If aStart is non-null, sets *aStart to the time at which the function
|
||||
* changed to the returned value, or PR_INT64_MIN if that happened at or
|
||||
* changed to the returned value, or INT64_MIN if that happened at or
|
||||
* before the current time.
|
||||
*
|
||||
* Currently uses a linear search, but could use a binary search.
|
||||
@ -131,17 +131,17 @@ public:
|
||||
{
|
||||
if (mChanges.IsEmpty() || aTime < mChanges[0].mTime) {
|
||||
if (aStart) {
|
||||
*aStart = PR_INT64_MIN;
|
||||
*aStart = INT64_MIN;
|
||||
}
|
||||
if (aEnd) {
|
||||
*aEnd = mChanges.IsEmpty() ? PR_INT64_MAX : mChanges[0].mTime;
|
||||
*aEnd = mChanges.IsEmpty() ? INT64_MAX : mChanges[0].mTime;
|
||||
}
|
||||
return mCurrent;
|
||||
}
|
||||
int32_t changesLength = mChanges.Length();
|
||||
if (mChanges[changesLength - 1].mTime <= aTime) {
|
||||
if (aEnd) {
|
||||
*aEnd = PR_INT64_MAX;
|
||||
*aEnd = INT64_MAX;
|
||||
}
|
||||
if (aStart) {
|
||||
*aStart = mChanges[changesLength - 1].mTime;
|
||||
|
@ -25,7 +25,7 @@ CheckedInt64 UsecsToFrames(int64_t aUsecs, uint32_t aRate) {
|
||||
static int32_t ConditionDimension(float aValue)
|
||||
{
|
||||
// This will exclude NaNs and too-big values.
|
||||
if (aValue > 1.0 && aValue <= PR_INT32_MAX)
|
||||
if (aValue > 1.0 && aValue <= INT32_MAX)
|
||||
return int32_t(NS_round(aValue));
|
||||
return 0;
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ int32_t nsNativeAudioStream::GetMinWriteSize()
|
||||
&size);
|
||||
if (r == SA_ERROR_NOT_SUPPORTED)
|
||||
return 1;
|
||||
else if (r != SA_SUCCESS || size > PR_INT32_MAX)
|
||||
else if (r != SA_SUCCESS || size > INT32_MAX)
|
||||
return -1;
|
||||
|
||||
return static_cast<int32_t>(size / mChannels / sizeof(short));
|
||||
@ -1152,7 +1152,7 @@ nsBufferedAudioStream::GetPositionInFramesUnlocked()
|
||||
if (position >= mLostFrames) {
|
||||
adjustedPosition = position - mLostFrames;
|
||||
}
|
||||
return NS_MIN<uint64_t>(adjustedPosition, PR_INT64_MAX);
|
||||
return NS_MIN<uint64_t>(adjustedPosition, INT64_MAX);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -22,7 +22,7 @@ using mozilla::layers::PlanarYCbCrImage;
|
||||
// can do less integer overflow checking.
|
||||
PR_STATIC_ASSERT(MAX_VIDEO_WIDTH < PlanarYCbCrImage::MAX_DIMENSION);
|
||||
PR_STATIC_ASSERT(MAX_VIDEO_HEIGHT < PlanarYCbCrImage::MAX_DIMENSION);
|
||||
PR_STATIC_ASSERT(PlanarYCbCrImage::MAX_DIMENSION < PR_UINT32_MAX / PlanarYCbCrImage::MAX_DIMENSION);
|
||||
PR_STATIC_ASSERT(PlanarYCbCrImage::MAX_DIMENSION < UINT32_MAX / PlanarYCbCrImage::MAX_DIMENSION);
|
||||
|
||||
// Un-comment to enable logging of seek bisections.
|
||||
//#define SEEK_LOGGING
|
||||
|
@ -588,7 +588,7 @@ void nsBuiltinDecoderStateMachine::SendStreamData()
|
||||
if (mState == DECODER_STATE_DECODING_METADATA)
|
||||
return;
|
||||
|
||||
int64_t minLastAudioPacketTime = PR_INT64_MAX;
|
||||
int64_t minLastAudioPacketTime = INT64_MAX;
|
||||
SourceMediaStream* mediaStream = stream->mStream;
|
||||
StreamTime endPosition = 0;
|
||||
|
||||
@ -1106,7 +1106,7 @@ void nsBuiltinDecoderStateMachine::AudioLoop()
|
||||
// and so that audio will not start playing. Write silence to ensure
|
||||
// the last block gets pushed to hardware, so that playback starts.
|
||||
int64_t framesToWrite = minWriteFrames - unplayedFrames;
|
||||
if (framesToWrite < PR_UINT32_MAX / channels) {
|
||||
if (framesToWrite < UINT32_MAX / channels) {
|
||||
// Write silence manually rather than using PlaySilence(), so that
|
||||
// the AudioAPI doesn't get a copy of the audio frames.
|
||||
ReentrantMonitorAutoExit exit(mDecoder->GetReentrantMonitor());
|
||||
@ -2345,7 +2345,7 @@ void nsBuiltinDecoderStateMachine::Wait(int64_t aUsecs) {
|
||||
IsPlaying())
|
||||
{
|
||||
int64_t ms = static_cast<int64_t>(NS_round((end - now).ToSeconds() * 1000));
|
||||
if (ms == 0 || ms > PR_UINT32_MAX) {
|
||||
if (ms == 0 || ms > UINT32_MAX) {
|
||||
break;
|
||||
}
|
||||
mDecoder->GetReentrantMonitor().Wait(PR_MillisecondsToInterval(static_cast<uint32_t>(ms)));
|
||||
|
@ -685,7 +685,7 @@ static int32_t GetMaxBlocks()
|
||||
int32_t cacheSize = Preferences::GetInt("media.cache_size", 500*1024);
|
||||
int64_t maxBlocks = static_cast<int64_t>(cacheSize)*1024/nsMediaCache::BLOCK_SIZE;
|
||||
maxBlocks = NS_MAX<int64_t>(maxBlocks, 1);
|
||||
return int32_t(NS_MIN<int64_t>(maxBlocks, PR_INT32_MAX));
|
||||
return int32_t(NS_MIN<int64_t>(maxBlocks, INT32_MAX));
|
||||
}
|
||||
|
||||
int32_t
|
||||
@ -695,7 +695,7 @@ nsMediaCache::FindBlockForIncomingData(TimeStamp aNow,
|
||||
mReentrantMonitor.AssertCurrentThreadIn();
|
||||
|
||||
int32_t blockIndex = FindReusableBlock(aNow, aStream,
|
||||
aStream->mChannelOffset/BLOCK_SIZE, PR_INT32_MAX);
|
||||
aStream->mChannelOffset/BLOCK_SIZE, INT32_MAX);
|
||||
|
||||
if (blockIndex < 0 || !IsBlockFree(blockIndex)) {
|
||||
// The block returned is already allocated.
|
||||
@ -989,7 +989,7 @@ nsMediaCache::PredictNextUse(TimeStamp aNow, int32_t aBlock)
|
||||
int64_t millisecondsAhead =
|
||||
bytesAhead*1000/bo->mStream->mPlaybackBytesPerSecond;
|
||||
prediction = TimeDuration::FromMilliseconds(
|
||||
NS_MIN<int64_t>(millisecondsAhead, PR_INT32_MAX));
|
||||
NS_MIN<int64_t>(millisecondsAhead, INT32_MAX));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -1017,7 +1017,7 @@ nsMediaCache::PredictNextUseForIncomingData(nsMediaCacheStream* aStream)
|
||||
return TimeDuration(0);
|
||||
int64_t millisecondsAhead = bytesAhead*1000/aStream->mPlaybackBytesPerSecond;
|
||||
return TimeDuration::FromMilliseconds(
|
||||
NS_MIN<int64_t>(millisecondsAhead, PR_INT32_MAX));
|
||||
NS_MIN<int64_t>(millisecondsAhead, INT32_MAX));
|
||||
}
|
||||
|
||||
enum StreamAction { NONE, SEEK, SEEK_AND_RESUME, RESUME, SUSPEND };
|
||||
@ -2098,7 +2098,7 @@ nsMediaCacheStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes)
|
||||
}
|
||||
size = NS_MIN(size, bytesRemaining);
|
||||
// Clamp size until 64-bit file size issues (bug 500784) are fixed.
|
||||
size = NS_MIN(size, int64_t(PR_INT32_MAX));
|
||||
size = NS_MIN(size, int64_t(INT32_MAX));
|
||||
}
|
||||
|
||||
int32_t bytes;
|
||||
@ -2153,7 +2153,7 @@ nsMediaCacheStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes)
|
||||
gMediaCache->NoteBlockUsage(this, cacheBlock, mCurrentMode, TimeStamp::Now());
|
||||
|
||||
int64_t offset = cacheBlock*BLOCK_SIZE + offsetInStreamBlock;
|
||||
NS_ABORT_IF_FALSE(size >= 0 && size <= PR_INT32_MAX, "Size out of range.");
|
||||
NS_ABORT_IF_FALSE(size >= 0 && size <= INT32_MAX, "Size out of range.");
|
||||
nsresult rv = gMediaCache->ReadCacheFile(offset, aBuffer + count, int32_t(size), &bytes);
|
||||
if (NS_FAILED(rv)) {
|
||||
if (count == 0)
|
||||
@ -2202,7 +2202,7 @@ nsMediaCacheStream::ReadFromCache(char* aBuffer,
|
||||
}
|
||||
size = NS_MIN(size, bytesRemaining);
|
||||
// Clamp size until 64-bit file size issues (bug 500784) are fixed.
|
||||
size = NS_MIN(size, int64_t(PR_INT32_MAX));
|
||||
size = NS_MIN(size, int64_t(INT32_MAX));
|
||||
}
|
||||
|
||||
int32_t bytes;
|
||||
@ -2221,7 +2221,7 @@ nsMediaCacheStream::ReadFromCache(char* aBuffer,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
int64_t offset = cacheBlock*BLOCK_SIZE + offsetInStreamBlock;
|
||||
NS_ABORT_IF_FALSE(size >= 0 && size <= PR_INT32_MAX, "Size out of range.");
|
||||
NS_ABORT_IF_FALSE(size >= 0 && size <= INT32_MAX, "Size out of range.");
|
||||
nsresult rv = gMediaCache->ReadCacheFile(offset, aBuffer + count, int32_t(size), &bytes);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
|
@ -933,7 +933,7 @@ bool nsOpusState::DecodeHeader(ogg_packet* aPacket)
|
||||
mGain = static_cast<float>(pow(10,0.05*gain_dB));
|
||||
#else
|
||||
mGain_Q16 = static_cast<int32_t>(NS_MIN(65536*pow(10,0.05*gain_dB)+0.5,
|
||||
static_cast<double>(PR_INT32_MAX)));
|
||||
static_cast<double>(INT32_MAX)));
|
||||
#endif
|
||||
mChannelMapping = aPacket->packet[18];
|
||||
|
||||
@ -1141,7 +1141,7 @@ bool nsOpusState::ReconstructOpusGranulepos(void)
|
||||
ogg_packet* packet = mUnstamped[i];
|
||||
int offset = GetOpusDeltaGP(packet);
|
||||
// Check for error (negative offset) and overflow.
|
||||
if (offset >= 0 && gp <= PR_INT64_MAX - offset) {
|
||||
if (offset >= 0 && gp <= INT64_MAX - offset) {
|
||||
gp += offset;
|
||||
if (gp >= last_gp) {
|
||||
NS_WARNING("Opus end trimming removed more than a full packet.");
|
||||
|
@ -874,7 +874,7 @@ int64_t nsOggReader::RangeEndTime(int64_t aStartOffset,
|
||||
readHead = NS_MAX(aStartOffset, readStartOffset);
|
||||
}
|
||||
|
||||
int64_t limit = NS_MIN(static_cast<int64_t>(PR_UINT32_MAX),
|
||||
int64_t limit = NS_MIN(static_cast<int64_t>(UINT32_MAX),
|
||||
aEndOffset - readHead);
|
||||
limit = NS_MAX(static_cast<int64_t>(0), limit);
|
||||
limit = NS_MIN(limit, static_cast<int64_t>(step));
|
||||
@ -1292,7 +1292,7 @@ PageSync(MediaResource* aResource,
|
||||
// Read from the file into the buffer
|
||||
int64_t bytesToRead = NS_MIN(static_cast<int64_t>(PAGE_STEP),
|
||||
aEndOffset - readHead);
|
||||
NS_ASSERTION(bytesToRead <= PR_UINT32_MAX, "bytesToRead range check");
|
||||
NS_ASSERTION(bytesToRead <= UINT32_MAX, "bytesToRead range check");
|
||||
if (bytesToRead <= 0) {
|
||||
return PAGE_SYNC_END_OF_RANGE;
|
||||
}
|
||||
@ -1366,7 +1366,7 @@ nsresult nsOggReader::SeekBisection(int64_t aTarget,
|
||||
DebugOnly<ogg_int64_t> previousGuess = -1;
|
||||
int backsteps = 0;
|
||||
const int maxBackStep = 10;
|
||||
NS_ASSERTION(static_cast<uint64_t>(PAGE_STEP) * pow(2.0, maxBackStep) < PR_INT32_MAX,
|
||||
NS_ASSERTION(static_cast<uint64_t>(PAGE_STEP) * pow(2.0, maxBackStep) < INT32_MAX,
|
||||
"Backstep calculation must not overflow");
|
||||
|
||||
// Seek via bisection search. Loop until we find the offset where the page
|
||||
|
@ -179,9 +179,9 @@ bool nsWaveReader::DecodeAudioData()
|
||||
if (mSampleFormat == nsAudioStream::FORMAT_U8) {
|
||||
uint8_t v = ReadUint8(&d);
|
||||
#if defined(MOZ_SAMPLE_TYPE_S16)
|
||||
*s++ = (v * (1.F/PR_UINT8_MAX)) * PR_UINT16_MAX + PR_INT16_MIN;
|
||||
*s++ = (v * (1.F/UINT8_MAX)) * UINT16_MAX + INT16_MIN;
|
||||
#elif defined(MOZ_SAMPLE_TYPE_FLOAT32)
|
||||
*s++ = (v * (1.F/PR_UINT8_MAX)) * 2.F - 1.F;
|
||||
*s++ = (v * (1.F/UINT8_MAX)) * 2.F - 1.F;
|
||||
#endif
|
||||
}
|
||||
else if (mSampleFormat == nsAudioStream::FORMAT_S16) {
|
||||
@ -189,7 +189,7 @@ bool nsWaveReader::DecodeAudioData()
|
||||
#if defined(MOZ_SAMPLE_TYPE_S16)
|
||||
*s++ = v;
|
||||
#elif defined(MOZ_SAMPLE_TYPE_FLOAT32)
|
||||
*s++ = (int32_t(v) - PR_INT16_MIN) / float(PR_UINT16_MAX) * 2.F - 1.F;
|
||||
*s++ = (int32_t(v) - INT16_MIN) / float(UINT16_MAX) * 2.F - 1.F;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -199,7 +199,7 @@ bool nsWaveReader::DecodeAudioData()
|
||||
double readSizeTime = BytesToTime(readSize);
|
||||
NS_ASSERTION(posTime <= INT64_MAX / USECS_PER_S, "posTime overflow");
|
||||
NS_ASSERTION(readSizeTime <= INT64_MAX / USECS_PER_S, "readSizeTime overflow");
|
||||
NS_ASSERTION(frames < PR_INT32_MAX, "frames overflow");
|
||||
NS_ASSERTION(frames < INT32_MAX, "frames overflow");
|
||||
|
||||
mAudioQueue.Push(new AudioData(pos,
|
||||
static_cast<int64_t>(posTime * USECS_PER_S),
|
||||
@ -421,7 +421,7 @@ nsWaveReader::LoadFormatChunk()
|
||||
extra += extra % 2;
|
||||
|
||||
if (extra > 0) {
|
||||
PR_STATIC_ASSERT(PR_UINT16_MAX + (PR_UINT16_MAX % 2) < UINT_MAX / sizeof(char));
|
||||
PR_STATIC_ASSERT(UINT16_MAX + (UINT16_MAX % 2) < UINT_MAX / sizeof(char));
|
||||
nsAutoArrayPtr<char> chunkExtension(new char[extra]);
|
||||
if (!ReadAll(chunkExtension.get(), extra)) {
|
||||
return false;
|
||||
@ -473,7 +473,7 @@ nsWaveReader::FindDataOffset()
|
||||
}
|
||||
|
||||
int64_t offset = mDecoder->GetResource()->Tell();
|
||||
if (offset <= 0 || offset > PR_UINT32_MAX) {
|
||||
if (offset <= 0 || offset > UINT32_MAX) {
|
||||
NS_WARNING("PCM data offset out of range");
|
||||
return false;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ nsSMILInstanceTime::UnmarkShouldPreserve()
|
||||
void
|
||||
nsSMILInstanceTime::AddRefFixedEndpoint()
|
||||
{
|
||||
NS_ABORT_IF_FALSE(mFixedEndpointRefCnt < PR_UINT16_MAX,
|
||||
NS_ABORT_IF_FALSE(mFixedEndpointRefCnt < UINT16_MAX,
|
||||
"Fixed endpoint reference count upper limit reached");
|
||||
++mFixedEndpointRefCnt;
|
||||
mFlags &= ~kMayUpdate; // Once fixed, always fixed
|
||||
|
@ -486,7 +486,7 @@ nsSVGFEGaussianBlurElement::SetStdDeviation(float stdDeviationX, float stdDeviat
|
||||
*/
|
||||
static uint32_t ComputeScaledDivisor(uint32_t aDivisor)
|
||||
{
|
||||
return PR_UINT32_MAX/(255*aDivisor);
|
||||
return UINT32_MAX/(255*aDivisor);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -182,7 +182,7 @@ public:
|
||||
static nsIntRect GetMaxRect() {
|
||||
// Try to avoid overflow errors dealing with this rect. It will
|
||||
// be intersected with some other reasonable-sized rect eventually.
|
||||
return nsIntRect(PR_INT32_MIN/2, PR_INT32_MIN/2, PR_INT32_MAX, PR_INT32_MAX);
|
||||
return nsIntRect(INT32_MIN/2, INT32_MIN/2, INT32_MAX, INT32_MAX);
|
||||
}
|
||||
|
||||
operator nsISupports*() { return static_cast<nsIContent*>(this); }
|
||||
|
@ -147,8 +147,8 @@ txNodeSorter::sortNodeSet(txNodeSet* aNodes, txExecutionState* aEs,
|
||||
|
||||
// Limit resource use to something sane.
|
||||
uint32_t itemSize = sizeof(uint32_t) + mNKeys * sizeof(txObject*);
|
||||
if (mNKeys > (PR_UINT32_MAX - sizeof(uint32_t)) / sizeof(txObject*) ||
|
||||
len >= PR_UINT32_MAX / itemSize) {
|
||||
if (mNKeys > (UINT32_MAX - sizeof(uint32_t)) / sizeof(txObject*) ||
|
||||
len >= UINT32_MAX / itemSize) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
@ -651,7 +651,7 @@ nsXULPrototypeCache::BeginCaching(nsIURI* aURI)
|
||||
uint64_t len64;
|
||||
rv = inputStream->Available(&len64);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (len64 <= PR_UINT32_MAX)
|
||||
if (len64 <= UINT32_MAX)
|
||||
len = (uint32_t)len64;
|
||||
else
|
||||
rv = NS_ERROR_FILE_TOO_BIG;
|
||||
|
@ -321,11 +321,11 @@ nsXULPrototypeDocument::Read(nsIObjectInputStream* aStream)
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo;
|
||||
// Using PR_UINT16_MAX here as we don't know which nodeinfos will be
|
||||
// Using UINT16_MAX here as we don't know which nodeinfos will be
|
||||
// used for attributes and which for elements. And that doesn't really
|
||||
// matter.
|
||||
tmp = mNodeInfoManager->GetNodeInfo(localName, prefix, namespaceURI,
|
||||
PR_UINT16_MAX,
|
||||
UINT16_MAX,
|
||||
getter_AddRefs(nodeInfo));
|
||||
if (NS_FAILED(tmp)) {
|
||||
rv = tmp;
|
||||
|
@ -294,7 +294,7 @@ public:
|
||||
{
|
||||
// nsTemplateMatch stores the index as a 16-bit value,
|
||||
// so check to make sure for overflow
|
||||
if (mRules.Length() == PR_INT16_MAX)
|
||||
if (mRules.Length() == INT16_MAX)
|
||||
return nullptr;
|
||||
|
||||
return mRules.AppendElement(nsTemplateRule(aRuleNode, aAction,
|
||||
|
@ -1830,7 +1830,7 @@ nsXULTemplateBuilder::CompileTemplate(nsIContent* aTemplate,
|
||||
nsINodeInfo *ni = rulenode->NodeInfo();
|
||||
|
||||
// don't allow more queries than can be supported
|
||||
if (*aPriority == PR_INT16_MAX)
|
||||
if (*aPriority == INT16_MAX)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// XXXndeakin queryset isn't a good name for this tag since it only
|
||||
|
@ -9372,7 +9372,7 @@ nsDocShell::AddHeadersToChannel(nsIInputStream *aHeadersData,
|
||||
nsAutoCString headersString;
|
||||
nsresult rv = aHeadersData->ReadSegments(AppendSegmentToString,
|
||||
&headersString,
|
||||
PR_UINT32_MAX,
|
||||
UINT32_MAX,
|
||||
&numRead);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -9207,7 +9207,7 @@ static inline uint32_t
|
||||
PrivateToFlags(void *priv)
|
||||
{
|
||||
uintptr_t intPriv = reinterpret_cast<uintptr_t>(priv);
|
||||
MOZ_ASSERT(intPriv <= PR_UINT32_MAX && (intPriv & 1) == 0);
|
||||
MOZ_ASSERT(intPriv <= UINT32_MAX && (intPriv & 1) == 0);
|
||||
return static_cast<uint32_t>(intPriv >> 1);
|
||||
}
|
||||
|
||||
|
@ -8769,7 +8769,7 @@ nsGlobalWindow::RegisterIdleObserver(nsIIdleObserver* aIdleObserver)
|
||||
tmpIdleObserver.mIdleObserver = aIdleObserver;
|
||||
rv = aIdleObserver->GetTime(&tmpIdleObserver.mTimeInS);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_ARG_MAX(tmpIdleObserver.mTimeInS, PR_UINT32_MAX / 1000);
|
||||
NS_ENSURE_ARG_MAX(tmpIdleObserver.mTimeInS, UINT32_MAX / 1000);
|
||||
NS_ENSURE_ARG_MIN(tmpIdleObserver.mTimeInS, MIN_IDLE_NOTIFICATION_TIME_S);
|
||||
|
||||
uint32_t insertAtIndex = FindInsertionIndex(&tmpIdleObserver);
|
||||
|
@ -162,14 +162,14 @@ static bool sPostGCEventsToConsole;
|
||||
static bool sPostGCEventsToObserver;
|
||||
static bool sDisableExplicitCompartmentGC;
|
||||
static uint32_t sCCTimerFireCount = 0;
|
||||
static uint32_t sMinForgetSkippableTime = PR_UINT32_MAX;
|
||||
static uint32_t sMinForgetSkippableTime = UINT32_MAX;
|
||||
static uint32_t sMaxForgetSkippableTime = 0;
|
||||
static uint32_t sTotalForgetSkippableTime = 0;
|
||||
static uint32_t sRemovedPurples = 0;
|
||||
static uint32_t sForgetSkippableBeforeCC = 0;
|
||||
static uint32_t sPreviousSuspectedCount = 0;
|
||||
static uint32_t sCompartmentGCCount = NS_MAX_COMPARTMENT_GC_COUNT;
|
||||
static uint32_t sCleanupsSinceLastGC = PR_UINT32_MAX;
|
||||
static uint32_t sCleanupsSinceLastGC = UINT32_MAX;
|
||||
static bool sNeedsFullCC = false;
|
||||
static nsJSContext *sContextList = nullptr;
|
||||
|
||||
@ -3095,7 +3095,7 @@ nsJSContext::CycleCollectNow(nsICycleCollectorListener *aListener,
|
||||
PRTime delta = GetCollectionTimeDelta();
|
||||
|
||||
uint32_t cleanups = sForgetSkippableBeforeCC ? sForgetSkippableBeforeCC : 1;
|
||||
uint32_t minForgetSkippableTime = (sMinForgetSkippableTime == PR_UINT32_MAX)
|
||||
uint32_t minForgetSkippableTime = (sMinForgetSkippableTime == UINT32_MAX)
|
||||
? 0 : sMinForgetSkippableTime;
|
||||
|
||||
if (sPostGCEventsToConsole) {
|
||||
@ -3172,7 +3172,7 @@ nsJSContext::CycleCollectNow(nsICycleCollectorListener *aListener,
|
||||
observerService->NotifyObservers(nullptr, "cycle-collection-statistics", json.get());
|
||||
}
|
||||
}
|
||||
sMinForgetSkippableTime = PR_UINT32_MAX;
|
||||
sMinForgetSkippableTime = UINT32_MAX;
|
||||
sMaxForgetSkippableTime = 0;
|
||||
sTotalForgetSkippableTime = 0;
|
||||
sRemovedPurples = 0;
|
||||
@ -3892,7 +3892,7 @@ ReadSourceFromFilename(JSContext *cx, const char *filename, jschar **src, uint32
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!rawLen)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (rawLen > PR_UINT32_MAX)
|
||||
if (rawLen > UINT32_MAX)
|
||||
return NS_ERROR_FILE_TOO_BIG;
|
||||
|
||||
// Allocate an internal buf the size of the file.
|
||||
|
@ -757,7 +757,7 @@ nsGonkCameraControl::SetPreviewSize(uint32_t aWidth, uint32_t aHeight)
|
||||
Vector<Size> previewSizes;
|
||||
uint32_t bestWidth = aWidth;
|
||||
uint32_t bestHeight = aHeight;
|
||||
uint32_t minSizeDelta = PR_UINT32_MAX;
|
||||
uint32_t minSizeDelta = UINT32_MAX;
|
||||
uint32_t delta;
|
||||
Size size;
|
||||
|
||||
|
@ -367,7 +367,7 @@ DeviceStorageFile::Write(nsIInputStream* aInputStream)
|
||||
while (bufSize) {
|
||||
uint32_t wrote;
|
||||
rv = bufferedOutputStream->WriteFrom(aInputStream,
|
||||
static_cast<uint32_t>(NS_MIN<uint64_t>(bufSize, PR_UINT32_MAX)),
|
||||
static_cast<uint32_t>(NS_MIN<uint64_t>(bufSize, UINT32_MAX)),
|
||||
&wrote);
|
||||
if (NS_FAILED(rv)) {
|
||||
break;
|
||||
|
@ -342,7 +342,7 @@ ArchiveInputStream::SetEOF()
|
||||
NS_IMETHODIMP
|
||||
ArchiveZipFile::GetInternalStream(nsIInputStream** aStream)
|
||||
{
|
||||
if (mLength > PR_INT32_MAX)
|
||||
if (mLength > INT32_MAX)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
uint64_t size;
|
||||
|
@ -16,7 +16,7 @@ MemoryOutputStream::Create(uint64_t aSize)
|
||||
{
|
||||
NS_ASSERTION(aSize, "Passed zero size!");
|
||||
|
||||
NS_ENSURE_TRUE(aSize <= PR_UINT32_MAX, nullptr);
|
||||
NS_ENSURE_TRUE(aSize <= UINT32_MAX, nullptr);
|
||||
|
||||
nsRefPtr<MemoryOutputStream> stream = new MemoryOutputStream();
|
||||
|
||||
|
@ -14,11 +14,11 @@ FileInfo::Create(FileManager* aFileManager, int64_t aId)
|
||||
{
|
||||
NS_ASSERTION(aId > 0, "Wrong id!");
|
||||
|
||||
if (aId <= PR_INT16_MAX) {
|
||||
if (aId <= INT16_MAX) {
|
||||
return new FileInfo16(aFileManager, aId);
|
||||
}
|
||||
|
||||
if (aId <= PR_INT32_MAX) {
|
||||
if (aId <= INT32_MAX) {
|
||||
return new FileInfo32(aFileManager, aId);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ NS_IMETHODIMP
|
||||
FileStream::Seek(int32_t aWhence, int64_t aOffset)
|
||||
{
|
||||
// TODO: Add support for 64 bit file sizes, bug 752431
|
||||
NS_ENSURE_TRUE(aOffset <= PR_INT32_MAX, NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE(aOffset <= INT32_MAX, NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsresult rv = DoPendingOpen();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -744,7 +744,7 @@ IDBCursor::Advance(int64_t aCount)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
if (aCount < 1 || aCount > PR_UINT32_MAX) {
|
||||
if (aCount < 1 || aCount > UINT32_MAX) {
|
||||
return NS_ERROR_TYPE_ERR;
|
||||
}
|
||||
|
||||
|
@ -852,7 +852,7 @@ IDBIndex::GetAll(const jsval& aKey,
|
||||
}
|
||||
|
||||
if (aOptionalArgCount < 2 || aLimit == 0) {
|
||||
aLimit = PR_UINT32_MAX;
|
||||
aLimit = UINT32_MAX;
|
||||
}
|
||||
|
||||
nsRefPtr<IDBRequest> request;
|
||||
@ -886,7 +886,7 @@ IDBIndex::GetAllKeys(const jsval& aKey,
|
||||
}
|
||||
|
||||
if (aOptionalArgCount < 2 || aLimit == 0) {
|
||||
aLimit = PR_UINT32_MAX;
|
||||
aLimit = UINT32_MAX;
|
||||
}
|
||||
|
||||
nsRefPtr<IDBRequest> request;
|
||||
@ -1323,7 +1323,7 @@ GetAllKeysHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
||||
}
|
||||
|
||||
nsCString limitClause;
|
||||
if (mLimit != PR_UINT32_MAX) {
|
||||
if (mLimit != UINT32_MAX) {
|
||||
limitClause = NS_LITERAL_CSTRING(" LIMIT ");
|
||||
limitClause.AppendInt(mLimit);
|
||||
}
|
||||
@ -1490,7 +1490,7 @@ GetAllHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
||||
}
|
||||
|
||||
nsCString limitClause;
|
||||
if (mLimit != PR_UINT32_MAX) {
|
||||
if (mLimit != UINT32_MAX) {
|
||||
limitClause = NS_LITERAL_CSTRING(" LIMIT ");
|
||||
limitClause.AppendInt(mLimit);
|
||||
}
|
||||
|
@ -2127,7 +2127,7 @@ IDBObjectStore::GetAll(const jsval& aKey,
|
||||
}
|
||||
|
||||
if (aOptionalArgCount < 2 || aLimit == 0) {
|
||||
aLimit = PR_UINT32_MAX;
|
||||
aLimit = UINT32_MAX;
|
||||
}
|
||||
|
||||
nsRefPtr<IDBRequest> request;
|
||||
@ -3679,7 +3679,7 @@ GetAllHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
}
|
||||
|
||||
nsAutoCString limitClause;
|
||||
if (mLimit != PR_UINT32_MAX) {
|
||||
if (mLimit != UINT32_MAX) {
|
||||
limitClause.AssignLiteral(" LIMIT ");
|
||||
limitClause.AppendInt(mLimit);
|
||||
}
|
||||
|
@ -1295,7 +1295,7 @@ _intfromidentifier(NPIdentifier id)
|
||||
}
|
||||
|
||||
if (!NPIdentifierIsInt(id)) {
|
||||
return PR_INT32_MIN;
|
||||
return INT32_MIN;
|
||||
}
|
||||
|
||||
return NPIdentifierToInt(id);
|
||||
|
@ -52,7 +52,7 @@ BrowserStreamParent::AnswerNPN_RequestRead(const IPCByteRanges& ranges,
|
||||
if (!mStream)
|
||||
return false;
|
||||
|
||||
if (ranges.size() > PR_INT32_MAX)
|
||||
if (ranges.size() > INT32_MAX)
|
||||
return false;
|
||||
|
||||
nsAutoArrayPtr<NPByteRange> rp(new NPByteRange[ranges.size()]);
|
||||
|
@ -2296,7 +2296,7 @@ PluginModuleChild::NPN_IntFromIdentifier(NPIdentifier aIdentifier)
|
||||
if (!static_cast<PluginIdentifierChild*>(aIdentifier)->IsString()) {
|
||||
return static_cast<PluginIdentifierChildInt*>(aIdentifier)->ToInt();
|
||||
}
|
||||
return PR_INT32_MIN;
|
||||
return INT32_MIN;
|
||||
}
|
||||
|
||||
#ifdef OS_WIN
|
||||
|
@ -408,7 +408,7 @@ PluginModuleParent::ProcessFirstMinidump()
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t sequence = PR_UINT32_MAX;
|
||||
uint32_t sequence = UINT32_MAX;
|
||||
nsCOMPtr<nsIFile> dumpFile;
|
||||
nsAutoCString flashProcessType;
|
||||
TakeMinidump(getter_AddRefs(dumpFile), &sequence);
|
||||
|
@ -450,8 +450,8 @@ nsJSON::DecodeInternal(JSContext* cx,
|
||||
if (!available)
|
||||
break; // blocking input stream has none available when done
|
||||
|
||||
if (available > PR_UINT32_MAX)
|
||||
available = PR_UINT32_MAX;
|
||||
if (available > UINT32_MAX)
|
||||
available = UINT32_MAX;
|
||||
|
||||
rv = jsonListener->OnDataAvailable(jsonChannel, nullptr,
|
||||
aStream,
|
||||
|
@ -28,7 +28,7 @@ class nsIDOMTelephonyCall;
|
||||
BEGIN_TELEPHONY_NAMESPACE
|
||||
|
||||
enum {
|
||||
kOutgoingPlaceholderCallIndex = PR_UINT32_MAX
|
||||
kOutgoingPlaceholderCallIndex = UINT32_MAX
|
||||
};
|
||||
|
||||
class Telephony;
|
||||
|
@ -150,7 +150,7 @@ public:
|
||||
nsCOMPtr<nsISupportsPRUint32> indexSupports(do_QueryInterface(aContext));
|
||||
NS_ASSERTION(indexSupports, "This should never fail!");
|
||||
|
||||
uint32_t index = PR_UINT32_MAX;
|
||||
uint32_t index = UINT32_MAX;
|
||||
if (NS_FAILED(indexSupports->GetData(&index)) ||
|
||||
index >= mLoadInfos.Length()) {
|
||||
NS_ERROR("Bad index!");
|
||||
@ -513,8 +513,8 @@ public:
|
||||
void
|
||||
ExecuteFinishedScripts()
|
||||
{
|
||||
uint32_t firstIndex = PR_UINT32_MAX;
|
||||
uint32_t lastIndex = PR_UINT32_MAX;
|
||||
uint32_t firstIndex = UINT32_MAX;
|
||||
uint32_t lastIndex = UINT32_MAX;
|
||||
|
||||
// Find firstIndex based on whether mExecutionScheduled is unset.
|
||||
for (uint32_t index = 0; index < mLoadInfos.Length(); index++) {
|
||||
@ -526,7 +526,7 @@ public:
|
||||
|
||||
// Find lastIndex based on whether mChannel is set, and update
|
||||
// mExecutionScheduled on the ones we're about to schedule.
|
||||
if (firstIndex != PR_UINT32_MAX) {
|
||||
if (firstIndex != UINT32_MAX) {
|
||||
for (uint32_t index = firstIndex; index < mLoadInfos.Length(); index++) {
|
||||
ScriptLoadInfo& loadInfo = mLoadInfos[index];
|
||||
|
||||
@ -542,7 +542,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (firstIndex != PR_UINT32_MAX && lastIndex != PR_UINT32_MAX) {
|
||||
if (firstIndex != UINT32_MAX && lastIndex != UINT32_MAX) {
|
||||
nsRefPtr<ScriptExecutorRunnable> runnable =
|
||||
new ScriptExecutorRunnable(*this, mSyncQueueKey, firstIndex, lastIndex);
|
||||
if (!runnable->Dispatch(nullptr)) {
|
||||
|
@ -3132,11 +3132,11 @@ uint32_t
|
||||
WorkerPrivate::RemainingRunTimeMS() const
|
||||
{
|
||||
if (mKillTime.IsNull()) {
|
||||
return PR_UINT32_MAX;
|
||||
return UINT32_MAX;
|
||||
}
|
||||
TimeDuration runtime = mKillTime - TimeStamp::Now();
|
||||
double ms = runtime > TimeDuration(0) ? runtime.ToMilliseconds() : 0;
|
||||
return ms > double(PR_UINT32_MAX) ? PR_UINT32_MAX : uint32_t(ms);
|
||||
return ms > double(UINT32_MAX) ? UINT32_MAX : uint32_t(ms);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -3337,7 +3337,7 @@ WorkerPrivate::CreateNewSyncLoop()
|
||||
{
|
||||
AssertIsOnWorkerThread();
|
||||
|
||||
NS_ASSERTION(mSyncQueues.Length() < PR_UINT32_MAX,
|
||||
NS_ASSERTION(mSyncQueues.Length() < UINT32_MAX,
|
||||
"Should have bailed by now!");
|
||||
|
||||
mSyncQueues.AppendElement(new SyncQueue());
|
||||
@ -3674,7 +3674,7 @@ WorkerPrivate::SetTimeout(JSContext* aCx, unsigned aArgc, jsval* aVp,
|
||||
newInfo->mIsInterval = aIsInterval;
|
||||
newInfo->mId = timerId;
|
||||
|
||||
if (NS_UNLIKELY(timerId == PR_UINT32_MAX)) {
|
||||
if (NS_UNLIKELY(timerId == UINT32_MAX)) {
|
||||
NS_WARNING("Timeout ids overflowed!");
|
||||
mNextTimeoutId = 1;
|
||||
}
|
||||
@ -3938,7 +3938,7 @@ WorkerPrivate::RescheduleTimeoutTimer(JSContext* aCx)
|
||||
|
||||
double delta =
|
||||
(mTimeouts[0]->mTargetTime - TimeStamp::Now()).ToMilliseconds();
|
||||
uint32_t delay = delta > 0 ? NS_MIN(delta, double(PR_UINT32_MAX)) : 0;
|
||||
uint32_t delay = delta > 0 ? NS_MIN(delta, double(UINT32_MAX)) : 0;
|
||||
|
||||
nsresult rv = mTimer->InitWithFuncCallback(DummyCallback, nullptr, delay,
|
||||
nsITimer::TYPE_ONE_SHOT);
|
||||
|
@ -134,8 +134,8 @@ public:
|
||||
mLastUploadLoaded(0), mLastUploadTotal(0), mIsSyncXHR(false),
|
||||
mLastLengthComputable(false), mLastUploadLengthComputable(false),
|
||||
mSeenLoadStart(false), mSeenUploadLoadStart(false),
|
||||
mSyncQueueKey(PR_UINT32_MAX),
|
||||
mSyncEventResponseSyncQueueKey(PR_UINT32_MAX),
|
||||
mSyncQueueKey(UINT32_MAX),
|
||||
mSyncEventResponseSyncQueueKey(UINT32_MAX),
|
||||
mUploadEventListenersAttached(false), mMainThreadSeenLoadStart(false),
|
||||
mInOpen(false)
|
||||
{ }
|
||||
@ -201,7 +201,7 @@ public:
|
||||
GetSyncQueueKey()
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
return mSyncEventResponseSyncQueueKey == PR_UINT32_MAX ?
|
||||
return mSyncEventResponseSyncQueueKey == UINT32_MAX ?
|
||||
mSyncQueueKey :
|
||||
mSyncEventResponseSyncQueueKey;
|
||||
}
|
||||
@ -211,8 +211,8 @@ public:
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
return mSyncQueueKey == PR_UINT32_MAX &&
|
||||
mSyncEventResponseSyncQueueKey == PR_UINT32_MAX;
|
||||
return mSyncQueueKey == UINT32_MAX &&
|
||||
mSyncEventResponseSyncQueueKey == UINT32_MAX;
|
||||
}
|
||||
};
|
||||
|
||||
@ -430,7 +430,7 @@ class LoadStartDetectionRunnable MOZ_FINAL : public nsIRunnable,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mSyncQueueKey != PR_UINT32_MAX) {
|
||||
if (mSyncQueueKey != UINT32_MAX) {
|
||||
aWorkerPrivate->StopSyncLoop(mSyncQueueKey, true);
|
||||
}
|
||||
|
||||
@ -1199,7 +1199,7 @@ public:
|
||||
NS_ASSERTION(!mProxy->mWorkerPrivate, "Should be null!");
|
||||
mProxy->mWorkerPrivate = mWorkerPrivate;
|
||||
|
||||
NS_ASSERTION(mProxy->mSyncQueueKey == PR_UINT32_MAX, "Should be unset!");
|
||||
NS_ASSERTION(mProxy->mSyncQueueKey == UINT32_MAX, "Should be unset!");
|
||||
mProxy->mSyncQueueKey = mSyncQueueKey;
|
||||
|
||||
if (mHasUploadListeners) {
|
||||
@ -1693,7 +1693,7 @@ XMLHttpRequest::SendInternal(const nsAString& aStringBody,
|
||||
|
||||
AutoUnpinXHR autoUnpin(this);
|
||||
|
||||
uint32_t syncQueueKey = PR_UINT32_MAX;
|
||||
uint32_t syncQueueKey = UINT32_MAX;
|
||||
if (mProxy->mIsSyncXHR) {
|
||||
syncQueueKey = mWorkerPrivate->CreateNewSyncLoop();
|
||||
}
|
||||
|
@ -1222,7 +1222,7 @@ nsresult nsHTMLEditor::InsertObject(const char* aType, nsISupports* aObject, boo
|
||||
}
|
||||
|
||||
nsCString imageData;
|
||||
rv = NS_ConsumeStream(imageStream, PR_UINT32_MAX, imageData);
|
||||
rv = NS_ConsumeStream(imageStream, UINT32_MAX, imageData);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = imageStream->Close();
|
||||
|
@ -50,7 +50,7 @@ nsEmbedStream::OpenStream(nsIURI *aBaseURI, const nsACString& aContentType)
|
||||
nsCOMPtr<nsIAsyncOutputStream> outputStream;
|
||||
rv = NS_NewPipe2(getter_AddRefs(inputStream),
|
||||
getter_AddRefs(outputStream),
|
||||
true, false, 0, PR_UINT32_MAX);
|
||||
true, false, 0, UINT32_MAX);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
|
@ -1861,18 +1861,18 @@ nsWindowWatcher::CalcSizeSpec(const char* aFeatures, SizeSpec& aResult)
|
||||
aResult.mTopSpecified = present;
|
||||
|
||||
// Parse size spec, if any. Chrome size overrides content size.
|
||||
if ((temp = WinHasOption(aFeatures, "outerWidth", PR_INT32_MIN, nullptr))) {
|
||||
if (temp == PR_INT32_MIN) {
|
||||
if ((temp = WinHasOption(aFeatures, "outerWidth", INT32_MIN, nullptr))) {
|
||||
if (temp == INT32_MIN) {
|
||||
aResult.mUseDefaultWidth = true;
|
||||
}
|
||||
else {
|
||||
aResult.mOuterWidth = temp;
|
||||
}
|
||||
aResult.mOuterWidthSpecified = true;
|
||||
} else if ((temp = WinHasOption(aFeatures, "width", PR_INT32_MIN, nullptr)) ||
|
||||
(temp = WinHasOption(aFeatures, "innerWidth", PR_INT32_MIN,
|
||||
} else if ((temp = WinHasOption(aFeatures, "width", INT32_MIN, nullptr)) ||
|
||||
(temp = WinHasOption(aFeatures, "innerWidth", INT32_MIN,
|
||||
nullptr))) {
|
||||
if (temp == PR_INT32_MIN) {
|
||||
if (temp == INT32_MIN) {
|
||||
aResult.mUseDefaultWidth = true;
|
||||
} else {
|
||||
aResult.mInnerWidth = temp;
|
||||
@ -1880,19 +1880,19 @@ nsWindowWatcher::CalcSizeSpec(const char* aFeatures, SizeSpec& aResult)
|
||||
aResult.mInnerWidthSpecified = true;
|
||||
}
|
||||
|
||||
if ((temp = WinHasOption(aFeatures, "outerHeight", PR_INT32_MIN, nullptr))) {
|
||||
if (temp == PR_INT32_MIN) {
|
||||
if ((temp = WinHasOption(aFeatures, "outerHeight", INT32_MIN, nullptr))) {
|
||||
if (temp == INT32_MIN) {
|
||||
aResult.mUseDefaultHeight = true;
|
||||
}
|
||||
else {
|
||||
aResult.mOuterHeight = temp;
|
||||
}
|
||||
aResult.mOuterHeightSpecified = true;
|
||||
} else if ((temp = WinHasOption(aFeatures, "height", PR_INT32_MIN,
|
||||
} else if ((temp = WinHasOption(aFeatures, "height", INT32_MIN,
|
||||
nullptr)) ||
|
||||
(temp = WinHasOption(aFeatures, "innerHeight", PR_INT32_MIN,
|
||||
(temp = WinHasOption(aFeatures, "innerHeight", INT32_MIN,
|
||||
nullptr))) {
|
||||
if (temp == PR_INT32_MIN) {
|
||||
if (temp == INT32_MIN) {
|
||||
aResult.mUseDefaultHeight = true;
|
||||
} else {
|
||||
aResult.mInnerHeight = temp;
|
||||
|
@ -145,7 +145,7 @@ class nsGIOInputStream : public nsIInputStream
|
||||
, mChannel(nullptr)
|
||||
, mHandle(nullptr)
|
||||
, mStream(nullptr)
|
||||
, mBytesRemaining(PR_UINT64_MAX)
|
||||
, mBytesRemaining(UINT64_MAX)
|
||||
, mStatus(NS_OK)
|
||||
, mDirList(nullptr)
|
||||
, mDirListPtr(nullptr)
|
||||
|
@ -319,7 +319,7 @@ class nsGnomeVFSInputStream MOZ_FINAL : public nsIInputStream
|
||||
: mSpec(uriSpec)
|
||||
, mChannel(nullptr)
|
||||
, mHandle(nullptr)
|
||||
, mBytesRemaining(PR_UINT64_MAX)
|
||||
, mBytesRemaining(UINT64_MAX)
|
||||
, mStatus(NS_OK)
|
||||
, mDirList(nullptr)
|
||||
, mDirListPtr(nullptr)
|
||||
@ -433,9 +433,9 @@ nsGnomeVFSInputStream::DoOpen()
|
||||
|
||||
// Update the content length attribute on the channel. We do this
|
||||
// synchronously without proxying. This hack is not as bad as it looks!
|
||||
if (mBytesRemaining != PR_UINT64_MAX) {
|
||||
if (mBytesRemaining != UINT64_MAX) {
|
||||
// XXX 64-bit
|
||||
mChannel->SetContentLength(NS_MAX((int32_t)mBytesRemaining, PR_INT32_MAX));
|
||||
mChannel->SetContentLength(NS_MAX((int32_t)mBytesRemaining, INT32_MAX));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -284,7 +284,7 @@ nsresult nsReadConfig::openAndEvaluateJSFile(const char *aFileName, int32_t obsc
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// PR_Malloc dones't support over 4GB
|
||||
if (fs64 > PR_UINT32_MAX)
|
||||
if (fs64 > UINT32_MAX)
|
||||
return NS_ERROR_FILE_TOO_BIG;
|
||||
uint32_t fs = (uint32_t)fs64;
|
||||
|
||||
|
@ -482,7 +482,7 @@ mozInlineSpellWordUtil::BuildSoftText()
|
||||
}
|
||||
break;
|
||||
}
|
||||
checkBeforeOffset = PR_INT32_MAX;
|
||||
checkBeforeOffset = INT32_MAX;
|
||||
if (IsBreakElement(node)) {
|
||||
// Since GetPreviousContent follows tree *preorder*, we're about to traverse
|
||||
// up out of 'node'. Since node induces breaks (e.g., it's a block),
|
||||
|
@ -346,7 +346,7 @@ public:
|
||||
bool ok = InitWithPrefix("gl", true);
|
||||
|
||||
PR_STATIC_ASSERT(sizeof(GLint) >= sizeof(int32_t));
|
||||
mMaxTextureImageSize = PR_INT32_MAX;
|
||||
mMaxTextureImageSize = INT32_MAX;
|
||||
|
||||
mShareWithEGLImage = sEGLLibrary.HasKHRImageBase() &&
|
||||
sEGLLibrary.HasKHRImageTexture2D() &&
|
||||
|
@ -388,7 +388,7 @@ public:
|
||||
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) { return true; }
|
||||
|
||||
/**
|
||||
* returns the maximum texture size on this layer backend, or PR_INT32_MAX
|
||||
* returns the maximum texture size on this layer backend, or INT32_MAX
|
||||
* if there is no maximum
|
||||
*/
|
||||
virtual int32_t GetMaxTextureSize() const = 0;
|
||||
|
@ -1039,7 +1039,7 @@ BasicShadowLayerManager::GetMaxTextureSize() const
|
||||
return ShadowLayerForwarder::GetMaxTextureSize();
|
||||
}
|
||||
|
||||
return PR_INT32_MAX;
|
||||
return INT32_MAX;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -152,7 +152,7 @@ public:
|
||||
void PopGroupToSourceWithCachedSurface(gfxContext *aTarget, gfxContext *aPushed);
|
||||
|
||||
virtual bool IsCompositingCheap() { return false; }
|
||||
virtual int32_t GetMaxTextureSize() const { return PR_INT32_MAX; }
|
||||
virtual int32_t GetMaxTextureSize() const { return INT32_MAX; }
|
||||
bool CompositorMightResample() { return mCompositorMightResample; }
|
||||
|
||||
protected:
|
||||
|
@ -1185,7 +1185,7 @@ LayerManagerOGL::CopyToTarget(gfxContext *aTarget)
|
||||
GLint width = rect.width;
|
||||
GLint height = rect.height;
|
||||
|
||||
if ((int64_t(width) * int64_t(height) * int64_t(4)) > PR_INT32_MAX) {
|
||||
if ((int64_t(width) * int64_t(height) * int64_t(4)) > INT32_MAX) {
|
||||
NS_ERROR("Widget size too big - integer overflow!");
|
||||
return;
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ NSCoordGreaterThan(nscoord a,nscoord b)
|
||||
/**
|
||||
* Convert an nscoord to a int32_t. This *does not* do rounding because
|
||||
* coords are never fractional. They can be out of range, so this does
|
||||
* clamp out of bounds coord values to PR_INT32_MIN and PR_INT32_MAX.
|
||||
* clamp out of bounds coord values to INT32_MIN and INT32_MAX.
|
||||
*/
|
||||
inline int32_t NSCoordToInt(nscoord aCoord) {
|
||||
VERIFY_COORD(aCoord);
|
||||
@ -301,11 +301,11 @@ inline int32_t NSCoordToInt(nscoord aCoord) {
|
||||
if (aCoord < -2147483648.0f) {
|
||||
// -2147483648 is the smallest 32-bit signed integer that can be
|
||||
// exactly represented as a float
|
||||
return PR_INT32_MIN;
|
||||
return INT32_MIN;
|
||||
} else if (aCoord > 2147483520.0f) {
|
||||
// 2147483520 is the largest 32-bit signed integer that can be
|
||||
// exactly represented as an IEEE float
|
||||
return PR_INT32_MAX;
|
||||
return INT32_MAX;
|
||||
} else {
|
||||
return (int32_t)aCoord;
|
||||
}
|
||||
|
@ -20,8 +20,8 @@
|
||||
#define NS_COORD_LESS_SENTINEL nscoord_MIN
|
||||
#define NS_COORD_GREATER_SENTINEL nscoord_MAX
|
||||
#else
|
||||
#define NS_COORD_LESS_SENTINEL PR_INT32_MIN
|
||||
#define NS_COORD_GREATER_SENTINEL PR_INT32_MAX
|
||||
#define NS_COORD_LESS_SENTINEL INT32_MIN
|
||||
#define NS_COORD_GREATER_SENTINEL INT32_MAX
|
||||
#endif
|
||||
|
||||
// Fast inline analogues of nsRect methods for nsRegion::nsRectFast.
|
||||
|
@ -79,7 +79,7 @@ int main(int argc, char** argv)
|
||||
uint8_t g = NS_GET_G(rgb);
|
||||
uint8_t b = NS_GET_B(rgb);
|
||||
uint8_t a = NS_GET_A(rgb);
|
||||
if (a != PR_UINT8_MAX) {
|
||||
if (a != UINT8_MAX) {
|
||||
// NS_HexToRGB() can not handle a color with alpha channel
|
||||
rgb = NS_RGB(r, g, b);
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ gfxASurface::WriteAsPNG_internal(FILE* aFile, bool aBinary)
|
||||
if (NS_FAILED(rv))
|
||||
return;
|
||||
|
||||
if (bufSize64 > PR_UINT32_MAX - 16)
|
||||
if (bufSize64 > UINT32_MAX - 16)
|
||||
return;
|
||||
|
||||
uint32_t bufSize = (uint32_t)bufSize64;
|
||||
|
@ -55,7 +55,7 @@ gfxDWriteShaper::ShapeWord(gfxContext *aContext,
|
||||
|
||||
UINT32 maxGlyphs = 0;
|
||||
trymoreglyphs:
|
||||
if ((PR_UINT32_MAX - 3 * length / 2 + 16) < maxGlyphs) {
|
||||
if ((UINT32_MAX - 3 * length / 2 + 16) < maxGlyphs) {
|
||||
// This isn't going to work, we're going to cross the UINT32 upper
|
||||
// limit. Give up.
|
||||
NS_WARNING("Shaper needs to generate more than 2^32 glyphs?!");
|
||||
|
@ -5214,7 +5214,7 @@ gfxTextRun::BreakAndMeasureText(uint32_t aStart, uint32_t aMaxLength,
|
||||
}
|
||||
if (aLastBreak && charsFit == aMaxLength) {
|
||||
if (lastBreak < 0) {
|
||||
*aLastBreak = PR_UINT32_MAX;
|
||||
*aLastBreak = UINT32_MAX;
|
||||
} else {
|
||||
*aLastBreak = lastBreak - aStart;
|
||||
}
|
||||
|
@ -2609,7 +2609,7 @@ public:
|
||||
* SetLineBreaks(aStart, result, aLineBreakBefore, result < aMaxLength, aProvider)
|
||||
* and the returned metrics and the invariants above reflect this.
|
||||
*
|
||||
* @param aMaxLength this can be PR_UINT32_MAX, in which case the length used
|
||||
* @param aMaxLength this can be UINT32_MAX, in which case the length used
|
||||
* is up to the end of the string
|
||||
* @param aLineBreakBefore set to true if and only if there is an actual
|
||||
* line break at the start of this string.
|
||||
@ -2633,7 +2633,7 @@ public:
|
||||
* the maximal N such that
|
||||
* N < aMaxLength && line break at N && GetAdvanceWidth(aStart, N) <= aWidth
|
||||
* OR N < aMaxLength && hyphen break at N && GetAdvanceWidth(aStart, N) + GetHyphenWidth() <= aWidth
|
||||
* or PR_UINT32_MAX if no such N exists, where GetAdvanceWidth assumes
|
||||
* or UINT32_MAX if no such N exists, where GetAdvanceWidth assumes
|
||||
* the effect of
|
||||
* SetLineBreaks(aStart, N, aLineBreakBefore, N < aMaxLength, aProvider)
|
||||
*
|
||||
@ -3109,7 +3109,7 @@ public:
|
||||
// If this group has such "bad" font, each platform's gfxFontGroup initialized mUnderlineOffset.
|
||||
// The value should be lower value of first font's metrics and the bad font's metrics.
|
||||
// Otherwise, this returns from first font's metrics.
|
||||
enum { UNDERLINE_OFFSET_NOT_SET = PR_INT16_MAX };
|
||||
enum { UNDERLINE_OFFSET_NOT_SET = INT16_MAX };
|
||||
virtual gfxFloat GetUnderlineOffset() {
|
||||
if (mUnderlineOffset == UNDERLINE_OFFSET_NOT_SET)
|
||||
mUnderlineOffset = GetFontAt(0)->GetMetrics().underlineOffset;
|
||||
|
@ -1347,7 +1347,7 @@ gfxFontUtils::RenameFont(const nsAString& aName, const uint8_t *aFontData,
|
||||
nameStrLength +
|
||||
3) & ~3;
|
||||
|
||||
if (dataLength + nameTableSize > PR_UINT32_MAX)
|
||||
if (dataLength + nameTableSize > UINT32_MAX)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// bug 505386 - need to handle unpadded font length
|
||||
|
@ -631,7 +631,7 @@ nsPNGDecoder::info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
if (interlace_type == PNG_INTERLACE_ADAM7) {
|
||||
if (height < PR_INT32_MAX / (width * channels))
|
||||
if (height < INT32_MAX / (width * channels))
|
||||
decoder->interlacebuf = (uint8_t *)moz_malloc(channels * width * height);
|
||||
if (!decoder->interlacebuf) {
|
||||
longjmp(png_jmpbuf(decoder->mPNG), 5); // NS_ERROR_OUT_OF_MEMORY
|
||||
|
@ -83,7 +83,7 @@ NS_IMETHODIMP imgTools::DecodeImageData(nsIInputStream* aInStr,
|
||||
uint64_t length;
|
||||
rv = inStream->Available(&length);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_TRUE(length <= PR_UINT32_MAX, NS_ERROR_FILE_TOO_BIG);
|
||||
NS_ENSURE_TRUE(length <= UINT32_MAX, NS_ERROR_FILE_TOO_BIG);
|
||||
|
||||
// Send the source data to the Image. WriteToRasterImage always
|
||||
// consumes everything it gets if it doesn't run out of memory.
|
||||
|
@ -328,7 +328,7 @@ static const uint16_t gPairConservative[MAX_CLASSES] = {
|
||||
|
||||
*/
|
||||
|
||||
#define CLASS_NONE PR_INT8_MAX
|
||||
#define CLASS_NONE INT8_MAX
|
||||
|
||||
#define CLASS_OPEN 0x00
|
||||
#define CLASS_CLOSE 0x01
|
||||
|
@ -356,7 +356,7 @@ Shmem::Alloc(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
|
||||
bool aUnsafe,
|
||||
bool aProtect)
|
||||
{
|
||||
NS_ASSERTION(aNBytes <= PR_UINT32_MAX, "Will truncate shmem segment size!");
|
||||
NS_ASSERTION(aNBytes <= UINT32_MAX, "Will truncate shmem segment size!");
|
||||
NS_ABORT_IF_FALSE(!aProtect || !aUnsafe, "protect => !unsafe");
|
||||
|
||||
size_t pageSize = SharedMemory::SystemPageSize();
|
||||
|
@ -22,7 +22,7 @@ struct RunnableMethodTraits<mozilla::ipc::SyncChannel>
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
const int32_t SyncChannel::kNoTimeout = PR_INT32_MIN;
|
||||
const int32_t SyncChannel::kNoTimeout = INT32_MIN;
|
||||
|
||||
SyncChannel::SyncChannel(SyncListener* aListener)
|
||||
: AsyncChannel(aListener)
|
||||
|
@ -743,7 +743,7 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile,
|
||||
}
|
||||
|
||||
int64_t maxSize;
|
||||
LL_UI2L(maxSize, PR_UINT32_MAX);
|
||||
LL_UI2L(maxSize, UINT32_MAX);
|
||||
if (LL_CMP(fileSize, >, maxSize)) {
|
||||
NS_ERROR("file too large");
|
||||
JS_SetOptions(cx, oldopts);
|
||||
@ -845,7 +845,7 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile,
|
||||
|
||||
rv = scriptStream->Available(&len64);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_TRUE(len64 < PR_UINT32_MAX, NS_ERROR_FILE_TOO_BIG);
|
||||
NS_ENSURE_TRUE(len64 < UINT32_MAX, NS_ERROR_FILE_TOO_BIG);
|
||||
if (!len64)
|
||||
return NS_ERROR_FAILURE;
|
||||
uint32_t len = (uint32_t)len64;
|
||||
|
@ -1482,7 +1482,7 @@ failure:
|
||||
|
||||
// Check that the tag part of the type matches the type
|
||||
// of the array. If the check succeeds, check that the size
|
||||
// of the output does not exceed PR_UINT32_MAX bytes. Allocate
|
||||
// of the output does not exceed UINT32_MAX bytes. Allocate
|
||||
// the memory and copy the elements by memcpy.
|
||||
static JSBool
|
||||
CheckTargetAndPopulate(JSContext *cx,
|
||||
@ -1505,8 +1505,8 @@ CheckTargetAndPopulate(JSContext *cx,
|
||||
}
|
||||
|
||||
// Calulate the maximum number of elements that can fit in
|
||||
// PR_UINT32_MAX bytes.
|
||||
size_t max = PR_UINT32_MAX / typeSize;
|
||||
// UINT32_MAX bytes.
|
||||
size_t max = UINT32_MAX / typeSize;
|
||||
|
||||
// This could overflow on 32-bit systems so check max first.
|
||||
size_t byteSize = count * typeSize;
|
||||
@ -1690,7 +1690,7 @@ XPCConvert::JSArray2Native(JSContext* cx, void** d, JS::Value s,
|
||||
#define POPULATE(_mode, _t) \
|
||||
PR_BEGIN_MACRO \
|
||||
cleanupMode = _mode; \
|
||||
size_t max = PR_UINT32_MAX / sizeof(_t); \
|
||||
size_t max = UINT32_MAX / sizeof(_t); \
|
||||
if (count > max || \
|
||||
nullptr == (array = nsMemory::Alloc(count * sizeof(_t)))) { \
|
||||
if (pErr) \
|
||||
|
@ -2335,8 +2335,8 @@ public:
|
||||
, mCallee(ccx.GetTearOff()->GetNative())
|
||||
, mVTableIndex(ccx.GetMethodIndex())
|
||||
, mIdxValueId(ccx.GetRuntime()->GetStringID(XPCJSRuntime::IDX_VALUE))
|
||||
, mJSContextIndex(PR_UINT8_MAX)
|
||||
, mOptArgcIndex(PR_UINT8_MAX)
|
||||
, mJSContextIndex(UINT8_MAX)
|
||||
, mOptArgcIndex(UINT8_MAX)
|
||||
, mArgv(ccx.GetArgv())
|
||||
, mArgc(ccx.GetArgc())
|
||||
|
||||
|
@ -456,7 +456,7 @@ protected:
|
||||
* aRoundedRectClipCount rounded rects in aClip
|
||||
*/
|
||||
void SetupMaskLayer(Layer *aLayer, const FrameLayerBuilder::Clip& aClip,
|
||||
uint32_t aRoundedRectClipCount = PR_UINT32_MAX);
|
||||
uint32_t aRoundedRectClipCount = UINT32_MAX);
|
||||
|
||||
nsDisplayListBuilder* mBuilder;
|
||||
LayerManager* mManager;
|
||||
|
@ -464,7 +464,7 @@ public:
|
||||
// or clearing of other clips must be done by the caller.
|
||||
// See aBegin/aEnd note on ApplyRoundedRectsTo.
|
||||
void ApplyTo(gfxContext* aContext, nsPresContext* aPresContext,
|
||||
uint32_t aBegin = 0, uint32_t aEnd = PR_UINT32_MAX);
|
||||
uint32_t aBegin = 0, uint32_t aEnd = UINT32_MAX);
|
||||
|
||||
void ApplyRectTo(gfxContext* aContext, int32_t A2D) const;
|
||||
// Applies the rounded rects in this Clip to aContext
|
||||
|
@ -89,7 +89,7 @@ struct nsCounterUseNode : public nsCounterNode {
|
||||
, mCounterStyle(aCounterStyle)
|
||||
, mAllCounters(aAllCounters)
|
||||
{
|
||||
NS_ASSERTION(aContentIndex <= PR_INT32_MAX, "out of range");
|
||||
NS_ASSERTION(aContentIndex <= INT32_MAX, "out of range");
|
||||
}
|
||||
|
||||
virtual bool InitTextFrame(nsGenConList* aList,
|
||||
@ -119,8 +119,8 @@ struct nsCounterChangeNode : public nsCounterNode {
|
||||
// that comes before all the real content, with
|
||||
// the resets first, in order, and then the increments.
|
||||
aPropIndex + (aChangeType == RESET
|
||||
? (PR_INT32_MIN)
|
||||
: (PR_INT32_MIN / 2)),
|
||||
? (INT32_MIN)
|
||||
: (INT32_MIN / 2)),
|
||||
aChangeType)
|
||||
, mChangeValue(aChangeValue)
|
||||
{
|
||||
|
@ -2563,7 +2563,7 @@ public:
|
||||
virtual uint32_t GetPerFrameKey() MOZ_OVERRIDE { return (mIndex << nsDisplayItem::TYPE_BITS) | nsDisplayItem::GetPerFrameKey(); }
|
||||
|
||||
enum {
|
||||
INDEX_MAX = PR_UINT32_MAX >> nsDisplayItem::TYPE_BITS
|
||||
INDEX_MAX = UINT32_MAX >> nsDisplayItem::TYPE_BITS
|
||||
};
|
||||
|
||||
const gfx3DMatrix& GetTransform(float aAppUnitsPerPixel);
|
||||
|
@ -4464,7 +4464,7 @@ nsLayoutUtils::GetFontFacesForFrames(nsIFrame* aFrame,
|
||||
NS_PRECONDITION(aFrame, "NULL frame pointer");
|
||||
|
||||
if (aFrame->GetType() == nsGkAtoms::textFrame) {
|
||||
return GetFontFacesForText(aFrame, 0, PR_INT32_MAX, false,
|
||||
return GetFontFacesForText(aFrame, 0, INT32_MAX, false,
|
||||
aFontFaceList);
|
||||
}
|
||||
|
||||
|
@ -1494,7 +1494,7 @@ public:
|
||||
/**
|
||||
* Adds all font faces used within the specified range of text in aFrame,
|
||||
* and optionally its continuations, to the list in aFontFaceList.
|
||||
* Pass 0 and PR_INT32_MAX for aStartOffset and aEndOffset to specify the
|
||||
* Pass 0 and INT32_MAX for aStartOffset and aEndOffset to specify the
|
||||
* entire text is to be considered.
|
||||
*/
|
||||
static nsresult GetFontFacesForText(nsIFrame* aFrame,
|
||||
|
@ -8110,7 +8110,7 @@ DumpToPNG(nsIPresShell* shell, nsAString& name) {
|
||||
uint64_t length64;
|
||||
rv = encoder->Available(&length64);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (length64 > PR_UINT32_MAX)
|
||||
if (length64 > UINT32_MAX)
|
||||
return NS_ERROR_FILE_TOO_BIG;
|
||||
|
||||
uint32_t length = (uint32_t)length64;
|
||||
|
@ -28,7 +28,7 @@ struct nsQuoteNode : public nsGenConNode {
|
||||
aType == eStyleContentType_NoOpenQuote ||
|
||||
aType == eStyleContentType_NoCloseQuote,
|
||||
"incorrect type");
|
||||
NS_ASSERTION(aContentIndex <= PR_INT32_MAX, "out of range");
|
||||
NS_ASSERTION(aContentIndex <= INT32_MAX, "out of range");
|
||||
}
|
||||
|
||||
virtual bool InitTextFrame(nsGenConList* aList,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user