Whitespace.
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
diff --git a/ChangeLog b/ChangeLog
index 7cc14df..03ac4d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -201,10 +201,11 @@
2013-08-19 Alexei Podtelezhnikov <apodtele@gmail.com>
- [base] Enable new algorithm for BBox_Cubic_Check.
+ [base] Enable new algorithm for `BBox_Cubic_Check'.
- * src/base/ftbbox.c: Enable new BBox_Cubic_Check algorithm, remove the
- old one. Improve comments.
+ * src/base/ftbbox.c: Enable new BBox_Cubic_Check algorithm, remove
+ the old one.
+ Improve comments.
2013-08-18 Werner Lemberg <wl@gnu.org>
diff --git a/src/base/ftbbox.c b/src/base/ftbbox.c
index ebbfb1a..8d3f383 100644
--- a/src/base/ftbbox.c
+++ b/src/base/ftbbox.c
@@ -85,7 +85,7 @@
/* BBox_Conic_Check */
/* */
/* <Description> */
- /* Finds the extrema of a 1-dimensional conic Bezier curve and update */
+ /* Find the extrema of a 1-dimensional conic Bezier curve and update */
/* a bounding range. This version uses direct computation, as it */
/* doesn't need square roots. */
/* */
@@ -108,10 +108,10 @@
FT_Pos* min,
FT_Pos* max )
{
- /* This function is only called when a control off-point is outside */
- /* the bbox that contains all on-points. It finds a local extremum */
- /* within the segment, equal to (y1*y3 - y2*y2)/(y1 - 2*y2 + y3). */
- /* Or, offsetting from y2, we get */
+ /* This function is only called when a control off-point is outside */
+ /* the bbox that contains all on-points. It finds a local extremum */
+ /* within the segment, equal to (y1*y3 - y2*y2)/(y1 - 2*y2 + y3). */
+ /* Or, offsetting from y2, we get */
y1 -= y2;
y3 -= y2;
@@ -184,8 +184,8 @@
/* BBox_Cubic_Check */
/* */
/* <Description> */
- /* Finds the extrema of a 1-dimensional cubic Bezier curve and */
- /* updates a bounding range. This version uses iterative splitting */
+ /* Find the extrema of a 1-dimensional cubic Bezier curve and */
+ /* update a bounding range. This version uses iterative splitting */
/* because it is faster than the exact solution with square roots. */
/* */
/* <Input> */
@@ -202,13 +202,12 @@
/* */
/* max :: The address of the current maximum. */
/* */
-
static FT_Pos
- update_cubic_max( FT_Pos q1,
- FT_Pos q2,
- FT_Pos q3,
- FT_Pos q4,
- FT_Pos max )
+ update_cubic_max( FT_Pos q1,
+ FT_Pos q2,
+ FT_Pos q3,
+ FT_Pos q4,
+ FT_Pos max )
{
/* for a cubic segment to possibly reach new maximum, at least */
/* one of its off-points must stay above the current value */
@@ -238,7 +237,7 @@
q3 = q3 / 2;
}
- /* check if either end reached the maximum */
+ /* check whether either end reached the maximum */
if ( q1 == q2 && q1 >= q3 )
{
max = q1;
@@ -254,6 +253,7 @@
return max;
}
+
static void
BBox_Cubic_Check( FT_Pos p1,
FT_Pos p2,
@@ -262,16 +262,17 @@
FT_Pos* min,
FT_Pos* max )
{
- FT_Pos nmin, nmax;
- FT_Int shift;
+ FT_Pos nmin, nmax;
+ FT_Int shift;
+
/* This function is only called when a control off-point is outside */
- /* the bbox that contains all on-points. It finds a local extremum */
+ /* the bbox that contains all on-points. It finds a local extremum */
/* within the segment using iterative bisection of the segment. */
- /* The fixed-point arithmentic of bisection is inherently stable */
- /* but may loose accuracy in the two lowest bits. To compensate, */
- /* we upscale the segment if there is room. Large values may need */
- /* to be downscaled to avoid overflows during bisection bisection. */
+ /* The fixed-point arithmetic of bisection is inherently stable */
+ /* but may loose accuracy in the two lowest bits. To compensate, */
+ /* we upscale the segment if there is room. Large values may need */
+ /* to be downscaled to avoid overflows during bisection. */
/* The control off-point outside the bbox is likely to have the top */
/* absolute value among arguments. */
@@ -357,9 +358,9 @@
FT_Vector* to,
TBBox_Rec* user )
{
- /* We don't need to check `to' since it is always an on-point, */
- /* thus within the bbox. Only segments with an off-point outside */
- /* the bbox can possibly reach new extreme values. */
+ /* We don't need to check `to' since it is always an on-point, */
+ /* thus within the bbox. Only segments with an off-point outside */
+ /* the bbox can possibly reach new extreme values. */
if ( CHECK_X( control1, user->bbox ) ||
CHECK_X( control2, user->bbox ) )