Make compiler happy with -Og
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 8 May 2019 19:01:55 +0000 (12:01 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 8 May 2019 19:10:00 +0000 (12:10 -0700)
src/hb-cff-interp-cs-common.hh
src/hb-ot-cmap-table.hh
src/hb-ot-glyf-table.hh
src/hb-subset-glyf.cc

index 71bc292..2f892f8 100644 (file)
@@ -160,7 +160,7 @@ struct cs_interp_env_t : interp_env_t<ARG>
 
   void callSubr (const biased_subrs_t<SUBRS>& biasedSubrs, cs_type_t type)
   {
-    unsigned int subr_num;
+    unsigned int subr_num = 0;
 
     if (unlikely (!popSubrNum (biasedSubrs, subr_num)
                 || callStack.get_count () >= kMaxCallLimit))
index b4c8c60..cec78d7 100644 (file)
@@ -142,7 +142,7 @@ struct CmapSubtableFormat4
        for (unsigned int j = 0; j < num_codepoints; j++)
        {
          hb_codepoint_t cp = segments[i].start_code + j;
-         hb_codepoint_t new_gid;
+         hb_codepoint_t new_gid = 0;
          if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid)))
            return_trace (false);
          glyph_id_array[j] = new_gid;
@@ -183,7 +183,7 @@ struct CmapSubtableFormat4
 
     hb_codepoint_t cp = HB_SET_VALUE_INVALID;
     while (plan->unicodes->next (&cp)) {
-      hb_codepoint_t new_gid;
+      hb_codepoint_t new_gid = 0;
       if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid)))
       {
        DEBUG_MSG(SUBSET, nullptr, "Unable to find new gid for %04x", cp);
@@ -542,7 +542,7 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented<CmapSubtableFormat12>
 
     hb_codepoint_t cp = HB_SET_VALUE_INVALID;
     while (plan->unicodes->next (&cp)) {
-      hb_codepoint_t new_gid;
+      hb_codepoint_t new_gid = 0;
       if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid)))
       {
        DEBUG_MSG(SUBSET, nullptr, "Unable to find new gid for %04x", cp);
index 2a96c2e..f7629ec 100644 (file)
@@ -283,7 +283,7 @@ struct glyf
 
     /* based on FontTools _g_l_y_f.py::trim */
     bool remove_padding (unsigned int start_offset,
-                               unsigned int *end_offset) const
+                        unsigned int *end_offset) const
     {
       if (*end_offset - start_offset < GlyphHeader::static_size) return true;
 
index d402331..0647ee4 100644 (file)
@@ -108,7 +108,7 @@ _calculate_glyf_and_loca_prime_size (const OT::glyf::accelerator_t &glyf,
   hb_codepoint_t next_glyph = HB_SET_VALUE_INVALID;
   while (plan->glyphset ()->next (&next_glyph))
   {
-    unsigned int start_offset, end_offset;
+    unsigned int start_offset = 0, end_offset = 0;
     if (unlikely (!(glyf.get_offsets (next_glyph, &start_offset, &end_offset) &&
                    glyf.remove_padding (start_offset, &end_offset))))
     {
@@ -211,7 +211,7 @@ _write_glyf_and_loca_prime (const hb_subset_plan_t        *plan,
     }
 
 
-    unsigned int start_offset, end_offset;
+    unsigned int start_offset = 0, end_offset = 0;
     if (unlikely (!(glyf.get_offsets (old_gid, &start_offset, &end_offset) &&
                    glyf.remove_padding (start_offset, &end_offset))))
       end_offset = start_offset = 0;