summaryrefslogtreecommitdiff
path: root/base/gxscanc.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-01-03 10:17:13 +0000
committerRobin Watts <robin.watts@artifex.com>2017-01-03 10:18:06 +0000
commit8071bb2950068a3c6a1b5a405d16548177503a14 (patch)
tree55247b1611ed081f61d29dd8a7dab05abebb0f63 /base/gxscanc.c
parent06e756898579cd21dbff40ad30efff9571a549fe (diff)
downloadghostpdl-8071bb2950068a3c6a1b5a405d16548177503a14.tar.gz
New scan converter: Fix some warnings.
"ey is set and then never used" in some release builds. Rejig the code to avoid this.
Diffstat (limited to 'base/gxscanc.c')
-rw-r--r--base/gxscanc.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/base/gxscanc.c b/base/gxscanc.c
index 61e8befd3..06fa43a51 100644
--- a/base/gxscanc.c
+++ b/base/gxscanc.c
@@ -229,20 +229,18 @@ static void mark_line(fixed sx, fixed sy, fixed ex, fixed ey, int base_y, int he
}
/* Adjust us back from any 'partial' scanline we cross at the
* end. */
+ ex -= sx;
+ ey -= sy;
delta = (ey - fixed_half) & (fixed_1-1);
assert(delta >= 0 && delta < fixed_1);
if (delta > 0)
{
- int dx = ex - sx;
- int dy = ey - sy;
- int advance = (int)(((int64_t)dx * delta + (dy>>1)) / dy);
+ int advance = (int)(((int64_t)ex * delta + (ey>>1)) / ey);
ex -= advance;
ey -= delta;
}
iey -= isy+1;
isy -= base_y;
- ex -= sx;
- ey -= sy;
assert(ey >= 0);
#ifdef DEBUG_SCAN_CONVERTER
dlprintf2(" sy=%d ey=%d\n", isy, iey);
@@ -1543,20 +1541,18 @@ static void mark_line_tr(fixed sx, fixed sy, fixed ex, fixed ey, int base_y, int
}
/* Adjust us back from any 'partial' scanline we cross at the
* end. */
+ ex -= sx;
+ ey -= sy;
delta = (ey - fixed_half) & (fixed_1-1);
assert(delta >= 0 && delta < fixed_1);
if (delta > 0)
{
- int dx = ex - sx;
- int dy = ey - sy;
- int advance = (int)(((int64_t)dx * delta + (dy>>1)) / dy);
+ int advance = (int)(((int64_t)ex * delta + (ey>>1)) / ey);
ex -= advance;
ey -= delta;
}
iey -= isy+1;
isy -= base_y;
- ex -= sx;
- ey -= sy;
assert(ey >= 0);
#ifdef DEBUG_SCAN_CONVERTER
dlprintf2(" sy=%d ey=%d\n", isy, iey);