From f741031e69de73d5816cc56e99c9beba3ac820de Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Sep 2018 15:57:43 +0200 Subject: [PATCH] Suppress gcc -Wfloat-conversion warning in wxFontInfo ctor Add an explicit cast to avoid warnings when compiling with this option. While just casting double to float is not the best idea, it seems quite unlikely that anybody would pass a value outside of float range to this ctor. --- include/wx/font.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/font.h b/include/wx/font.h index ef9bf45c71..4e986bb49f 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -141,7 +141,7 @@ public: // Need to define this one to avoid casting double to int too. explicit wxFontInfo(double pointSize) - { InitPointSize(pointSize); } + { InitPointSize(static_cast(pointSize)); } template explicit wxFontInfo(T pointSize) { InitPointSize(ToFloatPointSize(pointSize)); }