提交 0394ec1b 编写于 作者: B Behdad Esfahbod

Minor: Introduce GenericOffset

上级 0d1b3419
...@@ -630,21 +630,17 @@ struct Index : USHORT { ...@@ -630,21 +630,17 @@ struct Index : USHORT {
}; };
DEFINE_NULL_DATA (Index, "\xff\xff"); DEFINE_NULL_DATA (Index, "\xff\xff");
/* Offset to a table, same as uint16 (length = 16 bits), Null offset = 0x0000 */ /* GenericOffset, Null offset = 0 */
struct Offset : USHORT template <typename Type>
struct GenericOffset : Type
{ {
inline bool is_null (void) const { return 0 == *this; } inline bool is_null (void) const { return 0 == *this; }
public: public:
DEFINE_SIZE_STATIC (2); DEFINE_SIZE_STATIC (sizeof(Type));
}; };
/* LongOffset to a table, same as uint32 (length = 32 bits), Null offset = 0x00000000 */ typedef GenericOffset<USHORT> Offset;
struct LongOffset : ULONG typedef GenericOffset<ULONG> LongOffset;
{
inline bool is_null (void) const { return 0 == *this; }
public:
DEFINE_SIZE_STATIC (4);
};
/* CheckSum */ /* CheckSum */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册