提交 0299b450 编写于 作者: B Behdad Esfahbod

Make BYTE a real type

上级 ed6962c7
......@@ -535,6 +535,20 @@ struct Supplier
template <typename Type, int Bytes> struct BEInt;
template <typename Type>
struct BEInt<Type, 1>
{
public:
inline void set (Type V)
{
v = V;
}
inline operator Type (void) const
{
return v;
}
private: uint8_t v;
};
template <typename Type>
struct BEInt<Type, 2>
{
......@@ -618,7 +632,7 @@ struct IntType
DEFINE_SIZE_STATIC (Size);
};
typedef uint8_t BYTE; /* 8-bit unsigned integer. */
typedef IntType<uint8_t , 1> BYTE; /* 8-bit unsigned integer. */
typedef IntType<uint16_t, 2> USHORT; /* 16-bit unsigned integer. */
typedef IntType<int16_t, 2> SHORT; /* 16-bit signed integer. */
typedef IntType<uint32_t, 4> ULONG; /* 32-bit unsigned integer. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册