Author: manolo
Date: 2011-01-29 08:20:16 -0800 (Sat, 29 Jan 2011)
New Revision: 8331
Log:
Fix STR #2549: error in sizeof arithmetic

Modified:
   branches/branch-1.3/src/fl_font_mac.cxx

Modified: branches/branch-1.3/src/fl_font_mac.cxx
===================================================================
--- branches/branch-1.3/src/fl_font_mac.cxx     2011-01-29 14:35:01 UTC (rev 
8330)
+++ branches/branch-1.3/src/fl_font_mac.cxx     2011-01-29 16:20:16 UTC (rev 
8331)
@@ -72,7 +72,7 @@
   ascent = (short)(CTFontGetAscent(fontref) + 0.5);
   descent = (short)(CTFontGetDescent(fontref) + 0.5);
   q_width = w + 0.5;
-  for (unsigned i = 0; i < sizeof(width)/sizeof(float); i++) width[i] = NULL;
+  for (unsigned i = 0; i < sizeof(width)/sizeof(float*); i++) width[i] = NULL;
   if (!attributes) {
     static CFNumberRef zero_ref;
     float zero = 0.;
@@ -183,7 +183,7 @@
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
   if (fl_mac_os_version >= 0x1050)  {
     CFRelease(fontref);
-    for (unsigned i = 0; i < sizeof(width)/sizeof(float); i++) {
+    for (unsigned i = 0; i < sizeof(width)/sizeof(float*); i++) {
       if (width[i]) free(width[i]);
       }
   }
@@ -314,7 +314,7 @@
       i++; // because a pair of UniChar's represent a single character
       continue;
       }
-    const int block = 0x10000 / (sizeof(fl_fontsize->width)/sizeof(float)); // 
block size
+    const int block = 0x10000 / (sizeof(fl_fontsize->width)/sizeof(float*)); 
// block size
     // r: index of the character block containing uni
     unsigned int r = uni >> 7; // change 7 if sizeof(width) is changed
     if (!fl_fontsize->width[r]) { // this character block has not been hit yet

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to