Prefix int types with HB
Such a headache that Windows defines UINT8, ...; Just prefix it.
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index b68568c..29bf7ba 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -643,22 +643,22 @@
DEFINE_SIZE_STATIC (Size);
};
-typedef IntType<uint8_t, 1> UINT8; /* 8-bit unsigned integer. */
-typedef IntType<int8_t, 1> INT8; /* 8-bit signed integer. */
-typedef IntType<uint16_t, 2> UINT16; /* 16-bit unsigned integer. */
-typedef IntType<int16_t, 2> INT16; /* 16-bit signed integer. */
-typedef IntType<uint32_t, 4> UINT32; /* 32-bit unsigned integer. */
-typedef IntType<int32_t, 4> INT32; /* 32-bit signed integer. */
+typedef IntType<uint8_t, 1> HBUINT8; /* 8-bit unsigned integer. */
+typedef IntType<int8_t, 1> HBINT8; /* 8-bit signed integer. */
+typedef IntType<uint16_t, 2> HBUINT16; /* 16-bit unsigned integer. */
+typedef IntType<int16_t, 2> HBINT16; /* 16-bit signed integer. */
+typedef IntType<uint32_t, 4> HBUINT32; /* 32-bit unsigned integer. */
+typedef IntType<int32_t, 4> HBINT32; /* 32-bit signed integer. */
typedef IntType<uint32_t, 3> UINT24; /* 24-bit unsigned integer. */
-/* 16-bit signed integer (INT16) that describes a quantity in FUnits. */
-typedef INT16 FWORD;
+/* 16-bit signed integer (HBINT16) that describes a quantity in FUnits. */
+typedef HBINT16 FWORD;
-/* 16-bit unsigned integer (UINT16) that describes a quantity in FUnits. */
-typedef UINT16 UFWORD;
+/* 16-bit unsigned integer (HBUINT16) that describes a quantity in FUnits. */
+typedef HBUINT16 UFWORD;
/* 16-bit signed fixed number with the low 14 bits of fraction (2.14). */
-struct F2DOT14 : INT16
+struct F2DOT14 : HBINT16
{
//inline float to_float (void) const { return ???; }
//inline void set_float (float f) { v.set (f * ???); }
@@ -667,7 +667,7 @@
};
/* 32-bit signed fixed-point number (16.16). */
-struct Fixed: INT32
+struct Fixed: HBINT32
{
//inline float to_float (void) const { return ???; }
//inline void set_float (float f) { v.set (f * ???); }
@@ -685,15 +685,15 @@
return_trace (likely (c->check_struct (this)));
}
protected:
- INT32 major;
- UINT32 minor;
+ HBINT32 major;
+ HBUINT32 minor;
public:
DEFINE_SIZE_STATIC (8);
};
/* Array of four uint8s (length = 32 bits) used to identify a script, language
* system, feature, or baseline */
-struct Tag : UINT32
+struct Tag : HBUINT32
{
/* What the char* converters return is NOT nul-terminated. Print using "%.4s" */
inline operator const char* (void) const { return reinterpret_cast<const char *> (&this->v); }
@@ -704,10 +704,10 @@
DEFINE_NULL_DATA (Tag, " ");
/* Glyph index number, same as uint16 (length = 16 bits) */
-typedef UINT16 GlyphID;
+typedef HBUINT16 GlyphID;
/* Script/language-system/feature index */
-struct Index : UINT16 {
+struct Index : HBUINT16 {
static const unsigned int NOT_FOUND_INDEX = 0xFFFFu;
};
DEFINE_NULL_DATA (Index, "\xff\xff");
@@ -721,18 +721,18 @@
DEFINE_SIZE_STATIC (sizeof(Type));
};
-typedef Offset<UINT16> Offset16;
-typedef Offset<UINT32> Offset32;
+typedef Offset<HBUINT16> Offset16;
+typedef Offset<HBUINT32> Offset32;
/* CheckSum */
-struct CheckSum : UINT32
+struct CheckSum : HBUINT32
{
/* This is reference implementation from the spec. */
- static inline uint32_t CalcTableChecksum (const UINT32 *Table, uint32_t Length)
+ static inline uint32_t CalcTableChecksum (const HBUINT32 *Table, uint32_t Length)
{
uint32_t Sum = 0L;
- const UINT32 *EndPtr = Table+((Length+3) & ~3) / UINT32::static_size;
+ const HBUINT32 *EndPtr = Table+((Length+3) & ~3) / HBUINT32::static_size;
while (Table < EndPtr)
Sum += *Table++;
@@ -741,7 +741,7 @@
/* Note: data should be 4byte aligned and have 4byte padding at the end. */
inline void set_for_data (const void *data, unsigned int length)
- { set (CalcTableChecksum ((const UINT32 *) data, length)); }
+ { set (CalcTableChecksum ((const HBUINT32 *) data, length)); }
public:
DEFINE_SIZE_STATIC (4);
@@ -752,7 +752,7 @@
* Version Numbers
*/
-template <typename FixedType=UINT16>
+template <typename FixedType=HBUINT16>
struct FixedVersion
{
inline uint32_t to_int (void) const { return (major << (sizeof(FixedType) * 8)) + minor; }
@@ -776,7 +776,7 @@
* Use: (base+offset)
*/
-template <typename Type, typename OffsetType=UINT16>
+template <typename Type, typename OffsetType=HBUINT16>
struct OffsetTo : Offset<OffsetType>
{
inline const Type& operator () (const void *base) const
@@ -821,7 +821,7 @@
}
DEFINE_SIZE_STATIC (sizeof(OffsetType));
};
-template <typename Type> struct LOffsetTo : OffsetTo<Type, UINT32> {};
+template <typename Type> struct LOffsetTo : OffsetTo<Type, HBUINT32> {};
template <typename Base, typename OffsetType, typename Type>
static inline const Type& operator + (const Base &base, const OffsetTo<Type, OffsetType> &offset) { return offset (base); }
template <typename Base, typename OffsetType, typename Type>
@@ -833,7 +833,7 @@
*/
/* An array with a number of elements. */
-template <typename Type, typename LenType=UINT16>
+template <typename Type, typename LenType=HBUINT16>
struct ArrayOf
{
const Type *sub_array (unsigned int start_offset, unsigned int *pcount /* IN/OUT */) const
@@ -943,10 +943,10 @@
public:
DEFINE_SIZE_ARRAY (sizeof (LenType), array);
};
-template <typename Type> struct LArrayOf : ArrayOf<Type, UINT32> {};
+template <typename Type> struct LArrayOf : ArrayOf<Type, HBUINT32> {};
/* Array of Offset's */
-template <typename Type, typename OffsetType=UINT16>
+template <typename Type, typename OffsetType=HBUINT16>
struct OffsetArrayOf : ArrayOf<OffsetTo<Type, OffsetType> > {};
/* Array of offsets relative to the beginning of the array itself. */
@@ -974,7 +974,7 @@
/* An array starting at second element. */
-template <typename Type, typename LenType=UINT16>
+template <typename Type, typename LenType=HBUINT16>
struct HeadlessArrayOf
{
inline const Type& operator [] (unsigned int i) const
@@ -1036,7 +1036,7 @@
/*
* An array with sorted elements. Supports binary searching.
*/
-template <typename Type, typename LenType=UINT16>
+template <typename Type, typename LenType=HBUINT16>
struct SortedArrayOf : ArrayOf<Type, LenType>
{
template <typename SearchType>
@@ -1075,10 +1075,10 @@
}
protected:
- UINT16 len;
- UINT16 searchRangeZ;
- UINT16 entrySelectorZ;
- UINT16 rangeShiftZ;
+ HBUINT16 len;
+ HBUINT16 searchRangeZ;
+ HBUINT16 entrySelectorZ;
+ HBUINT16 rangeShiftZ;
public:
DEFINE_SIZE_STATIC (8);