Imported Upstream version 2.3.1
[platform/upstream/harfbuzz.git] / src / hb-ot-var-mvar-table.hh
index dfde782..0dd63e5 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef HB_OT_VAR_MVAR_TABLE_HH
 #define HB_OT_VAR_MVAR_TABLE_HH
 
-#include "hb-ot-layout-common-private.hh"
+#include "hb-ot-layout-common.hh"
 
 
 namespace OT {
@@ -35,7 +35,7 @@ namespace OT {
 
 struct VariationValueRecord
 {
-  inline bool sanitize (hb_sanitize_context_t *c) const
+  bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this));
@@ -58,9 +58,9 @@ struct VariationValueRecord
 
 struct MVAR
 {
-  static const hb_tag_t tableTag       = HB_OT_TAG_MVAR;
+  static constexpr hb_tag_t tableTag = HB_OT_TAG_MVAR;
 
-  inline bool sanitize (hb_sanitize_context_t *c) const
+  bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
     return_trace (version.sanitize (c) &&
@@ -68,14 +68,16 @@ struct MVAR
                  c->check_struct (this) &&
                  valueRecordSize >= VariationValueRecord::static_size &&
                  varStore.sanitize (c, this) &&
-                 c->check_array (values, valueRecordSize, valueRecordCount));
+                 c->check_range (valuesZ.arrayZ,
+                                 valueRecordCount,
+                                 valueRecordSize));
   }
 
-  inline float get_var (hb_tag_t tag,
-                       int *coords, unsigned int coord_count) const
+  float get_var (hb_tag_t tag,
+                const int *coords, unsigned int coord_count) const
   {
     const VariationValueRecord *record;
-    record = (VariationValueRecord *) bsearch (&tag, values,
+    record = (VariationValueRecord *) bsearch (&tag, valuesZ.arrayZ,
                                               valueRecordCount, valueRecordSize,
                                               tag_compare);
     if (!record)
@@ -85,7 +87,7 @@ struct MVAR
   }
 
 protected:
-  static inline int tag_compare (const void *pa, const void *pb)
+  static int tag_compare (const void *pa, const void *pb)
   {
     const hb_tag_t *a = (const hb_tag_t *) pa;
     const Tag *b = (const Tag *) pb;
@@ -101,11 +103,12 @@ protected:
   HBUINT16     valueRecordCount;/* The number of value records — may be zero. */
   OffsetTo<VariationStore>
                varStore;       /* Offset to item variation store table. */
-  HBUINT8              values[VAR];    /* Array of value records. The records must be
+  UnsizedArrayOf<HBUINT8>
+               valuesZ;        /* Array of value records. The records must be
                                 * in binary order of their valueTag field. */
 
   public:
-  DEFINE_SIZE_ARRAY (12, values);
+  DEFINE_SIZE_ARRAY (12, valuesZ);
 };
 
 } /* namespace OT */