Nikolay Sivov : dwrite: Explicitly cast to signed type for abs().

Alexandre Julliard julliard at winehq.org
Tue Mar 30 15:19:50 CDT 2021


Module: wine
Branch: master
Commit: 69cfb81b2916210ba3c7fc4a8f49613af29ab1f8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=69cfb81b2916210ba3c7fc4a8f49613af29ab1f8

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Mar 30 14:06:16 2021 +0300

dwrite: Explicitly cast to signed type for abs().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dwrite/font.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 2fd6ad90f1f..68d3b1256ea 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -3910,16 +3910,17 @@ static BOOL font_apply_differentiation_rules(struct dwrite_font_data *font, WCHA
     weight = font_extract_weight(&tokens, font->weight, &weight_name);
 
     /* resolve weight */
-    if (weight != font->weight) {
+    if (weight != font->weight)
+    {
         if (!(weight < DWRITE_FONT_WEIGHT_NORMAL && font->weight < DWRITE_FONT_WEIGHT_NORMAL) &&
             !(weight > DWRITE_FONT_WEIGHT_MEDIUM && font->weight > DWRITE_FONT_WEIGHT_MEDIUM) &&
             !((weight == DWRITE_FONT_WEIGHT_NORMAL && font->weight == DWRITE_FONT_WEIGHT_MEDIUM) ||
               (weight == DWRITE_FONT_WEIGHT_MEDIUM && font->weight == DWRITE_FONT_WEIGHT_NORMAL)) &&
-            !(abs(weight - font->weight) <= 150 &&
+            !(abs((int)weight - (int)font->weight) <= 150 &&
               font->weight != DWRITE_FONT_WEIGHT_NORMAL &&
               font->weight != DWRITE_FONT_WEIGHT_MEDIUM &&
-              font->weight != DWRITE_FONT_WEIGHT_BOLD)) {
-
+              font->weight != DWRITE_FONT_WEIGHT_BOLD))
+        {
             font->weight = weight;
         }
     }




More information about the wine-cvs mailing list