diff --git a/src/about.cpp b/src/about.cpp index b5ec23db954..0ca673eb6f2 100644 --- a/src/about.cpp +++ b/src/about.cpp @@ -41,7 +41,7 @@ namespace about // Given a vector of strings, and a config representing an [about] section, // add all the credits lines from the about section to the list of strings. -void add_lines(std::vector &res, config const &c) { +static void add_lines(std::vector &res, config const &c) { std::string title=c["title"]; if(title.size()) { title = N_("+" + title); diff --git a/src/dialogs.cpp b/src/dialogs.cpp index c8629e43aa9..c9f20758928 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -1161,7 +1161,7 @@ void campaign_preview_pane::draw_contents() } } -network::connection network_data_dialog(display& disp, const std::string& msg, config& cfg, network::connection connection_num, network::statistics (*get_stats)(network::connection handle)) +static network::connection network_data_dialog(display& disp, const std::string& msg, config& cfg, network::connection connection_num, network::statistics (*get_stats)(network::connection handle)) { #ifdef USE_TINY_GUI const size_t width = 200; diff --git a/src/editor/editor_palettes.cpp b/src/editor/editor_palettes.cpp index 6fcffcf0b65..4efe1e3a7f2 100644 --- a/src/editor/editor_palettes.cpp +++ b/src/editor/editor_palettes.cpp @@ -34,7 +34,7 @@ namespace map_editor { -bool is_invalid_terrain(t_translation::t_terrain c) { +static bool is_invalid_terrain(t_translation::t_terrain c) { return (c == t_translation::VOID_TERRAIN || c == t_translation::FOGGED); } diff --git a/src/game_events.cpp b/src/game_events.cpp index 501fdf48b93..e3b35ce81d7 100644 --- a/src/game_events.cpp +++ b/src/game_events.cpp @@ -166,7 +166,7 @@ game_state* get_state_of_game() return state_of_game; } -bool internal_conditional_passed(const unit_map* units, +static bool internal_conditional_passed(const unit_map* units, const vconfig cond, bool& backwards_compat) { diff --git a/src/gamestatus.cpp b/src/gamestatus.cpp index 414edd5f33b..908fb06e63d 100644 --- a/src/gamestatus.cpp +++ b/src/gamestatus.cpp @@ -799,7 +799,7 @@ void read_save_file(const std::string& name, config& cfg, std::string* error_log } } -void copy_era(config &cfg) +static void copy_era(config &cfg) { if (cfg.child("replay_start") && cfg.child("replay_start")->child("era") diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 522710b2341..e17aa6b55d1 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -473,7 +473,8 @@ hotkey_item& get_hotkey(const SDL_KeyboardEvent& event) #endif ); } -void _get_visible_hotkey_itor(int index, std::vector::iterator& itor) + +static void _get_visible_hotkey_itor(int index, std::vector::iterator& itor) { int counter = 0; for (itor = hotkeys_.begin(); itor != hotkeys_.end(); ++itor) { diff --git a/src/playcampaign.cpp b/src/playcampaign.cpp index 2ce34e75b0b..9550abd6aff 100644 --- a/src/playcampaign.cpp +++ b/src/playcampaign.cpp @@ -121,7 +121,7 @@ static void clean_saves(const std::string &label) } } -LEVEL_RESULT playsingle_scenario(const config& game_config, +static LEVEL_RESULT playsingle_scenario(const config& game_config, const config* level, display& disp, game_state& state_of_game, const std::vector& story, upload_log& log, bool skip_replay) { @@ -153,7 +153,7 @@ LEVEL_RESULT playsingle_scenario(const config& game_config, } -LEVEL_RESULT playmp_scenario(const config& game_config, +static LEVEL_RESULT playmp_scenario(const config& game_config, config const* level, display& disp, game_state& state_of_game, const config::child_list& story, upload_log& log, bool skip_replay, io_type_t& io_type) diff --git a/src/serialization/string_utils.cpp b/src/serialization/string_utils.cpp index 17c3112902f..e5cf9c7e6d4 100644 --- a/src/serialization/string_utils.cpp +++ b/src/serialization/string_utils.cpp @@ -406,7 +406,7 @@ bool string_bool(const std::string& str, bool def) { return def; } -bool is_username_char(char c) { +static bool is_username_char(char c) { return ((c == '_') || (c == '-')); } @@ -477,7 +477,7 @@ bool word_completion(std::string& text, std::vector& wordlist) { return text_start; } -bool is_word_boundary(char c) { +static bool is_word_boundary(char c) { return (c == ' ' || c == ',' || c == ':' || c == '\'' || c == '"' || c == '-'); } @@ -612,7 +612,7 @@ std::vector< std::pair< int, int > > parse_ranges(std::string const &str) return to_return; } -int byte_size_from_utf8_first(unsigned char ch) +static int byte_size_from_utf8_first(unsigned char ch) { int count; diff --git a/src/server/metrics.cpp b/src/server/metrics.cpp index b0e608d56c8..a54db38a7ef 100644 --- a/src/server/metrics.cpp +++ b/src/server/metrics.cpp @@ -23,12 +23,12 @@ #include #include -bool operator<(const metrics::sample& s, const simple_wml::string_span& name) +static bool operator<(const metrics::sample& s, const simple_wml::string_span& name) { return s.name < name; } -bool operator<(const simple_wml::string_span& name, const metrics::sample& s) +static bool operator<(const simple_wml::string_span& name, const metrics::sample& s) { return name < s.name; } diff --git a/src/server/server.cpp b/src/server/server.cpp index 99bc6554deb..6ef2cdc3c54 100644 --- a/src/server/server.cpp +++ b/src/server/server.cpp @@ -91,18 +91,18 @@ clock_t get_cpu_time(bool active) { sig_atomic_t config_reload = 0; -void reload_config(int signal) { +static void reload_config(int signal) { assert(signal == SIGHUP); config_reload = 1; } -void exit_sigint(int signal) { +static void exit_sigint(int signal) { assert(signal == SIGINT); LOG_SERVER << "SIGINT caught, exiting without cleanup immediately.\n"; exit(1); } -void exit_sigterm(int signal) { +static void exit_sigterm(int signal) { assert(signal == SIGTERM); LOG_SERVER << "SIGTERM caught, exiting without cleanup immediately.\n"; exit(1); diff --git a/src/sound.cpp b/src/sound.cpp index 2340a21262f..4fdf5db2f6b 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -507,7 +507,7 @@ void play_music() fadingout_time=current_track.ms_after; } -void play_new_music() +static void play_new_music() { music_start_time = 0; //reset status: no start time want_new_music = true; diff --git a/src/unit_abilities.cpp b/src/unit_abilities.cpp index 559722dd356..c8bcc26c7d2 100644 --- a/src/unit_abilities.cpp +++ b/src/unit_abilities.cpp @@ -102,7 +102,7 @@ A poisoned unit cannot be cured of its poison by a healer, and must seek the car namespace unit_abilities { -bool affects_side(const config& cfg, const std::vector& teams, size_t side, size_t other_side) +static bool affects_side(const config& cfg, const std::vector& teams, size_t side, size_t other_side) { if (side == other_side) return utils::string_bool(cfg["affect_allies"], true);