1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 06:27:17 +00:00

Fix -Wunused-but-set-variable warnings from Clang

This commit is contained in:
Arthur O'Dwyer 2023-08-23 09:20:28 -08:00
parent b70b339f52
commit 9fe2c0dcf1
4 changed files with 2 additions and 15 deletions

View File

@ -548,8 +548,6 @@ void geometry_information::make_revolution_cut(hpcshape &sh, int each, ld push,
auto gbody = body;
int it = 0;
vector<int> nextid(n);
vector<int> lastid(n);
vector<bool> stillin(n, true);
@ -558,7 +556,6 @@ void geometry_information::make_revolution_cut(hpcshape &sh, int each, ld push,
nextid[n-1] = n-1; lastid[0] = 0;
while(true) {
it++;
int cand = -1;
ld cv = 0;
for(int i=1; i<n-1; i++) if(stillin[i]) {
@ -787,7 +784,7 @@ void geometry_information::adjust_eye(hpcshape& eye, hpcshape head, ld shift_eye
hyperpoint pscenter = psmin(center);
ld pos = 0;
int qty = 0, qtyall = 0;
int qty = 0;
vector<hyperpoint> pss;
@ -801,7 +798,6 @@ void geometry_information::adjust_eye(hpcshape& eye, hpcshape head, ld shift_eye
for(int i=0; i<isize(pss); i+=3) if(pss[i][2] < zmid || (WDIM == 3 && !gproduct)) {
ld d = sqhypot_d(2, pss[i]-pscenter) + sqhypot_d(2, pss[i+1]-pscenter) + sqhypot_d(2, pss[i+2]-pscenter);
if(d < mindist) mindist = d, pos = min(min(pss[i][2], pss[i+1][2]), pss[i+2][2]), qty++;
qtyall++;
}
if(&eye == &shSkullEyes) cgi.eyelevel_human = pos = zc(eyepos) - 0.06 * SH * 0.05;

View File

@ -976,9 +976,6 @@ EX bool valid_dir(const vector<char>& ad, int j, cell *c) {
auto ad1 = currentmap->get_cellshape(c).dirdist[j];
int a = 0;
for(auto& dd: ad1) if(dd == 1) a++;
int a0 = 0;
for(auto& dd: ad) if(dd == 1) a0++;
return a < 6;
}

View File

@ -280,11 +280,8 @@ void Earcut<N>::earcutLinked(Node* ear, int pass) {
Node* prev;
Node* next;
int iterations = 0;
// iterate through ears, slicing them one by one
while (ear->prev != ear->next) {
iterations++;
prev = ear->prev;
next = ear->next;

View File

@ -1288,9 +1288,6 @@ EX void test_transducers() {
swap(cum, result);
ctid = t_origin[ctid].at->cmove(c)->id;
}
int err = 0;
for(auto duc: cum) for(auto p: duc.second.t)
if(p.first.first == ENDED || p.first.second != p.first.first) err++;
throw_identity_errors(cum, cyc.dirs);
if(id_size != isize(cum)) println(hlog, "error: identity not recovered correctly");
}
@ -1761,4 +1758,4 @@ auto hook3 = addHook(hooks_args, 100, readRuleArgs3);
EX }
#endif
}
}