gdi32: Avoid compiler warnings in freetype_SelectFont. Simplify logic a bit.
Gerald Pfeifer
gerald at pfeifer.com
Mon Jun 23 05:27:44 CDT 2014
This is similar to the warning removal patch I submitted yesterday.
On top of that it replaces
! something == ! a_0_1_boolean
by
!! something == a_0_1_boolean
since !! reflects the intention (to convert whatever value to one of
0 or 1) better than the former and may be more efficient, too.
Gerald
---
dlls/gdi32/freetype.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index fae9ffe..36d010c 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -5265,7 +5265,7 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
font_link = find_font_link(family->FamilyName);
face_list = get_face_list_from_family(family);
LIST_FOR_EACH_ENTRY( face, face_list, Face, entry ) {
- if(!(face->flags & ADDFONT_VERTICAL_FONT) == !want_vertical &&
+ if((!!(face->flags & ADDFONT_VERTICAL_FONT)) == want_vertical &&
(csi.fs.fsCsb[0] & face->fs.fsCsb[0] ||
(font_link != NULL && csi.fs.fsCsb[0] & font_link->fs.fsCsb[0]))) {
if(face->scalable)
@@ -5285,7 +5285,7 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
LIST_FOR_EACH_ENTRY( family, &font_list, Family, entry ) {
face_list = get_face_list_from_family(family);
LIST_FOR_EACH_ENTRY( face, face_list, Face, entry ) {
- if(face->scalable && !(face->flags & ADDFONT_VERTICAL_FONT) == !want_vertical) {
+ if(face->scalable && (!!(face->flags & ADDFONT_VERTICAL_FONT)) == want_vertical) {
csi.fs.fsCsb[0] = 0;
WARN("just using first face for now\n");
goto found;
--
1.9.3
More information about the wine-patches
mailing list