mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 928741 - Stop using PR_STATIC_ASSERT in content; r=jst
This commit is contained in:
parent
2d2f7fa030
commit
18114993ff
@ -170,7 +170,9 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Make sure we have space for our bits
|
// Make sure we have space for our bits
|
||||||
#define ASSERT_NODE_FLAGS_SPACE(n) PR_STATIC_ASSERT(WRAPPER_CACHE_FLAGS_BITS_USED + (n) <= 32)
|
#define ASSERT_NODE_FLAGS_SPACE(n) \
|
||||||
|
static_assert(WRAPPER_CACHE_FLAGS_BITS_USED + (n) <= 32, \
|
||||||
|
"Not enough space for our bits")
|
||||||
ASSERT_NODE_FLAGS_SPACE(NODE_TYPE_SPECIFIC_BITS_OFFSET);
|
ASSERT_NODE_FLAGS_SPACE(NODE_TYPE_SPECIFIC_BITS_OFFSET);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1309,22 +1311,26 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void SetBoolFlag(BooleanFlag name, bool value) {
|
void SetBoolFlag(BooleanFlag name, bool value) {
|
||||||
PR_STATIC_ASSERT(BooleanFlagCount <= 8*sizeof(mBoolFlags));
|
static_assert(BooleanFlagCount <= 8*sizeof(mBoolFlags),
|
||||||
|
"Too many boolean flags");
|
||||||
mBoolFlags = (mBoolFlags & ~(1 << name)) | (value << name);
|
mBoolFlags = (mBoolFlags & ~(1 << name)) | (value << name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetBoolFlag(BooleanFlag name) {
|
void SetBoolFlag(BooleanFlag name) {
|
||||||
PR_STATIC_ASSERT(BooleanFlagCount <= 8*sizeof(mBoolFlags));
|
static_assert(BooleanFlagCount <= 8*sizeof(mBoolFlags),
|
||||||
|
"Too many boolean flags");
|
||||||
mBoolFlags |= (1 << name);
|
mBoolFlags |= (1 << name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearBoolFlag(BooleanFlag name) {
|
void ClearBoolFlag(BooleanFlag name) {
|
||||||
PR_STATIC_ASSERT(BooleanFlagCount <= 8*sizeof(mBoolFlags));
|
static_assert(BooleanFlagCount <= 8*sizeof(mBoolFlags),
|
||||||
|
"Too many boolean flags");
|
||||||
mBoolFlags &= ~(1 << name);
|
mBoolFlags &= ~(1 << name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetBoolFlag(BooleanFlag name) const {
|
bool GetBoolFlag(BooleanFlag name) const {
|
||||||
PR_STATIC_ASSERT(BooleanFlagCount <= 8*sizeof(mBoolFlags));
|
static_assert(BooleanFlagCount <= 8*sizeof(mBoolFlags),
|
||||||
|
"Too many boolean flags");
|
||||||
return mBoolFlags & (1 << name);
|
return mBoolFlags & (1 << name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9038,7 +9038,8 @@ void
|
|||||||
nsIDocument::WarnOnceAbout(DeprecatedOperations aOperation,
|
nsIDocument::WarnOnceAbout(DeprecatedOperations aOperation,
|
||||||
bool asError /* = false */)
|
bool asError /* = false */)
|
||||||
{
|
{
|
||||||
PR_STATIC_ASSERT(eDeprecatedOperationCount <= 64);
|
static_assert(eDeprecatedOperationCount <= 64,
|
||||||
|
"Too many deprecated operations");
|
||||||
if (mWarnedAbout & (1ull << aOperation)) {
|
if (mWarnedAbout & (1ull << aOperation)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
@ -167,10 +168,14 @@ nsDOMDataTransfer::SetEffectAllowed(const nsAString& aEffectAllowed)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_NONE == 0);
|
static_assert(nsIDragService::DRAGDROP_ACTION_NONE == 0,
|
||||||
PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_COPY == 1);
|
"DRAGDROP_ACTION_NONE constant is wrong");
|
||||||
PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_MOVE == 2);
|
static_assert(nsIDragService::DRAGDROP_ACTION_COPY == 1,
|
||||||
PR_STATIC_ASSERT(nsIDragService::DRAGDROP_ACTION_LINK == 4);
|
"DRAGDROP_ACTION_COPY constant is wrong");
|
||||||
|
static_assert(nsIDragService::DRAGDROP_ACTION_MOVE == 2,
|
||||||
|
"DRAGDROP_ACTION_MOVE constant is wrong");
|
||||||
|
static_assert(nsIDragService::DRAGDROP_ACTION_LINK == 4,
|
||||||
|
"DRAGDROP_ACTION_LINK constant is wrong");
|
||||||
|
|
||||||
for (uint32_t e = 0; e < ArrayLength(sEffects); e++) {
|
for (uint32_t e = 0; e < ArrayLength(sEffects); e++) {
|
||||||
if (aEffectAllowed.EqualsASCII(sEffects[e])) {
|
if (aEffectAllowed.EqualsASCII(sEffects[e])) {
|
||||||
|
@ -34,7 +34,7 @@ enum FormControlsTypes {
|
|||||||
// Elements with different types, the value is used as a mask.
|
// Elements with different types, the value is used as a mask.
|
||||||
// Adding '_ELEMENT' because NS_FORM_INPUT is used for 'oninput' event.
|
// Adding '_ELEMENT' because NS_FORM_INPUT is used for 'oninput' event.
|
||||||
// When changing the order, adding or removing elements, be sure to update
|
// When changing the order, adding or removing elements, be sure to update
|
||||||
// the PR_STATIC_ASSERT checks accordingly.
|
// the static_assert checks accordingly.
|
||||||
NS_FORM_BUTTON_ELEMENT = 0x40, // 0b01000000
|
NS_FORM_BUTTON_ELEMENT = 0x40, // 0b01000000
|
||||||
NS_FORM_INPUT_ELEMENT = 0x80 // 0b10000000
|
NS_FORM_INPUT_ELEMENT = 0x80 // 0b10000000
|
||||||
};
|
};
|
||||||
@ -69,9 +69,14 @@ enum InputElementTypes {
|
|||||||
eInputElementTypesMax
|
eInputElementTypesMax
|
||||||
};
|
};
|
||||||
|
|
||||||
PR_STATIC_ASSERT((uint32_t)eFormControlsWithoutSubTypesMax < (uint32_t)NS_FORM_BUTTON_ELEMENT);
|
static_assert(static_cast<uint32_t>(eFormControlsWithoutSubTypesMax) <
|
||||||
PR_STATIC_ASSERT((uint32_t)eButtonElementTypesMax < (uint32_t)NS_FORM_INPUT_ELEMENT);
|
static_cast<uint32_t>(NS_FORM_BUTTON_ELEMENT),
|
||||||
PR_STATIC_ASSERT((uint32_t)eInputElementTypesMax < 1<<8);
|
"Too many FormControlsTypes without sub-types");
|
||||||
|
static_assert(static_cast<uint32_t>(eButtonElementTypesMax) <
|
||||||
|
static_cast<uint32_t>(NS_FORM_INPUT_ELEMENT),
|
||||||
|
"Too many ButtonElementTypes");
|
||||||
|
static_assert(static_cast<uint32_t>(eInputElementTypesMax) < 1<<8,
|
||||||
|
"Too many form control types");
|
||||||
|
|
||||||
#define NS_IFORMCONTROL_IID \
|
#define NS_IFORMCONTROL_IID \
|
||||||
{ 0x4b89980c, 0x4dcd, 0x428f, \
|
{ 0x4b89980c, 0x4dcd, 0x428f, \
|
||||||
|
@ -223,7 +223,8 @@ HTMLFrameSetElement::ParseRowCol(const nsAString & aValue,
|
|||||||
spec.Trim(",");
|
spec.Trim(",");
|
||||||
|
|
||||||
// Count the commas. Don't count more than X commas (bug 576447).
|
// Count the commas. Don't count more than X commas (bug 576447).
|
||||||
PR_STATIC_ASSERT(NS_MAX_FRAMESET_SPEC_COUNT * sizeof(nsFramesetSpec) < (1 << 30));
|
static_assert(NS_MAX_FRAMESET_SPEC_COUNT * sizeof(nsFramesetSpec) < (1 << 30),
|
||||||
|
"Too many frameset specs allowed to allocate");
|
||||||
int32_t commaX = spec.FindChar(sComma);
|
int32_t commaX = spec.FindChar(sComma);
|
||||||
int32_t count = 1;
|
int32_t count = 1;
|
||||||
while (commaX != kNotFound && count < NS_MAX_FRAMESET_SPEC_COUNT) {
|
while (commaX != kNotFound && count < NS_MAX_FRAMESET_SPEC_COUNT) {
|
||||||
|
@ -24,9 +24,12 @@ using layers::PlanarYCbCrData;
|
|||||||
|
|
||||||
// Verify these values are sane. Once we've checked the frame sizes, we then
|
// Verify these values are sane. Once we've checked the frame sizes, we then
|
||||||
// can do less integer overflow checking.
|
// can do less integer overflow checking.
|
||||||
PR_STATIC_ASSERT(MAX_VIDEO_WIDTH < PlanarYCbCrImage::MAX_DIMENSION);
|
static_assert(MAX_VIDEO_WIDTH < PlanarYCbCrImage::MAX_DIMENSION,
|
||||||
PR_STATIC_ASSERT(MAX_VIDEO_HEIGHT < PlanarYCbCrImage::MAX_DIMENSION);
|
"MAX_VIDEO_WIDTH is too large");
|
||||||
PR_STATIC_ASSERT(PlanarYCbCrImage::MAX_DIMENSION < UINT32_MAX / PlanarYCbCrImage::MAX_DIMENSION);
|
static_assert(MAX_VIDEO_HEIGHT < PlanarYCbCrImage::MAX_DIMENSION,
|
||||||
|
"MAX_VIDEO_HEIGHT is too large");
|
||||||
|
static_assert(PlanarYCbCrImage::MAX_DIMENSION < UINT32_MAX / PlanarYCbCrImage::MAX_DIMENSION,
|
||||||
|
"MAX_DIMENSION*MAX_DIMENSION doesn't fit in 32 bits");
|
||||||
|
|
||||||
// Un-comment to enable logging of seek bisections.
|
// Un-comment to enable logging of seek bisections.
|
||||||
//#define SEEK_LOGGING
|
//#define SEEK_LOGGING
|
||||||
|
@ -89,7 +89,8 @@ static const int64_t LOW_DATA_THRESHOLD_USECS = 5000000;
|
|||||||
|
|
||||||
// LOW_DATA_THRESHOLD_USECS needs to be greater than AMPLE_AUDIO_USECS, otherwise
|
// LOW_DATA_THRESHOLD_USECS needs to be greater than AMPLE_AUDIO_USECS, otherwise
|
||||||
// the skip-to-keyframe logic can activate when we're running low on data.
|
// the skip-to-keyframe logic can activate when we're running low on data.
|
||||||
PR_STATIC_ASSERT(LOW_DATA_THRESHOLD_USECS > AMPLE_AUDIO_USECS);
|
static_assert(LOW_DATA_THRESHOLD_USECS > AMPLE_AUDIO_USECS,
|
||||||
|
"LOW_DATA_THRESHOLD_USECS is too small");
|
||||||
|
|
||||||
// Amount of excess usecs of data to add in to the "should we buffer" calculation.
|
// Amount of excess usecs of data to add in to the "should we buffer" calculation.
|
||||||
static const uint32_t EXHAUSTED_DATA_MARGIN_USECS = 60000;
|
static const uint32_t EXHAUSTED_DATA_MARGIN_USECS = 60000;
|
||||||
@ -113,7 +114,8 @@ static const uint32_t QUICK_BUFFERING_LOW_DATA_USECS = 1000000;
|
|||||||
// quick buffering in a timely fashion, as the decode pauses when it
|
// quick buffering in a timely fashion, as the decode pauses when it
|
||||||
// reaches AMPLE_AUDIO_USECS decoded data, and thus we'll never reach
|
// reaches AMPLE_AUDIO_USECS decoded data, and thus we'll never reach
|
||||||
// QUICK_BUFFERING_LOW_DATA_USECS.
|
// QUICK_BUFFERING_LOW_DATA_USECS.
|
||||||
PR_STATIC_ASSERT(QUICK_BUFFERING_LOW_DATA_USECS <= AMPLE_AUDIO_USECS);
|
static_assert(QUICK_BUFFERING_LOW_DATA_USECS <= AMPLE_AUDIO_USECS,
|
||||||
|
"QUICK_BUFFERING_LOW_DATA_USECS is too large");
|
||||||
|
|
||||||
// This value has been chosen empirically.
|
// This value has been chosen empirically.
|
||||||
static const uint32_t AUDIOSTREAM_MIN_WRITE_BEFORE_START_USECS = 200000;
|
static const uint32_t AUDIOSTREAM_MIN_WRITE_BEFORE_START_USECS = 200000;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "SVGPathSegUtils.h"
|
#include "SVGPathSegUtils.h"
|
||||||
|
|
||||||
#include "gfx2DGlue.h"
|
#include "gfx2DGlue.h"
|
||||||
|
#include "mozilla/Util.h" // MOZ_ARRAY_LENGTH
|
||||||
#include "nsSVGPathDataParser.h"
|
#include "nsSVGPathDataParser.h"
|
||||||
#include "nsTextFormatter.h"
|
#include "nsTextFormatter.h"
|
||||||
|
|
||||||
@ -20,9 +21,11 @@ static const uint32_t MAX_RECURSION = 10;
|
|||||||
SVGPathSegUtils::GetValueAsString(const float* aSeg, nsAString& aValue)
|
SVGPathSegUtils::GetValueAsString(const float* aSeg, nsAString& aValue)
|
||||||
{
|
{
|
||||||
// Adding new seg type? Is the formatting below acceptable for the new types?
|
// Adding new seg type? Is the formatting below acceptable for the new types?
|
||||||
PR_STATIC_ASSERT(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
|
static_assert(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
|
||||||
PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
|
PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,
|
||||||
PR_STATIC_ASSERT(NS_SVG_PATH_SEG_MAX_ARGS == 7);
|
"Update GetValueAsString for the new value.");
|
||||||
|
static_assert(NS_SVG_PATH_SEG_MAX_ARGS == 7,
|
||||||
|
"Add another case to the switch below.");
|
||||||
|
|
||||||
uint32_t type = DecodeType(aSeg[0]);
|
uint32_t type = DecodeType(aSeg[0]);
|
||||||
PRUnichar typeAsChar = GetPathSegTypeAsLetter(type);
|
PRUnichar typeAsChar = GetPathSegTypeAsLetter(type);
|
||||||
@ -439,8 +442,9 @@ static TraverseFunc gTraverseFuncTable[NS_SVG_PATH_SEG_TYPE_COUNT] = {
|
|||||||
SVGPathSegUtils::TraversePathSegment(const float* aData,
|
SVGPathSegUtils::TraversePathSegment(const float* aData,
|
||||||
SVGPathTraversalState& aState)
|
SVGPathTraversalState& aState)
|
||||||
{
|
{
|
||||||
PR_STATIC_ASSERT(NS_ARRAY_LENGTH(gTraverseFuncTable) ==
|
static_assert(MOZ_ARRAY_LENGTH(gTraverseFuncTable) ==
|
||||||
NS_SVG_PATH_SEG_TYPE_COUNT);
|
NS_SVG_PATH_SEG_TYPE_COUNT,
|
||||||
|
"gTraverseFuncTable is out of date");
|
||||||
uint32_t type = DecodeType(aData[0]);
|
uint32_t type = DecodeType(aData[0]);
|
||||||
gTraverseFuncTable[type](aData + 1, aState);
|
gTraverseFuncTable[type](aData + 1, aState);
|
||||||
}
|
}
|
||||||
|
@ -186,8 +186,9 @@ nsSVGAnimatedTransformList::SMILAnimatedTransformList::ParseValue(
|
|||||||
{
|
{
|
||||||
NS_ABORT_IF_FALSE(aResult.IsNull(), "Unexpected type for SMIL value");
|
NS_ABORT_IF_FALSE(aResult.IsNull(), "Unexpected type for SMIL value");
|
||||||
|
|
||||||
// nsSVGSMILTransform constructor should be expecting array with 3 params
|
static_assert(SVGTransformSMILData::NUM_SIMPLE_PARAMS == 3,
|
||||||
PR_STATIC_ASSERT(SVGTransformSMILData::NUM_SIMPLE_PARAMS == 3);
|
"nsSVGSMILTransform constructor should be expecting array "
|
||||||
|
"with 3 params");
|
||||||
|
|
||||||
float params[3] = { 0.f };
|
float params[3] = { 0.f };
|
||||||
int32_t numParsed = ParseParameterList(aSpec, params, 3);
|
int32_t numParsed = ParseParameterList(aSpec, params, 3);
|
||||||
|
@ -57,7 +57,8 @@ using namespace mozilla::dom;
|
|||||||
// vararg-list methods in this file:
|
// vararg-list methods in this file:
|
||||||
// nsSVGElement::GetAnimated{Length,Number,Integer}Values
|
// nsSVGElement::GetAnimated{Length,Number,Integer}Values
|
||||||
// See bug 547964 for details:
|
// See bug 547964 for details:
|
||||||
PR_STATIC_ASSERT(sizeof(void*) == sizeof(nullptr));
|
static_assert(sizeof(void*) == sizeof(nullptr),
|
||||||
|
"nullptr should be the correct size");
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_NewSVGElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo)
|
NS_NewSVGElement(nsIContent **aResult, already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||||
|
@ -73,7 +73,8 @@ typedef uint8_t XBLBindingSerializeDetails;
|
|||||||
// are no more attributes.
|
// are no more attributes.
|
||||||
#define XBLBinding_Serialize_NoMoreAttributes 0xFF
|
#define XBLBinding_Serialize_NoMoreAttributes 0xFF
|
||||||
|
|
||||||
PR_STATIC_ASSERT(XBLBinding_Serialize_CustomNamespace >= kNameSpaceID_LastBuiltin);
|
static_assert(XBLBinding_Serialize_CustomNamespace >= kNameSpaceID_LastBuiltin,
|
||||||
|
"The custom namespace should not be in use as a real namespace");
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
XBL_SerializeFunction(nsIObjectOutputStream* aStream,
|
XBL_SerializeFunction(nsIObjectOutputStream* aStream,
|
||||||
|
Loading…
Reference in New Issue
Block a user