diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index 16729d16f..c2c50bbb7 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -55,7 +55,7 @@ struct TrackTableEntry unsigned int index, unsigned int nSizes) const { - return hb_array_t ((base+valuesZ).arrayZ, nSizes)[index]; + return hb_array_t ((base+valuesZ).arrayZ, nSizes)[index]; } public: @@ -88,7 +88,7 @@ struct TrackData const void *base) const { unsigned int sizes = nSizes; - hb_array_t size_table ((base+sizeTable).arrayZ, sizes); + hb_array_t size_table ((base+sizeTable).arrayZ, sizes); float s0 = size_table[idx].to_float (); float s1 = size_table[idx + 1].to_float (); @@ -134,7 +134,7 @@ struct TrackData if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes); /* TODO bfind() */ - hb_array_t size_table ((base+sizeTable).arrayZ, sizes); + hb_array_t size_table ((base+sizeTable).arrayZ, sizes); unsigned int size_index; for (size_index = 0; size_index < sizes - 1; size_index++) if (size_table[size_index].to_float () >= csspx) diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index 7e1b7eb1b..27c1a96ef 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -513,9 +513,9 @@ template struct hb_array_t { inline hb_array_t (void) : arrayZ (nullptr), len (0) {} - inline hb_array_t (const T *array_, unsigned int len_) : arrayZ (array_), len (len_) {} + inline hb_array_t (T *array_, unsigned int len_) : arrayZ (array_), len (len_) {} - inline const T& operator [] (unsigned int i) const + inline T& operator [] (unsigned int i) const { if (unlikely (i >= len)) return Null(T); return arrayZ[i]; @@ -534,7 +534,7 @@ struct hb_array_t inline void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } - const T *arrayZ; + T *arrayZ; unsigned int len; }; diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh index 817791ab0..a973455d7 100644 --- a/src/hb-open-file.hh +++ b/src/hb-open-file.hh @@ -330,8 +330,8 @@ struct ResourceTypeRecord inline const ResourceRecord& get_resource_record (unsigned int i, const void *type_base) const { - return hb_array_t ((type_base+resourcesZ).arrayZ, - get_resource_count ()) [i]; + return hb_array_t ((type_base+resourcesZ).arrayZ, + get_resource_count ()) [i]; } inline bool sanitize (hb_sanitize_context_t *c,