зеркало из https://github.com/mozilla/gecko-dev.git
Bug 936458 - Use MOZ_ASSERT instead of NS_ABORT_IF_FALSE in BasePoint3D.h and BasePoint4D.h because NS_ABORT_IF_FALSE is not in mfbt and can't be used in standalone moz2d. r=Bas
--HG-- extra : rebase_source : 6ce1149a1c99feb0892a858851350b0e5119fc1a
This commit is contained in:
Родитель
2317b71a7f
Коммит
45f70aba6a
|
@ -6,7 +6,7 @@
|
|||
#ifndef MOZILLA_BASEPOINT3D_H_
|
||||
#define MOZILLA_BASEPOINT3D_H_
|
||||
|
||||
#include "nsDebug.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
@ -31,12 +31,12 @@ struct BasePoint3D {
|
|||
// compiler generated default assignment operator
|
||||
|
||||
T& operator[](int aIndex) {
|
||||
NS_ABORT_IF_FALSE(aIndex >= 0 && aIndex <= 2, "Invalid array index");
|
||||
MOZ_ASSERT(aIndex >= 0 && aIndex <= 2);
|
||||
return *((&x)+aIndex);
|
||||
}
|
||||
|
||||
const T& operator[](int aIndex) const {
|
||||
NS_ABORT_IF_FALSE(aIndex >= 0 && aIndex <= 2, "Invalid array index");
|
||||
MOZ_ASSERT(aIndex >= 0 && aIndex <= 2);
|
||||
return *((&x)+aIndex);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#ifndef MOZILLA_BASEPOINT4D_H_
|
||||
#define MOZILLA_BASEPOINT4D_H_
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
|
@ -86,12 +88,12 @@ struct BasePoint4D {
|
|||
}
|
||||
|
||||
T& operator[](int aIndex) {
|
||||
NS_ABORT_IF_FALSE(aIndex >= 0 && aIndex <= 3, "Invalid array index");
|
||||
MOZ_ASSERT(aIndex >= 0 && aIndex <= 3, "Invalid array index");
|
||||
return *((&x)+aIndex);
|
||||
}
|
||||
|
||||
const T& operator[](int aIndex) const {
|
||||
NS_ABORT_IF_FALSE(aIndex >= 0 && aIndex <= 3, "Invalid array index");
|
||||
MOZ_ASSERT(aIndex >= 0 && aIndex <= 3, "Invalid array index");
|
||||
return *((&x)+aIndex);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче