From ffaf5d81621492eef7cbeebdeef844e0d1b2a552 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 21 May 2021 01:50:17 +0300 Subject: [PATCH 44/44] Inline is_server() See osdn #42331 Signed-off-by: Marko Lindqvist --- common/game.c | 8 -------- common/game.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/common/game.c b/common/game.c index f0053a2f26..bb4db02087 100644 --- a/common/game.c +++ b/common/game.c @@ -61,14 +61,6 @@ bool am_i_server = FALSE; static void game_defaults(bool keep_ruleset_value); -/************************************************************************** - Is program type server? -**************************************************************************/ -bool is_server(void) -{ - return am_i_server; -} - /************************************************************************** Set program type to server. **************************************************************************/ diff --git a/common/game.h b/common/game.h index 2f96958fc4..7eb3c908d0 100644 --- a/common/game.h +++ b/common/game.h @@ -289,9 +289,19 @@ struct civ_game { } callbacks; }; -bool is_server(void); +extern bool am_i_server; + +/************************************************************************** + Is the program type server? +**************************************************************************/ +static inline bool is_server(void) +{ + return am_i_server; +} + void i_am_server(void); void i_am_client(void); + static inline void i_am_tool(void) { i_am_server(); /* No difference between a tool and server at the moment */ -- 2.30.2