[layout] Add large_int to Types
This commit is contained in:
parent
bababe1072
commit
02ca025443
|
@ -67,10 +67,10 @@ struct CoverageFormat2_4
|
||||||
|
|
||||||
unsigned get_population () const
|
unsigned get_population () const
|
||||||
{
|
{
|
||||||
unsigned ret = 0;
|
typename Types::large_int ret = 0;
|
||||||
for (const auto &r : rangeRecord)
|
for (const auto &r : rangeRecord)
|
||||||
ret += r.get_population (); // TODO Overflow
|
ret += r.get_population ();
|
||||||
return ret;
|
return ret > UINT_MAX ? UINT_MAX : (unsigned) ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Iterator,
|
template <typename Iterator,
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace Layout {
|
||||||
|
|
||||||
struct SmallTypes {
|
struct SmallTypes {
|
||||||
static constexpr unsigned size = 2;
|
static constexpr unsigned size = 2;
|
||||||
|
using large_int = uint32_t;
|
||||||
using HBUINT = HBUINT16;
|
using HBUINT = HBUINT16;
|
||||||
using HBGlyphID = HBGlyphID16;
|
using HBGlyphID = HBGlyphID16;
|
||||||
using Offset = Offset16;
|
using Offset = Offset16;
|
||||||
|
@ -47,6 +48,7 @@ struct SmallTypes {
|
||||||
|
|
||||||
struct MediumTypes {
|
struct MediumTypes {
|
||||||
static constexpr unsigned size = 3;
|
static constexpr unsigned size = 3;
|
||||||
|
using large_int = uint64_t;
|
||||||
using HBUINT = HBUINT24;
|
using HBUINT = HBUINT24;
|
||||||
using HBGlyphID = HBGlyphID24;
|
using HBGlyphID = HBGlyphID24;
|
||||||
using Offset = Offset24;
|
using Offset = Offset24;
|
||||||
|
|
Loading…
Reference in New Issue