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:
parent
8bcdac04a8
commit
69cfb81b29
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue