提交 20b035da 编写于 作者: B Behdad Esfahbod

[HB] Put C++ inline's back

Apparetly in C++, inline means a totally different thing.
上级 a62f776d
......@@ -103,7 +103,7 @@ typedef struct OffsetTable
return get_table (table_index);
}
unsigned int get_face_count (void) const { return 1; }
inline unsigned int get_face_count (void) const { return 1; }
public:
inline bool sanitize (SANITIZE_ARG_DEF, const void *base) {
......@@ -136,14 +136,14 @@ struct TTCHeader
STATIC_DEFINE_GET_FOR_DATA_CHECK_MAJOR_VERSION (TTCHeader, 1, 2);
unsigned int get_face_count (void) const { return table.len; }
inline unsigned int get_face_count (void) const { return table.len; }
const OpenTypeFontFace& get_face (unsigned int i) const
inline const OpenTypeFontFace& get_face (unsigned int i) const
{
return this+table[i];
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (version)) return false;
if (version.major < 1 || version.major > 2) return true;
......@@ -175,7 +175,7 @@ struct OpenTypeFontFile
STATIC_DEFINE_GET_FOR_DATA (OpenTypeFontFile);
unsigned int get_face_count (void) const
inline unsigned int get_face_count (void) const
{
switch (tag) {
default: return 0;
......@@ -183,7 +183,7 @@ struct OpenTypeFontFile
case TTCTag: return TTCHeader::get_for_data (CONST_CHARP(this)).get_face_count ();
}
}
const OpenTypeFontFace& get_face (unsigned int i) const
inline const OpenTypeFontFace& get_face (unsigned int i) const
{
switch (tag) {
default: return Null(OpenTypeFontFace);
......@@ -202,7 +202,7 @@ struct OpenTypeFontFile
return ((const char*) this) + table.offset;
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE_SELF ()) return false;
switch (tag) {
......
......@@ -424,21 +424,21 @@ struct GenericOffsetTo : OffsetType
return CONST_CAST(Type, *CONST_CHARP(base), offset);
}
bool sanitize (SANITIZE_ARG_DEF, const void *base) {
inline bool sanitize (SANITIZE_ARG_DEF, const void *base) {
SANITIZE_DEBUG ();
if (!SANITIZE_OBJ (*this)) return false;
unsigned int offset = *this;
if (HB_UNLIKELY (!offset)) return true;
return SANITIZE (CAST(Type, *DECONST_CHARP(base), offset)) || NEUTER (DECONST_CAST(OffsetType,*this,0), 0);
}
bool sanitize (SANITIZE_ARG_DEF, const void *base, const void *base2) {
inline bool sanitize (SANITIZE_ARG_DEF, const void *base, const void *base2) {
SANITIZE_DEBUG ();
if (!SANITIZE_OBJ (*this)) return false;
unsigned int offset = *this;
if (HB_UNLIKELY (!offset)) return true;
return SANITIZE_BASE (CAST(Type, *DECONST_CHARP(base), offset), base2) || NEUTER (DECONST_CAST(OffsetType,*this,0), 0);
}
bool sanitize (SANITIZE_ARG_DEF, const void *base, unsigned int user_data) {
inline bool sanitize (SANITIZE_ARG_DEF, const void *base, unsigned int user_data) {
SANITIZE_DEBUG ();
if (!SANITIZE_OBJ (*this)) return false;
unsigned int offset = *this;
......@@ -471,7 +471,7 @@ struct GenericArrayOf
inline unsigned int get_size () const
{ return sizeof (len) + len * sizeof (array[0]); }
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE_GET_SIZE()) return false;
/* Note; for non-recursive types, this is not much needed
......@@ -482,7 +482,7 @@ struct GenericArrayOf
*/
return true;
}
bool sanitize (SANITIZE_ARG_DEF, const void *base) {
inline bool sanitize (SANITIZE_ARG_DEF, const void *base) {
SANITIZE_DEBUG ();
if (!SANITIZE_GET_SIZE()) return false;
unsigned int count = len;
......@@ -491,7 +491,7 @@ struct GenericArrayOf
return false;
return true;
}
bool sanitize (SANITIZE_ARG_DEF, const void *base, const void *base2) {
inline bool sanitize (SANITIZE_ARG_DEF, const void *base, const void *base2) {
SANITIZE_DEBUG ();
if (!SANITIZE_GET_SIZE()) return false;
unsigned int count = len;
......@@ -500,7 +500,7 @@ struct GenericArrayOf
return false;
return true;
}
bool sanitize (SANITIZE_ARG_DEF, const void *base, unsigned int user_data) {
inline bool sanitize (SANITIZE_ARG_DEF, const void *base, unsigned int user_data) {
SANITIZE_DEBUG ();
if (!SANITIZE_GET_SIZE()) return false;
unsigned int count = len;
......@@ -547,7 +547,7 @@ struct HeadlessArrayOf
inline unsigned int get_size () const
{ return sizeof (len) + (len ? len - 1 : 0) * sizeof (array[0]); }
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE_GET_SIZE()) return false;
/* Note; for non-recursive types, this is not much needed
......
......@@ -412,7 +412,7 @@ struct Coverage
{
inline unsigned int operator() (hb_codepoint_t glyph_id) const { return get_coverage (glyph_id); }
unsigned int get_coverage (hb_codepoint_t glyph_id) const
inline unsigned int get_coverage (hb_codepoint_t glyph_id) const
{
switch (u.format) {
case 1: return u.format1->get_coverage(glyph_id);
......@@ -421,7 +421,7 @@ struct Coverage
}
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (u.format)) return false;
switch (u.format) {
......@@ -528,7 +528,7 @@ struct ClassDef
{
inline unsigned int operator() (hb_codepoint_t glyph_id) const { return get_class (glyph_id); }
hb_ot_layout_class_t get_class (hb_codepoint_t glyph_id) const
inline hb_ot_layout_class_t get_class (hb_codepoint_t glyph_id) const
{
switch (u.format) {
case 1: return u.format1->get_class(glyph_id);
......@@ -537,7 +537,7 @@ struct ClassDef
}
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (u.format)) return false;
switch (u.format) {
......@@ -565,7 +565,7 @@ struct Device
{
inline int operator() (unsigned int ppem_size) const { return get_delta (ppem_size); }
int get_delta (unsigned int ppem_size) const
inline int get_delta (unsigned int ppem_size) const
{
unsigned int f = deltaFormat;
if (HB_UNLIKELY (f < 1 || f > 3))
......@@ -595,7 +595,7 @@ struct Device
return sizeof (*this) + ((endSize - startSize + (1 << (4 - f)) - 1) >> (4 - f));
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
return SANITIZE_GET_SIZE ();
}
......
......@@ -153,7 +153,7 @@ ASSERT_SIZE (CaretValueFormat3, 6);
struct CaretValue
{
int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const
inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const
{
switch (u.format) {
case 1: return u.format1->get_caret_value (context, glyph_id);
......@@ -335,7 +335,7 @@ struct GDEF
inline bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const
{ return version >= 0x00010002 && (this+markGlyphSetsDef[0]).covers (set_index, glyph_id); }
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (version)) return false;
if (version.major != 1) return true;
......
......@@ -1366,7 +1366,7 @@ struct PosLookupSubTable
Extension = 9,
};
bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
{
switch (lookup_type) {
case Single: return u.single->apply (APPLY_ARG);
......@@ -1382,7 +1382,7 @@ struct PosLookupSubTable
}
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (u.format)) return false;
switch (u.format) {
......@@ -1460,9 +1460,9 @@ struct PosLookup : Lookup
return false;
}
bool apply_string (hb_ot_layout_context_t *context,
hb_buffer_t *buffer,
hb_mask_t mask) const
inline bool apply_string (hb_ot_layout_context_t *context,
hb_buffer_t *buffer,
hb_mask_t mask) const
{
bool ret = false;
......@@ -1527,7 +1527,7 @@ struct GPOS : GSUBGPOS
hb_mask_t mask) const
{ return get_lookup (lookup_index).apply_string (context, buffer, mask); }
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!GSUBGPOS::sanitize (SANITIZE_ARG)) return false;
OffsetTo<PosLookupList> &list = CAST(OffsetTo<PosLookupList>, lookupList, 0);
......
......@@ -678,7 +678,7 @@ struct SubstLookupSubTable
ReverseChainSingle = 8,
};
bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
{
switch (lookup_type) {
case Single: return u.single->apply (APPLY_ARG);
......@@ -693,7 +693,7 @@ struct SubstLookupSubTable
}
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (u.format)) return false;
switch (u.format) {
......@@ -773,9 +773,9 @@ struct SubstLookup : Lookup
return false;
}
bool apply_string (hb_ot_layout_context_t *context,
hb_buffer_t *buffer,
hb_mask_t mask) const
inline bool apply_string (hb_ot_layout_context_t *context,
hb_buffer_t *buffer,
hb_mask_t mask) const
{
bool ret = false;
......@@ -853,7 +853,7 @@ struct GSUB : GSUBGPOS
{ return get_lookup (lookup_index).apply_string (context, buffer, mask); }
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!GSUBGPOS::sanitize (SANITIZE_ARG)) return false;
OffsetTo<SubstLookupList> &list = CAST(OffsetTo<SubstLookupList>, lookupList, 0);
......
......@@ -439,7 +439,7 @@ ASSERT_SIZE (ContextFormat3, 6);
struct Context
{
protected:
bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG, apply_func);
......@@ -449,7 +449,7 @@ struct Context
}
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (u.format)) return false;
switch (u.format) {
......@@ -746,7 +746,7 @@ ASSERT_SIZE (ChainContextFormat3, 10);
struct ChainContext
{
protected:
bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
inline bool apply (APPLY_ARG_DEF, apply_lookup_func_t apply_func) const
{
switch (u.format) {
case 1: return u.format1->apply (APPLY_ARG, apply_func);
......@@ -756,7 +756,7 @@ struct ChainContext
}
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (u.format)) return false;
switch (u.format) {
......@@ -826,7 +826,7 @@ struct Extension
}
}
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (u.format)) return false;
switch (u.format) {
......@@ -884,7 +884,7 @@ struct GSUBGPOS
inline const Lookup& get_lookup (unsigned int i) const
{ return (this+lookupList)[i]; }
bool sanitize (SANITIZE_ARG_DEF) {
inline bool sanitize (SANITIZE_ARG_DEF) {
SANITIZE_DEBUG ();
if (!SANITIZE (version)) return false;
if (version.major != 1) return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册