Skip to content

Commit

Permalink
Fix some initialization list reordering warnings
Browse files Browse the repository at this point in the history
Continues work on #347.
  • Loading branch information
garfieldnate committed Mar 7, 2024
1 parent 729743d commit 9f1da2c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 45 deletions.
42 changes: 21 additions & 21 deletions Core/CLI/src/cli_Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace cli
class AliasCommand : public cli::ParserCommand
{
public:
explicit AliasCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit AliasCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~AliasCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -84,7 +84,7 @@ namespace cli
class CDCommand : public cli::ParserCommand
{
public:
explicit CDCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit CDCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~CDCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -119,7 +119,7 @@ namespace cli
class DebugCommand : public cli::ParserCommand
{
public:
explicit DebugCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit DebugCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~DebugCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -151,7 +151,7 @@ namespace cli
class DirsCommand : public cli::ParserCommand
{
public:
explicit DirsCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit DirsCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~DirsCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand All @@ -176,7 +176,7 @@ namespace cli
class EchoCommand : public cli::ParserCommand
{
public:
explicit EchoCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit EchoCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~EchoCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -236,7 +236,7 @@ namespace cli
class EpMemCommand : public cli::ParserCommand
{
public:
explicit EpMemCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit EpMemCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~EpMemCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -420,7 +420,7 @@ namespace cli
class GPCommand : public cli::ParserCommand
{
public:
explicit GPCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit GPCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~GPCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -455,7 +455,7 @@ namespace cli
class HelpCommand : public cli::ParserCommand
{
public:
explicit HelpCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit HelpCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~HelpCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand All @@ -481,7 +481,7 @@ namespace cli
class LearnCommand : public cli::ParserCommand
{
public:
explicit LearnCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit LearnCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~LearnCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -583,7 +583,7 @@ namespace cli
class LSCommand : public cli::ParserCommand
{
public:
explicit LSCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit LSCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~LSCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -613,7 +613,7 @@ namespace cli
class PopDCommand : public cli::ParserCommand
{
public:
explicit PopDCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit PopDCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~PopDCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -643,7 +643,7 @@ namespace cli
class PreferencesCommand : public cli::ParserCommand
{
public:
explicit PreferencesCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit PreferencesCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~PreferencesCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -741,7 +741,7 @@ namespace cli
class PrintCommand : public cli::ParserCommand
{
public:
explicit PrintCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit PrintCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~PrintCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -917,7 +917,7 @@ namespace cli
class PushDCommand : public cli::ParserCommand
{
public:
explicit PushDCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit PushDCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~PushDCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -951,7 +951,7 @@ namespace cli
class PWDCommand : public cli::ParserCommand
{
public:
explicit PWDCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit PWDCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~PWDCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -981,7 +981,7 @@ namespace cli
class RLCommand : public cli::ParserCommand
{
public:
explicit RLCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit RLCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~RLCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -1110,7 +1110,7 @@ namespace cli
class RunCommand : public cli::ParserCommand
{
public:
explicit RunCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit RunCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~RunCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -1250,7 +1250,7 @@ namespace cli
class SMemCommand : public cli::ParserCommand
{
public:
explicit SMemCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit SMemCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~SMemCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -1484,7 +1484,7 @@ namespace cli
class SPCommand : public cli::ParserCommand
{
public:
explicit SPCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit SPCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~SPCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -1520,7 +1520,7 @@ namespace cli
class StatsCommand : public cli::ParserCommand
{
public:
explicit StatsCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit StatsCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~StatsCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down Expand Up @@ -1633,7 +1633,7 @@ namespace cli
class SVSCommand : public cli::ParserCommand
{
public:
explicit SVSCommand(cli::CommandLineInterface& cli) : cli(cli), ParserCommand() {}
explicit SVSCommand(cli::CommandLineInterface& cli) : ParserCommand(), cli(cli) {}
~SVSCommand() override = default;
[[nodiscard]] const char* GetString() const override
{
Expand Down
32 changes: 16 additions & 16 deletions Core/SVS/src/cliproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class cliproxy
}
cliproxy& set_help(const std::string& t);
cliproxy& add_arg(const std::string& arg, const std::string& help);

private:
void list_children(int level, std::ostream& os);
void print_help(std::ostream& os) const;

virtual void proxy_get_children(std::map<std::string, cliproxy*>& c) {}
virtual void proxy_use_sub(const std::vector<std::string>& args, std::ostream& os)
{
list_children(0, os);
}

std::string help_text;
std::vector<std::string> args_help;
};
Expand All @@ -40,7 +40,7 @@ class int_proxy : public cliproxy
{
return true;
}

private:
int* p;
};
Expand All @@ -54,7 +54,7 @@ class float_proxy : public cliproxy
{
return true;
}

private:
double* p;
};
Expand All @@ -68,7 +68,7 @@ class bool_proxy : public cliproxy
{
return true;
}

private:
bool* p;
};
Expand All @@ -81,12 +81,12 @@ class memfunc_proxy : public cliproxy
typedef void (T::*fout_ptr)(std::ostream& os);
typedef void (T::*fargc_ptr)(const std::vector<std::string>& args, std::ostream& os) const;
typedef void (T::*foutc_ptr)(std::ostream& os) const;
memfunc_proxy(T* p, farg_ptr f) : p(p), pc(NULL), farg(f), fargc(NULL), fout(NULL), foutc(NULL) {}
memfunc_proxy(T* p, fout_ptr f) : p(p), pc(NULL), farg(NULL), fargc(NULL), fout(f), foutc(NULL) {}
memfunc_proxy(const T* p, fargc_ptr f) : p(NULL), pc(p), farg(NULL), fargc(f), fout(NULL), foutc(NULL) {}
memfunc_proxy(const T* p, foutc_ptr f) : p(NULL), pc(p), farg(NULL), fargc(NULL), fout(NULL), foutc(f) {}

memfunc_proxy(T* p, farg_ptr f) : p(p), pc(NULL), farg(f), fout(NULL), fargc(NULL), foutc(NULL) {}
memfunc_proxy(T* p, fout_ptr f) : p(p), pc(NULL), farg(NULL), fargc(NULL), fout(f), foutc(NULL) {}
memfunc_proxy(const T* p, fargc_ptr f) : p(NULL), pc(p), farg(NULL), fargc(f), fout(NULL), foutc(NULL) {}
memfunc_proxy(const T* p, foutc_ptr f) : p(NULL), pc(p), farg(NULL), fout(NULL), fargc(NULL), foutc(f) {}

void proxy_use_sub(const std::vector<std::string>& args, std::ostream& os)
{
if (farg)
Expand All @@ -106,12 +106,12 @@ class memfunc_proxy : public cliproxy
(pc->*foutc)(os);
}
}

bool temporary() const
{
return true;
}

private:
T* p;
const T* pc;
Expand All @@ -130,10 +130,10 @@ class proxy_group : public cliproxy
{
return true;
}

private:
void proxy_get_children(std::map<std::string, cliproxy*>& c);

std::map<std::string, cliproxy*> children;
};

Expand Down
12 changes: 6 additions & 6 deletions Core/SoarKernel/src/shared/mempool_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ namespace soar_module
typedef const T& const_reference;

public:
soar_memory_pool_allocator() : mem_pool(NULL), memory_manager(NULL)
soar_memory_pool_allocator() : memory_manager(NULL), mem_pool(NULL)
{
memory_manager = &(Memory_Manager::Get_MPM());
mem_pool = memory_manager->get_memory_pool(sizeof(value_type));
}

soar_memory_pool_allocator(agent* new_agent): mem_pool(NULL), memory_manager(NULL)
soar_memory_pool_allocator(agent* new_agent): memory_manager(NULL), mem_pool(NULL)
{
// useful for debugging
// std::string temp_this( typeid( value_type ).name() );
memory_manager = &(Memory_Manager::Get_MPM());
mem_pool = memory_manager->get_memory_pool(sizeof(value_type));
}

soar_memory_pool_allocator(const soar_memory_pool_allocator& obj): mem_pool(NULL), memory_manager(NULL)
soar_memory_pool_allocator(const soar_memory_pool_allocator& obj): memory_manager(NULL), mem_pool(NULL)
{
// useful for debugging
// std::string temp_this( typeid( value_type ).name() );
Expand All @@ -75,7 +75,7 @@ namespace soar_module
}

template <class _other>
soar_memory_pool_allocator(const soar_memory_pool_allocator<_other>& other): mem_pool(NULL), memory_manager(NULL)
soar_memory_pool_allocator(const soar_memory_pool_allocator<_other>& other): memory_manager(NULL), mem_pool(NULL)
{
// useful for debugging
// std::string temp_this( typeid( T ).name() );
Expand Down Expand Up @@ -159,13 +159,13 @@ namespace soar_module
typedef const T& const_reference;

public:
soar_memory_pool_allocator_n() : mem_pool(NULL), memory_manager(NULL)
soar_memory_pool_allocator_n() : memory_manager(NULL), mem_pool(NULL)
{
memory_manager = &(Memory_Manager::Get_MPM());
mem_pool = memory_manager->get_memory_pool(sizeof(value_type));
}

soar_memory_pool_allocator_n(agent* new_agent): mem_pool(NULL), memory_manager(NULL)
soar_memory_pool_allocator_n(agent* new_agent): memory_manager(NULL), mem_pool(NULL)
{
// useful for debugging
// std::string temp_this( typeid( value_type ).name() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ struct wme_val_stats {
double mean;
double sum_square;

wme_val_stats(): count(0), sum(0.0), product(1.0), mean(0.0), sum_square(0.0), min(DBL_MAX), max(-DBL_MAX) { }
wme_val_stats(): count(0), sum(0.0), product(1.0), min(DBL_MAX), max(-DBL_MAX), mean(0.0), sum_square(0.0) { }
};

/*
Expand Down
2 changes: 1 addition & 1 deletion Core/shared/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class soar_timer
{
public:
soar_timer()
: enabled_ptr(NULL), t1(0), elapsed(0)
: t1(0), elapsed(0), enabled_ptr(NULL)
{
raw_per_usec = get_raw_time_per_usec();
}
Expand Down

0 comments on commit 9f1da2c

Please sign in to comment.