From e685ae1d13ca5273ee738fff6360b8c52ba7d2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bron?= Date: Sun, 2 Sep 2018 23:47:43 +0200 Subject: [PATCH] Fix wxMac compilation in 32 bits after font changes Resolve ambiguity in wxCFTypeRef::GetValue() calls: CGFloat is float, not double, in 32 bit builds, so the type of the first argument is "float *" while the type of 0.0 is "double". Fix this by casting 0 to CGFloat too, as this works in both 32 and 64 bit builds. --- src/osx/carbon/font.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index e74e078d14..cfac98ee0e 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -864,7 +864,7 @@ void wxNativeFontInfo::InitFromFontDescriptor(CTFontDescriptorRef desc) m_ctWeight = GetCTWeight(desc); m_style = GetCTSlant(desc) > 0.01 ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL; - wxCFTypeRef(CTFontDescriptorCopyAttribute(desc, kCTFontSizeAttribute)).GetValue(m_ctSize, 0.0); + wxCFTypeRef(CTFontDescriptorCopyAttribute(desc, kCTFontSizeAttribute)).GetValue(m_ctSize, CGFloat(0.0)); // determine approximate family @@ -946,7 +946,7 @@ CGFloat wxNativeFontInfo::GetCTWeight(CTFontRef font) CGFloat weight; CFTypeRef fonttraitstype = CTFontCopyAttribute(font, kCTFontTraitsAttribute); wxCFDictionaryRef traits((CFDictionaryRef)fonttraitstype); - traits.GetValue(kCTFontWeightTrait).GetValue(&weight, 0.0); + traits.GetValue(kCTFontWeightTrait).GetValue(&weight, CGFloat(0.0)); return weight; } @@ -955,7 +955,7 @@ CGFloat wxNativeFontInfo::GetCTWeight(CTFontDescriptorRef descr) CGFloat weight; CFTypeRef fonttraitstype = CTFontDescriptorCopyAttribute(descr, kCTFontTraitsAttribute); wxCFDictionaryRef traits((CFDictionaryRef)fonttraitstype); - traits.GetValue(kCTFontWeightTrait).GetValue(&weight, 0.0); + traits.GetValue(kCTFontWeightTrait).GetValue(&weight, CGFloat(0.0)); return weight; } @@ -964,7 +964,7 @@ CGFloat wxNativeFontInfo::GetCTSlant(CTFontDescriptorRef descr) CGFloat slant; CFTypeRef fonttraitstype = CTFontDescriptorCopyAttribute(descr, kCTFontTraitsAttribute); wxCFDictionaryRef traits((CFDictionaryRef)fonttraitstype); - traits.GetValue(kCTFontSlantTrait).GetValue(&slant, 0.0); + traits.GetValue(kCTFontSlantTrait).GetValue(&slant, CGFloat(0.0)); return slant; }