Skip to content

Commit 679afea

Browse files
authored
Merge pull request #5664 from ab9rf/constexpr-in-core
use `constexpr` in `Core` where possible
2 parents 858b05f + 8f5aa08 commit 679afea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/Core.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ uint32_t PerfCounters::getUnpausedFps() {
201201

202202
struct CommandDepthCounter
203203
{
204-
static const int MAX_DEPTH = 20;
204+
static constexpr int MAX_DEPTH = 20;
205205
static thread_local int depth;
206206
CommandDepthCounter() { depth++; }
207207
~CommandDepthCounter() { depth--; }
@@ -902,8 +902,8 @@ command_result Core::runCommand(color_ostream &con, const std::string &first_, s
902902
}
903903
else if (first == "plug")
904904
{
905-
const char *header_format = "%30s %10s %4s %8s\n";
906-
const char *row_format = "%30s %10s %4i %8s\n";
905+
constexpr auto header_format = "%30s %10s %4s %8s\n";
906+
constexpr auto row_format = "%30s %10s %4zu %8s\n";
907907
con.print(header_format, "Name", "State", "Cmds", "Enabled");
908908

909909
plug_mgr->refresh();
@@ -1601,7 +1601,7 @@ bool Core::InitMainThread() {
16011601
{
16021602
if (!Version::git_xml_match())
16031603
{
1604-
const char *msg = (
1604+
constexpr auto msg = (
16051605
"*******************************************************\n"
16061606
"* BIG, UGLY ERROR MESSAGE *\n"
16071607
"*******************************************************\n"

0 commit comments

Comments
 (0)