Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change static const to static constexpr wherever possible #343

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions archimedean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ struct archimedean_tiling {
#endif

#if HDR
static const int sfPH = 1;
static const int sfLINE = 2;
static const int sfCHESS = 4;
static const int sfTHREE = 8;
static const int sfSEMILINE = 16;
static constexpr int sfPH = 1;
static constexpr int sfLINE = 2;
static constexpr int sfCHESS = 4;
static constexpr int sfTHREE = 8;
static constexpr int sfSEMILINE = 16;
#endif

#if CAP_ARCM
Expand Down
18 changes: 9 additions & 9 deletions cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,9 @@ EX int celldist(cell *c) {
}

#if HDR
static const int ALTDIST_BOUNDARY = 99999;
static const int ALTDIST_UNKNOWN = 99998;
static const int ALTDIST_ERROR = 90000;
static constexpr int ALTDIST_BOUNDARY = 99999;
static constexpr int ALTDIST_UNKNOWN = 99998;
static constexpr int ALTDIST_ERROR = 90000;
#endif

EX int celldistAlt(cell *c) {
Expand Down Expand Up @@ -863,12 +863,12 @@ EX int updir_alt(heptagon *h) {


#if HDR
static const int RPV_MODULO = 5;
static const int RPV_RAND = 0;
static const int RPV_ZEBRA = 1;
static const int RPV_EMERALD = 2;
static const int RPV_PALACE = 3;
static const int RPV_CYCLE = 4;
static constexpr int RPV_MODULO = 5;
static constexpr int RPV_RAND = 0;
static constexpr int RPV_ZEBRA = 1;
static constexpr int RPV_EMERALD = 2;
static constexpr int RPV_PALACE = 3;
static constexpr int RPV_CYCLE = 4;
#endif

// x mod 5 = pattern type
Expand Down
4 changes: 2 additions & 2 deletions celldrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ inline void drawcell(cell *c, const shiftmatrix& V) {
}
#endif

static const int trapcol[4] = {0x904040, 0xA02020, 0xD00000, 0x303030};
static const int terracol[8] = {0xD000, 0xE25050, 0xD0D0D0, 0x606060, 0x303030, 0x181818, 0x0080, 0x8080};
static constexpr int trapcol[4] = {0x904040, 0xA02020, 0xD00000, 0x303030};
static constexpr int terracol[8] = {0xD000, 0xE25050, 0xD0D0D0, 0x606060, 0x303030, 0x181818, 0x0080, 0x8080};

void celldrawer::addaura() {
hr::addaura(tC0(V), darkened(aura_color), fd);
Expand Down
10 changes: 5 additions & 5 deletions checkmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ EX vector<bool> legalmoves;
EX vector<int> move_issues;

#if HDR
static const int miVALID = 10000;
static const int miENTITY = 11000;
static const int miRESTRICTED = 10100;
static const int miTHREAT = 10010;
static const int miWALL = 10001;
static constexpr int miVALID = 10000;
static constexpr int miENTITY = 11000;
static constexpr int miRESTRICTED = 10100;
static constexpr int miTHREAT = 10010;
static constexpr int miWALL = 10001;
#endif

EX int checked_move_issue;
Expand Down
Loading
Loading