提交 586b6062 编写于 作者: B Behdad Esfahbod

Minor: final bits of cleanup

上级 51d9ba09
......@@ -728,6 +728,7 @@ struct OffsetTo : Offset<OffsetType>
inline bool neuter (hb_sanitize_context_t *c) {
return c->try_set (this, 0);
}
DEFINE_SIZE_STATIC (sizeof(OffsetType));
};
template <typename Base, typename OffsetType, typename Type>
static inline const Type& operator + (const Base &base, const OffsetTo<Type, OffsetType> &offset) { return offset (base); }
......
......@@ -502,7 +502,7 @@ struct Feature
* Adobe tools, only the 'size' feature had FeatureParams defined.
*/
Offset<> orig_offset = featureParams;
OffsetTo<FeatureParams> orig_offset = featureParams;
if (unlikely (!featureParams.sanitize (c, this, closure ? closure->tag : HB_TAG_NONE)))
return TRACE_RETURN (false);
......@@ -516,7 +516,7 @@ struct Feature
unsigned int new_offset_int = (unsigned int) orig_offset -
(((char *) this) - ((char *) closure->list_base));
Offset<> new_offset;
OffsetTo<FeatureParams> new_offset;
/* Check that it did not overflow. */
new_offset.set (new_offset_int);
if (new_offset == new_offset_int &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册