Skip to content

Commit

Permalink
Fixed error: ‘for’ loop initial declarations are only allowed in C99 …
Browse files Browse the repository at this point in the history
…mode
  • Loading branch information
BHamrick1 committed May 19, 2016
1 parent b6eecbf commit 3f3c5c5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,14 @@ void scrollMouse(int x, int y)
if (x < 0){
xdir = 7;
}

for (int xi = 0; xi < abs(x); xi++) {

int xi;
int yi;
for (xi = 0; xi < abs(x); xi++) {
XTestFakeButtonEvent(display, xdir, 1, CurrentTime);
XTestFakeButtonEvent(display, xdir, 0, CurrentTime);
}

for (int yi = 0; yi < abs(y); yi++) {
for (yi = 0; yi < abs(y); yi++) {
YTestFakeButtonEvent(display, ydir, 1, CurrentTime);
YTestFakeButtonEvent(display, ydir, 0, CurrentTime);
}
Expand Down

0 comments on commit 3f3c5c5

Please sign in to comment.