Skip to content

Commit 4c39f89

Browse files
committed
Fix -Wunused-but-set-variable warnings from Clang
1 parent 410b33e commit 4c39f89

File tree

5 files changed

+3
-18
lines changed

5 files changed

+3
-18
lines changed

3d-models.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,6 @@ void geometry_information::make_revolution_cut(hpcshape &sh, int each, ld push,
548548

549549
auto gbody = body;
550550

551-
int it = 0;
552-
553551
vector<int> nextid(n);
554552
vector<int> lastid(n);
555553
vector<bool> stillin(n, true);
@@ -558,7 +556,6 @@ void geometry_information::make_revolution_cut(hpcshape &sh, int each, ld push,
558556
nextid[n-1] = n-1; lastid[0] = 0;
559557

560558
while(true) {
561-
it++;
562559
int cand = -1;
563560
ld cv = 0;
564561
for(int i=1; i<n-1; i++) if(stillin[i]) {
@@ -787,7 +784,6 @@ void geometry_information::adjust_eye(hpcshape& eye, hpcshape head, ld shift_eye
787784
hyperpoint pscenter = psmin(center);
788785

789786
ld pos = 0;
790-
int qty = 0, qtyall = 0;
791787

792788
vector<hyperpoint> pss;
793789

@@ -800,8 +796,7 @@ void geometry_information::adjust_eye(hpcshape& eye, hpcshape head, ld shift_eye
800796
ld mindist = 1e9;
801797
for(int i=0; i<isize(pss); i+=3) if(pss[i][2] < zmid || (WDIM == 3 && !gproduct)) {
802798
ld d = sqhypot_d(2, pss[i]-pscenter) + sqhypot_d(2, pss[i+1]-pscenter) + sqhypot_d(2, pss[i+2]-pscenter);
803-
if(d < mindist) mindist = d, pos = min(min(pss[i][2], pss[i+1][2]), pss[i+2][2]), qty++;
804-
qtyall++;
799+
if(d < mindist) mindist = d, pos = min(min(pss[i][2], pss[i+1][2]), pss[i+2][2]);
805800
}
806801

807802
if(&eye == &shSkullEyes) cgi.eyelevel_human = pos = zc(eyepos) - 0.06 * SH * 0.05;

barriers.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,8 +1039,6 @@ EX bool valid_dir(const vector<char>& ad, int j, cell *c) {
10391039
int a = 0;
10401040
for(auto& dd: ad1) if(dd == 1) a++;
10411041

1042-
int a0 = 0;
1043-
for(auto& dd: ad) if(dd == 1) a0++;
10441042
return a < 6;
10451043
}
10461044

checkmove.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ EX void create_yasc_message() {
339339
bool in_ctx = true;
340340

341341
set<string> blocks;
342-
int index = 0;
343342
for(auto c: all) {
344343
if(c.type == miENTITY && !captures.count({c.where, blocking_monster_name(c)})) blocks.insert(blocking_monster_name(c));
345344
else if(c.type == miWALL && c.subtype == siMONSTER && !captures.count({c.where, blocking_monster_name(c)})) blocks.insert(blocking_monster_name(c));
@@ -359,7 +358,6 @@ EX void create_yasc_message() {
359358
else if(c.where && c.where->wall != cwt.at->wall) blocks.insert(dnameof(c.where->wall));
360359
}
361360
else if(c.type == siWARP) blocks.insert("warp");
362-
index++;
363361
}
364362

365363
if(!blocks.empty()) {
@@ -481,4 +479,4 @@ EX void checkmove() {
481479
}
482480

483481

484-
}
482+
}

earcut.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,8 @@ void Earcut<N>::earcutLinked(Node* ear, int pass) {
280280
Node* prev;
281281
Node* next;
282282

283-
int iterations = 0;
284-
285283
// iterate through ears, slicing them one by one
286284
while (ear->prev != ear->next) {
287-
iterations++;
288285
prev = ear->prev;
289286
next = ear->next;
290287

rulegen3.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,9 +1288,6 @@ EX void test_transducers() {
12881288
swap(cum, result);
12891289
ctid = t_origin[ctid].at->cmove(c)->id;
12901290
}
1291-
int err = 0;
1292-
for(auto duc: cum) for(auto p: duc.second.t)
1293-
if(p.first.first == ENDED || p.first.second != p.first.first) err++;
12941291
throw_identity_errors(cum, cyc.dirs);
12951292
if(id_size != isize(cum)) println(hlog, "error: identity not recovered correctly");
12961293
}
@@ -1761,4 +1758,4 @@ auto hook3 = addHook(hooks_args, 100, readRuleArgs3);
17611758
EX }
17621759
#endif
17631760

1764-
}
1761+
}

0 commit comments

Comments
 (0)