[PATCH] dwrite: Fix misplaced parentheses.
Gabriel Ivăncescu
gabrielopcode at gmail.com
Thu Apr 22 08:07:59 CDT 2021
On 22/04/2021 15:09, Andrey Gusev wrote:
> Signed-off-by: Andrey Gusev <andrey.goosev at gmail.com>
> ---
> dlls/dwrite/opentype.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
> index 717550acf38..9830937231d 100644
> --- a/dlls/dwrite/opentype.c
> +++ b/dlls/dwrite/opentype.c
> @@ -2101,7 +2101,7 @@ void opentype_get_font_properties(struct file_stream_desc *stream_desc, struct d
> props->lf.lfWeight = props->weight;
>
> /* FONT_IS_SYMBOL */
> - if (!(is_symbol = props->panose.familyKind == DWRITE_PANOSE_FAMILY_SYMBOL))
> + if (!(is_symbol = props->panose.familyKind) == DWRITE_PANOSE_FAMILY_SYMBOL)
> {
> struct dwrite_fonttable cmap;
> int i, offset, num_tables;
> @@ -2133,7 +2133,7 @@ void opentype_get_font_properties(struct file_stream_desc *stream_desc, struct d
> props->flags |= FONT_IS_SYMBOL;
>
> /* FONT_IS_MONOSPACED */
> - if (!(is_monospaced = props->panose.text.proportion == DWRITE_PANOSE_PROPORTION_MONOSPACED))
> + if (!(is_monospaced = props->panose.text.proportion) == DWRITE_PANOSE_PROPORTION_MONOSPACED)
> {
> struct dwrite_fonttable post;
>
> @@ -4634,7 +4634,7 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
> feature_index = GET_BE_WORD(langsys->feature_index[j]);
> if (feature_index >= total_feature_count)
> continue;
> - if ((found = feature_list->features[feature_index].tag == feature->tag))
> + if ((found = feature_list->features[feature_index].tag) == feature->tag)
> {
> feature->index = feature_index;
> break;
>
They don't seem misplaced, since is_symbol is assigned the comparison
result (i.e. props->panose.familyKind == DWRITE_PANOSE_FAMILY_SYMBOL).
Maybe additionally add parentheses around the comparison itself, so:
is_symbol = (props->panose.familyKind == DWRITE_PANOSE_FAMILY_SYMBOL)
to avoid confusion, but not sure if it's worth it.
More information about the wine-devel
mailing list