summaryrefslogtreecommitdiff
path: root/do_lines.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-15 13:00:22 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-15 13:04:52 -0700
commit2900d7a7e7929414268cb142bf00c57d370e1396 (patch)
tree4c19cc7b6d5e440a32bf7579db3ef8d3112ffad9 /do_lines.c
parentf021fe33579e75bd19e7b5784858be14c3e3c4b6 (diff)
Variable scope reductions as recommended by cppcheck
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'do_lines.c')
-rw-r--r--do_lines.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/do_lines.c b/do_lines.c
index d2ad1d6..de9608d 100644
--- a/do_lines.c
+++ b/do_lines.c
@@ -31,7 +31,6 @@ GenerateLines(XParms xp, Parms p, Bool ddashed)
{
int size;
int half; /* Half of width if wide line */
- int i;
int rows; /* Number of rows filled in current column */
int x, y; /* Next point */
int xdir, ydir; /* Which direction x, y are going */
@@ -76,7 +75,7 @@ GenerateLines(XParms xp, Parms p, Bool ddashed)
points[0].x = x;
points[0].y = y;
- for (i = 1; i != (p->objects+1); i++) {
+ for (int i = 1; i != (p->objects+1); i++) {
phase = phasef;
switch (phase / (size+1)) {
case 0:
@@ -275,9 +274,7 @@ InitWideDoubleDashedLines(XParms xp, Parms p, int64_t reps)
void
DoLines(XParms xp, Parms p, int64_t reps)
{
- int i;
-
- for (i = 0; i != reps; i++)
+ for (int i = 0; i != reps; i++)
{
XDrawLines(xp->d, xp->w, pgc, points, p->objects+1, CoordModeOrigin);
if (pgc == xp->ddbggc)