Skip to content

Get rid of window magic numbers - #2256

Merged
jubalh merged 3 commits into
masterfrom
winmem
Nov 12, 2026
Merged

jubalh merged 3 commits into
masterfrom
winmem

Conversation

@jubalh

@jubalh jubalh commented Nov 12, 2026

Copy link
Copy Markdown
Member

See commits.

…sterwin

occupantswin and rosterwin assumed that the layout of the window was always LAYOUT_SPLIT.
If it didn't we used assert, which only word in the debug build.

Let's check the layout type explicitly before downcasting to ProfLayoutSplit.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
No cast needed, the function is for MUCs only.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
This was used to verify the window type when downcasting from ProfWin*,
but we can check window->type directly instead. The same applies to
layout->type for split layouts, making these magic numbers redundant.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone Nov 12, 2026
@jubalh jubalh self-assigned this Nov 12, 2026
@jubalh jubalh added the cleanup label Nov 12, 2026
@jubalh
jubalh merged commit c46411f into master Nov 12, 2026
12 checks passed
@jubalh
jubalh deleted the winmem branch November 12, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant