From fb9bf2efae7a2ae098d4bda87486ce39ca7c9d6f Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Mon, 15 Mar 2021 22:33:17 -0400 Subject: [PATCH] * src/smooth/ftgrays.c (gray_set_cell): Refactor to fix VC++ warning. --- ChangeLog | 4 ++++ src/smooth/ftgrays.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4a748c0e..91846facb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-03-11 Alexei Podtelezhnikov + + * src/smooth/ftgrays.c (gray_set_cell): Refactor to fix VC++ warning. + 2021-03-13 Werner Lemberg Handle various VC++ compiler warnings. diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index 8ea723028..dc25669cc 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -540,15 +540,17 @@ typedef ptrdiff_t FT_PtrDist; ras.cell = NULL; else { - PCell *pcell, cell; + PCell* pcell = ras.ycells + ey - ras.min_ey; + PCell cell; ex = FT_MAX( ex, ras.min_ex - 1 ); - pcell = &ras.ycells[ey - ras.min_ey]; - while ( ( cell = *pcell ) ) + while ( 1 ) { - if ( cell->x > ex ) + cell = *pcell; + + if ( !cell || cell->x > ex ) break; if ( cell->x == ex )