From fb1f0fee5af3da964ec359ae2b543353ce47f996 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 2 Aug 2018 11:56:12 +0000 Subject: session_groups can be static also. --- session.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'session.c') diff --git a/session.c b/session.c index 3085f248..c2e7fe19 100644 --- a/session.c +++ b/session.c @@ -29,7 +29,7 @@ struct sessions sessions; static u_int next_session_id; -struct session_groups session_groups; +struct session_groups session_groups = RB_INITIALIZER(&session_groups); static void session_free(int, short, void *); @@ -41,21 +41,19 @@ static struct winlink *session_previous_alert(struct winlink *); static void session_group_remove(struct session *); static void session_group_synchronize1(struct session *, struct session *); -RB_GENERATE(sessions, session, entry, session_cmp); - int session_cmp(struct session *s1, struct session *s2) { return (strcmp(s1->name, s2->name)); } +RB_GENERATE(sessions, session, entry, session_cmp); -RB_GENERATE(session_groups, session_group, entry, session_group_cmp); - -int +static int session_group_cmp(struct session_group *s1, struct session_group *s2) { return (strcmp(s1->name, s2->name)); } +RB_GENERATE_STATIC(session_groups, session_group, entry, session_group_cmp); /* * Find if session is still alive. This is true if it is still on the global -- cgit