From 9fae33b9f3fd7fce816c3db71089db4ce0c82d4c Mon Sep 17 00:00:00 2001
From: Michiharu Ariza <ariza@adobe.com>
Date: Mon, 6 Aug 2018 10:44:12 -0700
Subject: [PATCH] Silence Codacy

---
 build/CMakeCache.txt                | 1 +
 src/hb-subset-cff-common-private.cc | 8 +++++---
 src/hb-subset-cff2.cc               | 4 +++-
 3 files changed, 9 insertions(+), 4 deletions(-)
 create mode 100644 build/CMakeCache.txt

diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/build/CMakeCache.txt
@@ -0,0 +1 @@
+
diff --git a/src/hb-subset-cff-common-private.cc b/src/hb-subset-cff-common-private.cc
index 29ec15b44..c332a5a5f 100644
--- a/src/hb-subset-cff-common-private.cc
+++ b/src/hb-subset-cff-common-private.cc
@@ -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);
   }
 
diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc
index a2f1a8993..49a79c3dd 100644
--- a/src/hb-subset-cff2.cc
+++ b/src/hb-subset-cff2.cc
@@ -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 ();