* src/smooth/ftgrays.c (gray_set_cell): Refactor to fix VC++ warning.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/ChangeLog b/ChangeLog
index d4a748c..91846fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-11 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/smooth/ftgrays.c (gray_set_cell): Refactor to fix VC++ warning.
+
2021-03-13 Werner Lemberg <wl@gnu.org>
Handle various VC++ compiler warnings.
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 8ea7230..dc25669 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 )