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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 1 addition & 5 deletions 3d-models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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]) {
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions barriers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 0 additions & 3 deletions earcut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 1 addition & 4 deletions rulegen3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -1761,4 +1758,4 @@ auto hook3 = addHook(hooks_args, 100, readRuleArgs3);
EX }
#endif

}
}
Loading