Silence Codacy
authorMichiharu Ariza <ariza@adobe.com>
Mon, 6 Aug 2018 17:44:12 +0000 (10:44 -0700)
committerMichiharu Ariza <ariza@adobe.com>
Mon, 6 Aug 2018 17:44:12 +0000 (10:44 -0700)
build/CMakeCache.txt [new file with mode: 0644]
src/hb-subset-cff-common-private.cc
src/hb-subset-cff2.cc

diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
index 29ec15b..c332a5a 100644 (file)
@@ -76,7 +76,8 @@ hb_plan_subset_cff_fdselect (const hb_vector_t<hb_codepoint_t> &glyphs,
       }
     }
 
-    if (set->get_population () == fdCount)
+    subset_fd_count = set->get_population ();
+    if (subset_fd_count == fdCount)
     {
       /* all font dicts belong to the subset. no need to subset FDSelect & FDArray */
       hb_set_destroy (set);
@@ -88,9 +89,10 @@ hb_plan_subset_cff_fdselect (const hb_vector_t<hb_codepoint_t> &glyphs,
     for (unsigned int i = 0; i < fdmap.len; i++)
       fdmap[i] = HB_SET_VALUE_INVALID;
     hb_codepoint_t  fd = HB_SET_VALUE_INVALID;
+    unsigned int fdindex = 0;
     while (set->next (&fd))
-      fdmap[fd] = subset_fd_count++;
-    assert (subset_fd_count == set->get_population ());
+      fdmap[fd] = fdindex++;
+    assert (fdindex == subset_fd_count);
     hb_set_destroy (set);
   }
 
index a2f1a89..49a79c3 100644 (file)
@@ -146,7 +146,9 @@ struct CFF2PrivateDict_OpSerializer : OpSerializer
 struct subset_plan {
   inline subset_plan (void)
     : final_size (0),
-      subst_fdcount(1)
+      orig_fdcount (0),
+      subst_fdcount(1),
+      subst_fdselect_format (0)
   {
     subst_fdselect_first_glyphs.init ();
     fdmap.init ();