Replace Supplier.advance with Supplier::operator+=
authorBehdad Esfahbod <behdad@behdad.org>
Sat, 10 Feb 2018 19:15:57 +0000 (13:15 -0600)
committerBehdad Esfahbod <behdad@behdad.org>
Sat, 10 Feb 2018 19:15:57 +0000 (13:15 -0600)
src/hb-open-file-private.hh
src/hb-open-type-private.hh
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-gsub-table.hh

index ab168ab8700b1fd8b9246bff8fb18ed216dc8677..3939905206c3cce1005d7f108238935005027a18 100644 (file)
@@ -151,8 +151,8 @@ typedef struct OffsetTable
       if (rec.length % 4)
        p = c->allocate_size<void> (4 - rec.length % 4);
     }
-    tags.advance (table_count);
-    blobs.advance (table_count);
+    tags += table_count;
+    blobs += table_count;
 
     /* TODO: update head table checkSumAdjustment. */
 
index 3a8f738bc07601a22422196bcab5e84cd63ab76b..ef49ea9127bb6e636d79f9e34eccd578930d3453 100644 (file)
@@ -511,12 +511,13 @@ struct Supplier
     return * (const Type *) (const void *) ((const char *) head + stride * i);
   }
 
-  inline void advance (unsigned int count)
+  inline Supplier<Type> & operator += (unsigned int count)
   {
     if (unlikely (count > len))
       count = len;
     len -= count;
     head = (const Type *) (const void *) ((const char *) head + stride * count);
+    return *this;
   }
 
   private:
@@ -883,7 +884,7 @@ struct ArrayOf
     if (unlikely (!serialize (c, items_len))) return_trace (false);
     for (unsigned int i = 0; i < items_len; i++)
       array[i] = items[i];
-    items.advance (items_len);
+    items += items_len;
     return_trace (true);
   }
 
@@ -1006,7 +1007,7 @@ struct HeadlessArrayOf
     if (unlikely (!c->extend (*this))) return_trace (false);
     for (unsigned int i = 0; i < items_len - 1; i++)
       array[i] = items[i];
-    items.advance (items_len - 1);
+    items += items_len - 1;
     return_trace (true);
   }
 
index 8bf69a37fa57df64941c8fb578e6bd12454a4674..cb66c81addbe1538492baf1f0915a0e56c74b5a0 100644 (file)
@@ -700,7 +700,7 @@ struct CoverageFormat1
     if (unlikely (!c->extend (glyphArray))) return_trace (false);
     for (unsigned int i = 0; i < num_glyphs; i++)
       glyphArray[i] = glyphs[i];
-    glyphs.advance (num_glyphs);
+    glyphs += num_glyphs;
     return_trace (true);
   }
 
@@ -789,7 +789,7 @@ struct CoverageFormat2
       } else {
         rangeRecord[range].end = glyphs[i];
       }
-    glyphs.advance (num_glyphs);
+    glyphs += num_glyphs;
     return_trace (true);
   }
 
index 263e0a6e102ba4acd5c7f0ebeed9417ab2a888fb..97f1d21a5be3bfa734e57461abb13ad5e78d9588 100644 (file)
@@ -386,7 +386,7 @@ struct MultipleSubstFormat1
       if (unlikely (!sequence[i].serialize (c, this).serialize (c,
                                                                substitute_glyphs_list,
                                                                substitute_len_list[i]))) return_trace (false);
-    substitute_len_list.advance (num_glyphs);
+    substitute_len_list += num_glyphs;
     if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
     return_trace (true);
   }
@@ -536,7 +536,7 @@ struct AlternateSubstFormat1
       if (unlikely (!alternateSet[i].serialize (c, this).serialize (c,
                                                                    alternate_glyphs_list,
                                                                    alternate_len_list[i]))) return_trace (false);
-    alternate_len_list.advance (num_glyphs);
+    alternate_len_list += num_glyphs;
     if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
     return_trace (true);
   }
@@ -757,8 +757,8 @@ struct LigatureSet
                                                                ligatures[i],
                                                                component_list,
                                                                component_count_list[i]))) return_trace (false);
-    ligatures.advance (num_ligatures);
-    component_count_list.advance (num_ligatures);
+    ligatures += num_ligatures;
+    component_count_list += num_ligatures;
     return_trace (true);
   }
 
@@ -850,7 +850,7 @@ struct LigatureSubstFormat1
                                                                   component_count_list,
                                                                   ligature_per_first_glyph_count_list[i],
                                                                   component_list))) return_trace (false);
-    ligature_per_first_glyph_count_list.advance (num_first_glyphs);
+    ligature_per_first_glyph_count_list += num_first_glyphs;
     if (unlikely (!coverage.serialize (c, this).serialize (c, first_glyphs, num_first_glyphs))) return_trace (false);
     return_trace (true);
   }