diff options
| author | Manolo Gouy <Manolo> | 2011-01-29 16:20:16 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2011-01-29 16:20:16 +0000 |
| commit | a1d85a742be1e65b77323776b372e268632e455e (patch) | |
| tree | 57dbe07e50224f01b87b2fbca52247f8a5037a10 /src | |
| parent | e77d29a1eefc049e0cebd6c61b1c07207b17b9a4 (diff) | |
Fix STR #2549: error in sizeof arithmetic
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8331 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/fl_font_mac.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fl_font_mac.cxx b/src/fl_font_mac.cxx index 137f0a715..5312c6fe4 100644 --- a/src/fl_font_mac.cxx +++ b/src/fl_font_mac.cxx @@ -72,7 +72,7 @@ if (fl_mac_os_version >= 0x1050) {//unfortunately, CTFontCreateWithName != NULL 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 @@ Fl_Font_Descriptor::~Fl_Font_Descriptor() { #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 @@ if (fl_mac_os_version >= 0x1050) { 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 |
