~ubuntu-branches/ubuntu/maverick/pango1.0/maverick-proposed

« back to all changes in this revision

Viewing changes to pango/opentype/hb-ot-layout.cc

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-09-09 07:49:30 UTC
  • mfrom: (1.5.6 upstream) (63.1.9 experimental)
  • Revision ID: james.westby@ubuntu.com-20090909074930-ld7uftgos8yxry0l
Tags: 1.25.6-1
New upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
222
222
 
223
223
  /* XXX this is not threadsafe */
224
224
  if (glyph >= len) {
225
 
    int new_len;
 
225
    unsigned int new_len;
226
226
    unsigned char *new_klasses;
227
227
 
228
228
    new_len = len == 0 ? 120 : 2 * len;
 
229
    while (new_len <= glyph)
 
230
      new_len *= 2;
 
231
 
229
232
    if (new_len > 65536)
230
233
      new_len = 65536;
231
234
    new_klasses = (unsigned char *) realloc (layout->new_gdef.klasses, new_len * sizeof (unsigned char));
456
459
  const LangSys &l = g.get_script (script_index).get_lang_sys (language_index);
457
460
 
458
461
  ASSERT_STATIC (sizeof (unsigned int) == sizeof (hb_tag_t));
459
 
  unsigned int count = feature_count ? *feature_count : 0;
460
462
  hb_bool_t ret = l.get_feature_indexes (feature_count, (unsigned int *) feature_tags);
461
463
 
462
 
  count = feature_count ? MIN (count, *feature_count) : 0;
463
 
  for (unsigned int i = 0; i < count; i++)
464
 
    feature_tags[i] = g.get_feature_tag ((unsigned int) feature_tags[i]);
 
464
  if (feature_tags) {
 
465
    unsigned int count = *feature_count;
 
466
    for (unsigned int i = 0; i < count; i++)
 
467
      feature_tags[i] = g.get_feature_tag ((unsigned int) feature_tags[i]);
 
468
  }
465
469
 
466
470
  return ret;
467
471
}