Skip to content

Commit

Permalink
Make Args::Table::Terminator a constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme committed Aug 2, 2024
1 parent 319d8c7 commit 1f19782
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions include/caliper/tools-util/Args.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class Args {
bool has_argument;

const char* info;
const char* argument_info;

static const Table Terminator;
const char* argument_info;
};

static constexpr Table Terminator = { nullptr, nullptr, 0, false, nullptr, nullptr };

Args();

Args(const Table table[]);
Expand Down
2 changes: 1 addition & 1 deletion src/tools/cali-query/cali-query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace
"List global run metadata. Use with -j, -t, etc. to select output format.",
nullptr
},
Args::Table::Terminator
Args::Terminator
};

/// A node record filter that filters redundant identical node records.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/cali-stat/cali-stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace
},
{ "output", "output", 'o', true, "Set the output file name", "FILE" },
{ "help", "help", 'h', false, "Print help message", nullptr },
Args::Table::Terminator
Args::Terminator
};

class ReuseStat {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/mpi-caliquery/mpi-caliquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const Args::Table option_table[] = {
{ "verbose", "verbose", 'v', false, "Be verbose.", nullptr },
{ "help", "help", 'h', true, "Print help message", nullptr },
{ "output", "output", 'o', true, "Set the output file name", "FILE" },
Args::Table::Terminator
Args::Terminator
};


Expand Down
2 changes: 0 additions & 2 deletions src/tools/util/Args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
using namespace std;
using namespace util;

const Args::Table Args::Table::Terminator { 0, 0, 0, false, 0, 0 };

struct Args::ArgsImpl
{
vector<Args::Table> m_options; ///< Option list
Expand Down
2 changes: 1 addition & 1 deletion test/cali-annotation-perftest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int main(int argc, char* argv[])
{ "quiet", "quiet", 'q', false, "Don't print output", nullptr },
{ "help", "help", 'h', false, "Print help", nullptr },

util::Args::Table::Terminator
util::Args::Terminator
};

// --- initialization
Expand Down
2 changes: 1 addition & 1 deletion test/cali-flush-perftest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int main(int argc, char* argv[])

{ "help", "help", 'h', false, "Print help", nullptr },

util::Args::Table::Terminator
util::Args::Terminator
};

// --- Initialization
Expand Down

0 comments on commit 1f19782

Please sign in to comment.