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

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-03-30 14:06:16 +03:00 committed by Alexandre Julliard
parent 8bcdac04a8
commit 69cfb81b29
1 changed files with 5 additions and 4 deletions

View File

@ -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); weight = font_extract_weight(&tokens, font->weight, &weight_name);
/* resolve weight */ /* resolve weight */
if (weight != font->weight) { if (weight != font->weight)
{
if (!(weight < DWRITE_FONT_WEIGHT_NORMAL && font->weight < DWRITE_FONT_WEIGHT_NORMAL) && 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_MEDIUM && font->weight > DWRITE_FONT_WEIGHT_MEDIUM) &&
!((weight == DWRITE_FONT_WEIGHT_NORMAL && 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)) && (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_NORMAL &&
font->weight != DWRITE_FONT_WEIGHT_MEDIUM && font->weight != DWRITE_FONT_WEIGHT_MEDIUM &&
font->weight != DWRITE_FONT_WEIGHT_BOLD)) { font->weight != DWRITE_FONT_WEIGHT_BOLD))
{
font->weight = weight; font->weight = weight;
} }
} }