mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 928054 - Remove the prtypes.h #include from SVGPathSegUtils.h; rs=bsmedberg
--HG-- extra : rebase_source : 874584d4f67570dcfd2fd120a89688cbd29b4330
This commit is contained in:
parent
53aeaafe01
commit
2443904efc
@ -9,7 +9,6 @@
|
|||||||
#include "gfxPoint.h"
|
#include "gfxPoint.h"
|
||||||
#include "nsDebug.h"
|
#include "nsDebug.h"
|
||||||
#include "nsMemory.h"
|
#include "nsMemory.h"
|
||||||
#include "prtypes.h"
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
@ -113,13 +112,13 @@ public:
|
|||||||
* can simply do a bitwise uint32_t<->float copy.
|
* can simply do a bitwise uint32_t<->float copy.
|
||||||
*/
|
*/
|
||||||
static float EncodeType(uint32_t aType) {
|
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");
|
NS_ABORT_IF_FALSE(IsValidType(aType), "Seg type not recognized");
|
||||||
return *(reinterpret_cast<float*>(&aType));
|
return *(reinterpret_cast<float*>(&aType));
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t DecodeType(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));
|
uint32_t type = *(reinterpret_cast<uint32_t*>(&aType));
|
||||||
NS_ABORT_IF_FALSE(IsValidType(type), "Seg type not recognized");
|
NS_ABORT_IF_FALSE(IsValidType(type), "Seg type not recognized");
|
||||||
return type;
|
return type;
|
||||||
@ -150,7 +149,7 @@ public:
|
|||||||
PRUnichar('T'), // 18 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
|
PRUnichar('T'), // 18 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
|
||||||
PRUnichar('t') // 19 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
|
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];
|
return table[aType];
|
||||||
}
|
}
|
||||||
@ -180,7 +179,7 @@ public:
|
|||||||
2, // 18 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
|
2, // 18 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
|
||||||
2 // 19 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
|
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];
|
return table[aType];
|
||||||
}
|
}
|
||||||
@ -222,8 +221,8 @@ public:
|
|||||||
|
|
||||||
// When adding a new path segment type, ensure that the returned condition
|
// When adding a new path segment type, ensure that the returned condition
|
||||||
// below is still correct.
|
// below is still correct.
|
||||||
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);
|
"Unexpected type");
|
||||||
|
|
||||||
return aType >= PATHSEG_MOVETO_ABS;
|
return aType >= PATHSEG_MOVETO_ABS;
|
||||||
}
|
}
|
||||||
@ -235,8 +234,8 @@ public:
|
|||||||
|
|
||||||
// When adding a new path segment type, ensure that the returned condition
|
// When adding a new path segment type, ensure that the returned condition
|
||||||
// below is still correct.
|
// below is still correct.
|
||||||
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);
|
"Unexpected type");
|
||||||
|
|
||||||
return aType & 1;
|
return aType & 1;
|
||||||
}
|
}
|
||||||
@ -248,8 +247,8 @@ public:
|
|||||||
|
|
||||||
// When adding a new path segment type, ensure that the returned condition
|
// When adding a new path segment type, ensure that the returned condition
|
||||||
// below is still correct.
|
// below is still correct.
|
||||||
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);
|
"Unexpected type");
|
||||||
|
|
||||||
return aType | 1;
|
return aType | 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user