[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Nov 9 15:02:19 UTC 2018


 src/hb-set.hh    |    4 ++--
 src/hb-vector.hh |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5f97fe9956274d9de4e7813d7f2e850d9ffd8224
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Nov 9 10:01:50 2018 -0500

    Fix a few MSVC 2008 warnings
    
    https://github.com/harfbuzz/harfbuzz/issues/1374

diff --git a/src/hb-set.hh b/src/hb-set.hh
index 21a22525..c47f77b7 100644
--- a/src/hb-set.hh
+++ b/src/hb-set.hh
@@ -375,8 +375,8 @@ struct hb_set_t
     if (!resize (count))
       return;
     population = other->population;
-    memcpy (pages, other->pages, count * sizeof (pages[0]));
-    memcpy (page_map, other->page_map, count * sizeof (page_map[0]));
+    memcpy (pages, other->pages, count * pages.item_size);
+    memcpy (page_map, other->page_map, count * page_map.item_size);
   }
 
   inline bool is_equal (const hb_set_t *other) const
diff --git a/src/hb-vector.hh b/src/hb-vector.hh
index fe06addf..7056a5b5 100644
--- a/src/hb-vector.hh
+++ b/src/hb-vector.hh
@@ -34,6 +34,9 @@
 template <typename Type, unsigned int StaticSize=8>
 struct hb_vector_t
 {
+  typedef Type ItemType;
+  enum { item_size = sizeof (Type) };
+
   HB_NO_COPY_ASSIGN_TEMPLATE2 (hb_vector_t, Type, StaticSize);
   inline hb_vector_t (void) { init (); }
   inline ~hb_vector_t (void) { fini (); }


More information about the HarfBuzz mailing list