Bug 928054 - Remove the prtypes.h #include from SVGPathSegUtils.h; rs=bsmedberg

--HG--
extra : rebase_source : 874584d4f67570dcfd2fd120a89688cbd29b4330
This commit is contained in:
Ehsan Akhgari 2013-10-18 20:34:57 -04:00
parent 53aeaafe01
commit 2443904efc

View File

@ -9,7 +9,6 @@
#include "gfxPoint.h"
#include "nsDebug.h"
#include "nsMemory.h"
#include "prtypes.h"
namespace mozilla {
@ -113,13 +112,13 @@ public:
* can simply do a bitwise uint32_t<->float copy.
*/
static float EncodeType(uint32_t aType) {
PR_STATIC_ASSERT(sizeof(uint32_t) == sizeof(float));
static_assert(sizeof(uint32_t) == sizeof(float), "sizeof uint32_t and float must be the same");
NS_ABORT_IF_FALSE(IsValidType(aType), "Seg type not recognized");
return *(reinterpret_cast<float*>(&aType));
}
static uint32_t DecodeType(float aType) {
PR_STATIC_ASSERT(sizeof(uint32_t) == sizeof(float));
static_assert(sizeof(uint32_t) == sizeof(float), "sizeof uint32_t and float must be the same");
uint32_t type = *(reinterpret_cast<uint32_t*>(&aType));
NS_ABORT_IF_FALSE(IsValidType(type), "Seg type not recognized");
return type;
@ -150,7 +149,7 @@ public:
PRUnichar('T'), // 18 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
PRUnichar('t') // 19 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
};
PR_STATIC_ASSERT(NS_ARRAY_LENGTH(table) == NS_SVG_PATH_SEG_TYPE_COUNT);
static_assert(NS_ARRAY_LENGTH(table) == NS_SVG_PATH_SEG_TYPE_COUNT, "Unexpected table size");
return table[aType];
}
@ -180,7 +179,7 @@ public:
2, // 18 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
2 // 19 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
};
PR_STATIC_ASSERT(NS_ARRAY_LENGTH(table) == NS_SVG_PATH_SEG_TYPE_COUNT);
static_assert(NS_ARRAY_LENGTH(table) == NS_SVG_PATH_SEG_TYPE_COUNT, "Unexpected table size");
return table[aType];
}
@ -222,8 +221,8 @@ public:
// When adding a new path segment type, ensure that the returned condition
// below is still correct.
PR_STATIC_ASSERT(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
static_assert(NS_SVG_PATH_SEG_LAST_VALID_TYPE == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,
"Unexpected type");
return aType >= PATHSEG_MOVETO_ABS;
}
@ -235,8 +234,8 @@ public:
// When adding a new path segment type, ensure that the returned condition
// below is still correct.
PR_STATIC_ASSERT(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
static_assert(NS_SVG_PATH_SEG_LAST_VALID_TYPE == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,
"Unexpected type");
return aType & 1;
}
@ -248,8 +247,8 @@ public:
// When adding a new path segment type, ensure that the returned condition
// below is still correct.
PR_STATIC_ASSERT(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL);
static_assert(NS_SVG_PATH_SEG_LAST_VALID_TYPE == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,
"Unexpected type");
return aType | 1;
}