Skip to content

Commit eb5428f

Browse files
committed
again fixing compiler warnings (this time: unused functions)
by inlining functions, compilers will not warn about not using them
1 parent 95a0de6 commit eb5428f

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

include/pfasst.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace pfasst
1111
{
12-
static void init(int argc, char** argv)
12+
inline static void init(int argc, char** argv)
1313
{
1414
SDC<>::enable_config_options(0);
1515
Quadrature::enable_config_options(0);

include/pfasst/config.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,27 @@ namespace pfasst
102102

103103

104104
template<typename T>
105-
static T get_value(const string& name, const T& default_val)
105+
inline static T get_value(const string& name, const T& default_val)
106106
{
107107
return Options::get_instance().get_variables_map().count(name)
108108
? Options::get_instance().get_variables_map()[name].as<T>() : default_val;
109109
}
110110

111111

112112
template<typename T>
113-
static T get_value(const string& name)
113+
inline static T get_value(const string& name)
114114
{
115115
return Options::get_instance().get_variables_map()[name].as<T>();
116116
}
117117

118118

119-
static bool no_params_given()
119+
inline static bool no_params_given()
120120
{
121121
return Options::get_instance().get_variables_map().empty();
122122
}
123123

124124

125-
static string pretty_print()
125+
inline static string pretty_print()
126126
{
127127
stringstream s;
128128
s << "Logging Options:" << endl
@@ -140,7 +140,7 @@ namespace pfasst
140140
/**
141141
* @returns empty string if params are set and `if_no_params` is `true`
142142
*/
143-
static string print_help(bool if_no_params = false)
143+
inline static string print_help(bool if_no_params = false)
144144
{
145145
if (!if_no_params || (if_no_params && no_params_given())) {
146146
return pretty_print();
@@ -150,14 +150,14 @@ namespace pfasst
150150
}
151151

152152

153-
static void init_global_options(po::options_description& opts)
153+
inline static void init_global_options(po::options_description& opts)
154154
{
155155
opts.add_options()
156156
("help,h", "display this help message");
157157
}
158158

159159

160-
static void init_config()
160+
inline static void init_config()
161161
{
162162
Options::get_instance()
163163
.register_init_function("Global Options",
@@ -168,7 +168,7 @@ namespace pfasst
168168
}
169169

170170

171-
static void read_commandline(int argc, char* argv[], bool exit_on_help = true)
171+
inline static void read_commandline(int argc, char* argv[], bool exit_on_help = true)
172172
{
173173
po::parsed_options parsed = po::command_line_parser(argc, argv)
174174
.options(Options::get_instance().get_all_options())
@@ -188,7 +188,7 @@ namespace pfasst
188188
/**
189189
* @throws invalid_argument if the given file could not be opened
190190
*/
191-
static void read_config_file(string file_name)
191+
inline static void read_config_file(string file_name)
192192
{
193193
ifstream ifs(file_name.c_str(), ios_base::in);
194194
if (!ifs) {

include/pfasst/logging.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace pfasst
8686
/**
8787
* sets default configuration for default loggers
8888
*/
89-
static void load_default_config()
89+
inline static void load_default_config()
9090
{
9191
const string TIMESTAMP = OUT::white + "%datetime{%H:%m:%s,%g}" + OUT::reset + " ";
9292
const string LEVEL = "[%level]";
@@ -137,7 +137,7 @@ namespace pfasst
137137
*
138138
* \see https://github.com/easylogging/easyloggingpp#logging-flags
139139
*/
140-
static void set_logging_flags()
140+
inline static void set_logging_flags()
141141
{
142142
el::Loggers::addFlag(el::LoggingFlag::NewLineForContainer);
143143
el::Loggers::addFlag(el::LoggingFlag::LogDetailedCrashReason);
@@ -149,9 +149,9 @@ namespace pfasst
149149
}
150150

151151
#ifdef NDEBUG
152-
static void test_logging_levels() {}
152+
inline static void test_logging_levels() {}
153153
#else
154-
static void test_logging_levels()
154+
inline static void test_logging_levels()
155155
{
156156
cout << "### Example of different Logging Levels:" << endl;
157157
LOG(INFO) << "info";
@@ -176,7 +176,7 @@ namespace pfasst
176176
* \param[in] argc number of command line arguments
177177
* \param[in] argv command line arguments
178178
*/
179-
static void start_log(int argc, char** argv)
179+
inline static void start_log(int argc, char** argv)
180180
{
181181
_START_EASYLOGGINGPP(argc, argv);
182182
set_logging_flags();

include/pfasst/quadrature.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ namespace pfasst
111111
// note: GCC fails with "error: explicit template specialization cannot have a storage class"
112112
// if this template specialization is also declared 'static'; Clang does not care.
113113
template<>
114-
pfasst::quadrature::QuadratureType get_value(const string& name)
114+
inline pfasst::quadrature::QuadratureType get_value(const string& name)
115115
{
116116
const string type = Options::get_instance().get_variables_map()[name].as<string>();
117117
if (type == "gauss-lobatto") {
@@ -132,8 +132,8 @@ namespace pfasst
132132
// note: GCC fails with "error: explicit template specialization cannot have a storage class"
133133
// if this template specialization is also declared 'static'; Clang does not care.
134134
template<>
135-
pfasst::quadrature::QuadratureType get_value(const string& name,
136-
const pfasst::quadrature::QuadratureType& default_value)
135+
inline pfasst::quadrature::QuadratureType get_value(const string& name,
136+
const pfasst::quadrature::QuadratureType& default_value)
137137
{
138138
if (Options::get_instance().get_variables_map().count(name) == 1) {
139139
return pfasst::config::get_value<pfasst::quadrature::QuadratureType>(name);

0 commit comments

Comments
 (0)