From: Behdad Esfahbod Date: Mon, 17 Dec 2018 04:38:51 +0000 (-0500) Subject: [arrays] Move Supplier<> to hb-array.hh X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92680361ec68734ad38e2158626feebaf18eec88;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [arrays] Move Supplier<> to hb-array.hh --- diff --git a/src/hb-array.hh b/src/hb-array.hh index 0e99b07..83211aa 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -222,4 +222,37 @@ inline hb_sorted_array_t hb_sorted_array (T *array, unsigned int len) typedef hb_array_t hb_bytes_t; +/* + * Supplier + */ + +template +struct Supplier : hb_array_t +{ + Supplier (const Type *array, unsigned int len_) + { + this->arrayZ = array; + this->len = len_; + } + Supplier (hb_array_t v) + { + this->arrayZ = v.arrayZ; + this->len = v.len; + } + + Supplier & operator += (unsigned int count) + { + if (unlikely (count > this->len)) + count = this->len; + this->len -= count; + this->arrayZ += count; + return *this; + } + + private: + Supplier (const Supplier &); /* Disallow copy */ + Supplier& operator= (const Supplier &); /* Disallow copy */ +}; + + #endif /* HB_ARRAY_HH */ diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index 94eabeb..82144db 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -637,38 +637,6 @@ struct hb_serialize_context_t }; -/* - * Supplier - */ - -template -struct Supplier : hb_array_t -{ - Supplier (const Type *array, unsigned int len_) - { - this->arrayZ = array; - this->len = len_; - } - Supplier (hb_array_t v) - { - this->arrayZ = v.arrayZ; - this->len = v.len; - } - - Supplier & operator += (unsigned int count) - { - if (unlikely (count > this->len)) - count = this->len; - this->len -= count; - this->arrayZ += count; - return *this; - } - - private: - Supplier (const Supplier &); /* Disallow copy */ - Supplier& operator= (const Supplier &); /* Disallow copy */ -}; - /* * Big-endian integers.