summaryrefslogtreecommitdiff
path: root/src/menus.c
diff options
context:
space:
mode:
authorTim Wiederhake <twied@gmx.net>2024-01-20 16:07:00 +0100
committerTim Wiederhake <twied@gmx.net>2024-01-20 16:07:00 +0100
commit90058211800fd45ee7cc8408278d3b200bdfd2e5 (patch)
tree743979847f45b448070c28a6a7e794f2c38ec9bd /src/menus.c
parent9e42567818fe26ed97e05cccc0f9b74a2f523ce6 (diff)
Split up InitMenus
Preparation for the removal of FirstScreen: Separate code that is executed for all screens from code that is executed for only the first screen. Signed-off-by: Tim Wiederhake <twied@gmx.net>
Diffstat (limited to 'src/menus.c')
-rw-r--r--src/menus.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/menus.c b/src/menus.c
index 4b5dd62..1e78a1a 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -133,7 +133,6 @@ void
InitMenus(void)
{
int i, j, k;
- FuncKey *key;
for (i = 0; i < MAX_BUTTONS + 1; i++)
for (j = 0; j < NUM_CONTEXTS; j++)
@@ -144,18 +143,21 @@ InitMenus(void)
Scr->DefaultFunction.func = 0;
Scr->WindowFunction.func = 0;
+}
- if (FirstScreen) {
- for (key = Scr->FuncKeyRoot.next; key != NULL;) {
- FuncKey *tmp = key;
+void
+InitMenusFirst(void)
+{
+ FuncKey *key;
- free(key->name);
- key = key->next;
- free(tmp);
- }
- Scr->FuncKeyRoot.next = NULL;
- }
+ for (key = Scr->FuncKeyRoot.next; key != NULL;) {
+ FuncKey *tmp = key;
+ free(key->name);
+ key = key->next;
+ free(tmp);
+ }
+ Scr->FuncKeyRoot.next = NULL;
}
/**