mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 21:39:44 +00:00
Make some functions static.
This commit is contained in:
parent
efa3cad57a
commit
0973bfccee
@ -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<std::string> &res, config const &c) {
|
||||
static void add_lines(std::vector<std::string> &res, config const &c) {
|
||||
std::string title=c["title"];
|
||||
if(title.size()) {
|
||||
title = N_("+" + title);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
||||
|
@ -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")
|
||||
|
@ -473,7 +473,8 @@ hotkey_item& get_hotkey(const SDL_KeyboardEvent& event)
|
||||
#endif
|
||||
);
|
||||
}
|
||||
void _get_visible_hotkey_itor(int index, std::vector<hotkey_item>::iterator& itor)
|
||||
|
||||
static void _get_visible_hotkey_itor(int index, std::vector<hotkey_item>::iterator& itor)
|
||||
{
|
||||
int counter = 0;
|
||||
for (itor = hotkeys_.begin(); itor != hotkeys_.end(); ++itor) {
|
||||
|
@ -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<config*>& 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)
|
||||
|
@ -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<std::string>& 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;
|
||||
|
||||
|
@ -23,12 +23,12 @@
|
||||
#include <time.h>
|
||||
#include <iostream>
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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<team>& teams, size_t side, size_t other_side)
|
||||
static bool affects_side(const config& cfg, const std::vector<team>& teams, size_t side, size_t other_side)
|
||||
{
|
||||
if (side == other_side)
|
||||
return utils::string_bool(cfg["affect_allies"], true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user