ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtfont.C
(Generate patch)

Comparing rxvt-unicode/src/rxvtfont.C (file contents):
Revision 1.185 by sf-exg, Thu Jan 19 13:33:43 2012 UTC vs.
Revision 1.188 by root, Thu Jan 26 13:08:51 2012 UTC

1499 1499
1500 for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++) 1500 for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++)
1501 (*i)->unref (); 1501 (*i)->unref ();
1502 1502
1503 for (pagemap **p = fmap.begin (); p != fmap.end (); p++) 1503 for (pagemap **p = fmap.begin (); p != fmap.end (); p++)
1504 delete *p; 1504 delete [] *p;
1505 1505
1506 free (fontdesc); fontdesc = 0; 1506 free (fontdesc); fontdesc = 0;
1507 1507
1508 fonts.clear (); 1508 fonts.clear ();
1509 1509
1785 while (hi >= fmap.size ()) 1785 while (hi >= fmap.size ())
1786 fmap.push_back (0); 1786 fmap.push_back (0);
1787 1787
1788 if (!fmap[hi]) 1788 if (!fmap[hi])
1789 { 1789 {
1790 fmap[hi] = (pagemap *)new pagemap; 1790 // we use [1] here because C++ has no separate new and new [] forms,
1791 // and pagemap is char[256], so new incorrectly assumes we want to
1792 // allocate an array of chars instead of a single pagemap.
1793 // we can either cast the resulting pointer to (pagemap *) or
1794 // allocate an array of pagemaps, returning a pointer to the first member
1795 // this is no extra overhead, as new even allocates an array for
1796 // "new pagemap"
1797 fmap[hi] = new pagemap[1];
1791 memset (fmap[hi], 0xff, sizeof (pagemap)); 1798 memset (fmap[hi], 0xff, sizeof (pagemap));
1792 } 1799 }
1793 1800
1794 (*fmap[hi])[unicode & 0xff] = i; 1801 (*fmap[hi])[unicode & 0xff] = i;
1795 } 1802 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines