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:
Markus Stange 2013-11-20 17:20:50 +01:00
Родитель 2317b71a7f
Коммит 45f70aba6a
2 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -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);
}