src/java.desktop/share/native/libfontmanager/harfbuzz/hb-iter.hh
author jiefu
Fri, 15 Nov 2019 20:39:26 +0800
changeset 59110 8c4c358272a9
parent 54232 7c11a7cc7c1d
permissions -rw-r--r--
8234232: [TESTBUG] gc/shenandoah/jvmti/TestHeapDump.java fails with -Xcomp Reviewed-by: zgu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54232
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     1
/*
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     2
 * Copyright © 2018  Google, Inc.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     3
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     4
 *  This is part of HarfBuzz, a text shaping library.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     5
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     6
 * Permission is hereby granted, without written agreement and without
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     7
 * license or royalty fees, to use, copy, modify, and distribute this
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     8
 * software and its documentation for any purpose, provided that the
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
     9
 * above copyright notice and the following two paragraphs appear in
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    10
 * all copies of this software.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    11
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    12
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    13
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    14
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    15
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    16
 * DAMAGE.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    17
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    18
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    19
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    20
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    21
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    22
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    23
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    24
 * Google Author(s): Behdad Esfahbod
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    25
 */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    26
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    27
#ifndef HB_ITER_HH
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    28
#define HB_ITER_HH
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    29
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    30
#include "hb.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    31
#include "hb-null.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    32
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    33
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    34
/* Unified iterator object.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    35
 *
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    36
 * The goal of this template is to make the same iterator interface
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    37
 * available to all types, and make it very easy and compact to use.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    38
 * hb_iter_tator objects are small, light-weight, objects that can be
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    39
 * copied by value.  If the collection / object being iterated on
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    40
 * is writable, then the iterator returns lvalues, otherwise it
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    41
 * returns rvalues.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    42
 */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    43
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    44
/* Base class for all iterators. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    45
template <typename Iter, typename Item = typename Iter::__item_type__>
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    46
struct hb_iter_t
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    47
{
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    48
  typedef Iter iter_t;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    49
  typedef iter_t const_iter_t;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    50
  typedef Item item_t;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    51
  static constexpr unsigned item_size = hb_static_size (Item);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    52
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    53
  private:
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    54
  /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    55
  const iter_t* thiz () const { return static_cast<const iter_t *> (this); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    56
        iter_t* thiz ()       { return static_cast<      iter_t *> (this); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    57
  public:
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    58
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    59
  /* Operators. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    60
  operator iter_t () { return iter(); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    61
  explicit_operator bool () const { return more (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    62
  item_t& operator * () const { return item (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    63
  item_t& operator [] (signed i) const { return item_at ((unsigned) i); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    64
  iter_t& operator += (unsigned count) { forward (count); return *thiz(); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    65
  iter_t& operator ++ () { next (); return *thiz(); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    66
  iter_t& operator -= (unsigned count) { rewind (count); return *thiz(); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    67
  iter_t& operator -- () { prev (); return *thiz(); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    68
  iter_t operator + (unsigned count) { iter_t c (*thiz()); c += count; return c; }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    69
  iter_t operator ++ (int) { iter_t c (*thiz()); ++*thiz(); return c; }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    70
  iter_t operator - (unsigned count) { iter_t c (*thiz()); c -= count; return c; }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    71
  iter_t operator -- (int) { iter_t c (*thiz()); --*thiz(); return c; }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    72
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    73
  /* Methods. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    74
  iter_t iter () const { return *thiz(); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    75
  const_iter_t const_iter () const { return iter (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    76
  item_t& item () const { return thiz()->__item__ (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    77
  item_t& item_at (unsigned i) const { return thiz()->__item_at__ (i); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    78
  bool more () const { return thiz()->__more__ (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    79
  unsigned len () const { return thiz()->__len__ (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    80
  void next () { thiz()->__next__ (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    81
  void forward (unsigned n) { thiz()->__forward__ (n); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    82
  void prev () { thiz()->__prev__ (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    83
  void rewind (unsigned n) { thiz()->__rewind__ (n); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    84
  bool random_access () const { return thiz()->__random_access__ (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    85
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    86
  protected:
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    87
  hb_iter_t () {}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    88
  hb_iter_t (const hb_iter_t &o HB_UNUSED) {}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    89
  void operator = (const hb_iter_t &o HB_UNUSED) {}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    90
};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    91
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    92
/* Base class for sorted iterators.  Does not enforce anything.
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    93
 * Just for class taxonomy and requirements. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    94
template <typename Iter, typename Item = typename Iter::__item_type__>
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    95
struct hb_sorted_iter_t : hb_iter_t<Iter, Item>
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    96
{
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    97
  protected:
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    98
  hb_sorted_iter_t () {}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
    99
  hb_sorted_iter_t (const hb_sorted_iter_t &o) : hb_iter_t<Iter, Item> (o) {}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   100
  void operator = (const hb_sorted_iter_t &o HB_UNUSED) {}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   101
};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   102
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   103
/* Mixin to fill in what the subclass doesn't provide. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   104
template <typename iter_t, typename item_t = typename iter_t::__item_type__>
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   105
struct hb_iter_mixin_t
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   106
{
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   107
  private:
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   108
  /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   109
  const iter_t* thiz () const { return static_cast<const iter_t *> (this); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   110
        iter_t* thiz ()       { return static_cast<      iter_t *> (this); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   111
  public:
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   112
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   113
  /* Access: Implement __item__(), or __item_at__() if random-access. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   114
  item_t& __item__ () const { return thiz()->item_at (0); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   115
  item_t& __item_at__ (unsigned i) const { return *(thiz() + i); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   116
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   117
  /* Termination: Implement __more__(), or __len__() if random-access. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   118
  bool __more__ () const { return thiz()->__len__ (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   119
  unsigned __len__ () const
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   120
  { iter_t c (*thiz()); unsigned l = 0; while (c) { c++; l++; }; return l; }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   121
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   122
  /* Advancing: Implement __next__(), or __forward__() if random-access. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   123
  void __next__ () { thiz()->forward (1); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   124
  void __forward__ (unsigned n) { while (n--) thiz()->next (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   125
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   126
  /* Rewinding: Implement __prev__() or __rewind__() if bidirectional. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   127
  void __prev__ () { thiz()->rewind (1); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   128
  void __rewind__ (unsigned n) { while (n--) thiz()->prev (); }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   129
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   130
  /* Random access: Return true if item_at(), len(), forward() are fast. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   131
  bool __random_access__ () const { return false; }
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   132
};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   133
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   134
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   135
/* Functions operating on iterators or iteratables. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   136
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   137
template <typename C, typename V> inline void
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   138
hb_fill (const C& c, const V &v)
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   139
{
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   140
  for (typename C::iter_t i (c); i; i++)
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   141
    hb_assign (*i, v);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   142
}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   143
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   144
template <typename S, typename D> inline bool
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   145
hb_copy (hb_iter_t<D> &id, hb_iter_t<S> &is)
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   146
{
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   147
  for (; id && is; ++id, ++is)
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   148
    *id = *is;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   149
  return !is;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   150
}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   151
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   152
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents:
diff changeset
   153
#endif /* HB_ITER_HH */