Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use a declaration state in for loops #990

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/FvwmPager/FvwmPager.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ fpmonitor_new(struct monitor *m)

void fpmonitor_disable(struct fpmonitor *fp)
{
int i;

fp->disabled = true;
for (int i = 0; i < ndesks; i++) {
for (i = 0; i < ndesks; i++) {
XMoveWindow(dpy, fp->CPagerWin[i], -32768,-32768);
}

Expand Down
8 changes: 6 additions & 2 deletions modules/FvwmPager/x_pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,10 @@ void initialise_common_pager_fragments(void)

void initialize_fpmonitor_windows(struct fpmonitor *fp)
{
int i;

rectangle vp = set_vp_size_and_loc(fp, false);
for (int i = 0; i < ndesks; i++) {
for (i = 0; i < ndesks; i++) {
fp->CPagerWin[i] = XCreateWindow(dpy, Desks[i].w,
-32768, -32768, vp.width, vp.height, 0,
CopyFromParent, InputOutput,
Expand Down Expand Up @@ -2000,11 +2002,13 @@ void DrawGrid(int desk, int erase, Window ew, XRectangle *r)

/* Draw monitor labels grid lines. */
if (use_monitor_label) {
int i;

XDrawLine(
dpy, Desks[desk].title_w, Desks[desk].NormalGC,
0, y_loc, desk_w, y_loc);

for (int i = 1; i < m_count; i++)
for (i = 1; i < m_count; i++)
XDrawLine(dpy,
Desks[desk].title_w,
Desks[desk].NormalGC,
Expand Down