diff --git a/Makefile b/Makefile index f37f5bde..867582c4 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ ifeq (${TOOLCHAIN},clang) CXXFLAGS_STD = -std=c++11 CXXFLAGS_EARLY += -fPIC CXXFLAGS_EARLY += -W -Wall -Wextra -Wsuggest-override -pedantic - CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-unknown-warning-option + CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-char-subscripts -Wno-unknown-warning-option CXXFLAGS_EARLY += -Wno-invalid-offsetof endif diff --git a/archimedean.cpp b/archimedean.cpp index 1acebb0a..8554ce7d 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -1314,7 +1314,7 @@ EX void show() { } else { tested.coloring = col; - tilings.push_back(move(tested)); + tilings.push_back(std::move(tested)); /* sort(tilings.begin(), tilings.end(), [] (archimedean_tiling& s1, archimedean_tiling& s2) { if(s1.euclidean_angle_sum < s2.euclidean_angle_sum - 1e-6) return true; if(s2.euclidean_angle_sum < s1.euclidean_angle_sum - 1e-6) return false; diff --git a/complex.cpp b/complex.cpp index 2bf761c5..685d331c 100644 --- a/complex.cpp +++ b/complex.cpp @@ -2082,7 +2082,7 @@ EX namespace heat { } } - offscreen_heat = move(offscreen2); + offscreen_heat = std::move(offscreen2); for(int i=0; i S7) remove_half_dimension(); diff --git a/drawing.cpp b/drawing.cpp index 17ddc267..96921ec1 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -2206,13 +2206,13 @@ EX void sort_drawqueue() { #if MINIMIZE_GL_CALLS map>> subqueue; - for(auto& p: ptds) subqueue[(p->prio == PPR::CIRCLE || p->prio == PPR::OUTCIRCLE) ? 0 : p->outline_group()].push_back(move(p)); + for(auto& p: ptds) subqueue[(p->prio == PPR::CIRCLE || p->prio == PPR::OUTCIRCLE) ? 0 : p->outline_group()].push_back(std::move(p)); ptds.clear(); - for(auto& p: subqueue) for(auto& r: p.second) ptds.push_back(move(r)); + for(auto& p: subqueue) for(auto& r: p.second) ptds.push_back(std::move(r)); subqueue.clear(); - for(auto& p: ptds) subqueue[(p->prio == PPR::CIRCLE || p->prio == PPR::OUTCIRCLE) ? 0 : p->color].push_back(move(p)); + for(auto& p: ptds) subqueue[(p->prio == PPR::CIRCLE || p->prio == PPR::OUTCIRCLE) ? 0 : p->color].push_back(std::move(p)); ptds.clear(); - for(auto& p: subqueue) for(auto& r: p.second) ptds.push_back(move(r)); + for(auto& p: subqueue) for(auto& r: p.second) ptds.push_back(std::move(r)); #endif for(auto& p: ptds) { @@ -2233,7 +2233,7 @@ EX void sort_drawqueue() { vector> ptds2; ptds2.resize(siz); - for(int i = 0; iprio)]++] = move(ptds[i]); + for(int i = 0; iprio)]++] = std::move(ptds[i]); swap(ptds, ptds2); } diff --git a/environment.cpp b/environment.cpp index 2bb2bad8..3e1c241d 100644 --- a/environment.cpp +++ b/environment.cpp @@ -859,7 +859,7 @@ EX void monstersTurn() { changes.value_keep(crush_now); changes.value_keep(crush_next); - crush_now = move(crush_next); + crush_now = std::move(crush_next); crush_next.clear(); DEBB(DF_TURN, ("heat")); diff --git a/expansion.cpp b/expansion.cpp index 60a534f9..57961ba8 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -190,7 +190,7 @@ void expansion_analyzer::reduce_grouping() { for(int i=0; i bestval) bestval = mindist, s.owner = c, s.p = h, s.relmatrices = move(relmatrices); + if(mindist > bestval) bestval = mindist, s.owner = c, s.p = h, s.relmatrices = std::move(relmatrices); } } make_cells_of_heptagon(); diff --git a/mapeditor.cpp b/mapeditor.cpp index 44c65867..6ce2d700 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -2371,7 +2371,7 @@ EX namespace mapeditor { } if(uni == 'c') dsCur->list.push_back(best); else if(uni == 'd') { - vector oldlist = move(dsCur->list); + vector oldlist = std::move(dsCur->list); dsCur->list.clear(); int i; for(i=0; i void store_ptr(T& x) { - T* copy; if(mode == 0) { - copy = new T; - *copy = move(x); + T* copy = new T(std::move(x)); + store(copy); } - store(copy); - if(mode != 0) { - x = move(*copy); + else { + T* copy = nullptr; + store(copy); + x = std::move(*copy); delete copy; } } diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 3bbc0e36..793e763d 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -88,11 +88,11 @@ EX namespace sn { FILE *f = fopen(fname.c_str(), "rb"); if(!f) f = fopen((rsrcdir + fname).c_str(), "rb"); if(!f) { addMessage(XLAT("geodesic table missing")); pmodel = mdPerspective; return; } - ignore(fread(&PRECX, 4, 1, f)); - ignore(fread(&PRECY, 4, 1, f)); - ignore(fread(&PRECZ, 4, 1, f)); + hr::ignore(fread(&PRECX, 4, 1, f)); + hr::ignore(fread(&PRECY, 4, 1, f)); + hr::ignore(fread(&PRECZ, 4, 1, f)); tab.resize(PRECX * PRECY * PRECZ); - ignore(fread(&tab[0], sizeof(compressed_point) * PRECX * PRECY * PRECZ, 1, f)); + hr::ignore(fread(&tab[0], sizeof(compressed_point) * PRECX * PRECY * PRECZ, 1, f)); fclose(f); loaded = true; } diff --git a/reg3.cpp b/reg3.cpp index ec16ad81..0d795e01 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -1231,7 +1231,7 @@ EX namespace reg3 { nb.insert(v - by * (v[index] / by[index])); else println(hlog, "error"); - boundaries = move(nb); + boundaries = std::move(nb); break; } } diff --git a/rogueviz/banachtarski.cpp b/rogueviz/banachtarski.cpp index 31e9da08..6fac863f 100644 --- a/rogueviz/banachtarski.cpp +++ b/rogueviz/banachtarski.cpp @@ -389,17 +389,17 @@ void bantar_frame() { drawthemap(); if(0) for(auto p: parent) if(gmatrix.count(p.first) && gmatrix.count(p.second) && infos[p.first].gid == i && infos[p.second].gid == i) queueline(tC0(gmatrix[p.first]), tC0(gmatrix[p.second]), 0xFFFFFFFF, 2); - subscr[i] = move(ptds); + subscr[i] = std::move(ptds); } map>>> xptds; for(int i=0; i<4; i++) for(auto& p: subscr[i]) - xptds[int(p->prio)][i].push_back(move(p)); + xptds[int(p->prio)][i].push_back(std::move(p)); for(auto& sm: xptds) for(auto& sm2: sm.second) { int i = sm2.first; ptds.clear(); - for(auto& p: sm2.second) ptds.push_back(move(p)); + for(auto& p: sm2.second) ptds.push_back(std::move(p)); pconf.scale = .5; pconf.xposition = (!(i&2)) ? xdst : -xdst; diff --git a/rogueviz/dynamic-wfc.cpp b/rogueviz/dynamic-wfc.cpp index 3cfb792c..8ddad074 100644 --- a/rogueviz/dynamic-wfc.cpp +++ b/rogueviz/dynamic-wfc.cpp @@ -313,7 +313,7 @@ void wfc() { nfreq.emplace_back(p); nfreq.back().code |= (code_t(c) << sh); } - freq = move(nfreq); + freq = std::move(nfreq); nfreq = {}; // println(hlog, "inpath = ", inpath); // println(hlog, "freqs = ", isize(freq)); diff --git a/rogueviz/gobot.cpp b/rogueviz/gobot.cpp index 0d01a18a..96808e58 100644 --- a/rogueviz/gobot.cpp +++ b/rogueviz/gobot.cpp @@ -157,8 +157,8 @@ void clean_old_shots() { sh.get().delete_message(); } else - remaining.emplace_back(move(sh)); - old_shots = move(remaining); + remaining.emplace_back(std::move(sh)); + old_shots = std::move(remaining); */ } @@ -533,10 +533,9 @@ void go_menu() { else if(current.owner[i] != Free) owned_by[current.owner[i]]++; - shstream ss; - println(ss, "black: ", stones[0], " stones, ", owned_by[0], " area, ", current.captures[1], " prisoners"); - println(ss, "white: ", stones[1], " stones, ", owned_by[1], " area, ", current.captures[0], " prisoners"); - + shstream ss; + println(ss, "black: ", stones[0], " stones, ", owned_by[0], " area, ", current.captures[1], " prisoners"); + println(ss, "white: ", stones[1], " stones, ", owned_by[1], " area, ", current.captures[0], " prisoners"); dialog::addSelItem("play black", its(stones[0]), 'b'); dialog::add_action([] { try_to_play(mouse_label(), 0); }); @@ -610,8 +609,7 @@ auto gobot_hook = shot_state = 2; } return false; - }); - + }) ; #endif diff --git a/rogueviz/nil-compass.cpp b/rogueviz/nil-compass.cpp index 34d0d3cc..7fc95148 100644 --- a/rogueviz/nil-compass.cpp +++ b/rogueviz/nil-compass.cpp @@ -90,22 +90,22 @@ bool draw_compass(cell *c, const shiftmatrix& V) { } poly_outline = 0; - for(auto& [col, i, is, sh]: shapes) { + for(const auto& s: shapes) { ld t = 36 + (ticks - zeroticks) / 1000.; auto remap = [&] (int _i, int _is) { - if(i == _i && is == _is) return col; - int c = part(col, 1) + part(col, 2) + part(col, 3); + if(s.i == _i && s.is == _is) return col; + int c = part(s.col, 1) + part(s.col, 2) + part(s.col, 3); c += 1; c /= 12; - color_t col1 = col; + color_t col1 = s.col; part(col1, 1) = part(col1, 2) = part(col1, 3) = c; - return gradient(col, col1, 0, 0.9, 1); + return gradient(s.col, col1, 0, 0.9, 1); }; vector> clist = { - {36, col}, - {42.5, col}, + {36, s.col}, + {42.5, s.col}, {42.7, remap(1, -1)}, {43.9, remap(1, -1)}, {44.1, remap(0, +1)}, @@ -118,8 +118,8 @@ bool draw_compass(cell *c, const shiftmatrix& V) { {48.1, remap(2, -1)}, {48.3, remap(2, +1)}, {49.1, remap(2, +1)}, - {49.3, col}, - {99, col} + {49.3, s.col}, + {99, s.col} }; int step = 0; @@ -128,7 +128,7 @@ bool draw_compass(cell *c, const shiftmatrix& V) { auto t1 = ilerp(clist[step].first, clist[step+1].first, t); auto col1 = gradient(clist[step].second, clist[step+1].second, 0, smoothen(t1), 1); - queuepoly(V, sh, col1); + queuepoly(V, s.sh, col1); } return false; diff --git a/rogueviz/presentation.cpp b/rogueviz/presentation.cpp index 4f53394b..11e4ef21 100644 --- a/rogueviz/presentation.cpp +++ b/rogueviz/presentation.cpp @@ -160,7 +160,7 @@ string gen_latex(presmode mode, string s, int res) { string filename = format("latex-cache/%08X.png", hash); if(mode == pmStartAll) { if(!file_exists(filename)) { - system("mkdir latex-cache"); + hr::ignore(system("mkdir latex-cache")); FILE *f = fopen("latex-cache/rogueviz-latex.tex", "w"); fprintf(f, "\\documentclass[border=2pt]{standalone}\n" @@ -172,9 +172,9 @@ string gen_latex(presmode mode, string s, int res) { "\\end{varwidth}\n" "\\end{document}\n", s.c_str()); fclose(f); - system("cd latex-cache; pdflatex rogueviz-latex.tex"); + hr::ignore(system("cd latex-cache; pdflatex rogueviz-latex.tex")); string pngline = "cd latex-cache; pdftopng -r " + its(res) + " rogueviz-latex.pdf t"; - system(pngline.c_str()); + hr::ignore(system(pngline.c_str())); rename("latex-cache/t-000001.png", filename.c_str()); } } @@ -542,9 +542,8 @@ int runslide = arg::add3("-slides", [] { + arg::add3("-presangle", [] { arg::shift_arg_formula(angle); dir = 0; - }); + }) ; - } #endif } diff --git a/rogueviz/rewriting.cpp b/rogueviz/rewriting.cpp index c1260b92..c77e0a6f 100644 --- a/rogueviz/rewriting.cpp +++ b/rogueviz/rewriting.cpp @@ -39,7 +39,7 @@ struct hrmap_rewrite : hrmap_hyperbolic { map > asg; map, heptagon*> asg_rev; - heptagon *create_step(heptagon *h, int direction) { + heptagon *create_step(heptagon *h, int direction) override { if(h->move(direction)) return h->move(direction); if(asg.empty()) { asg[h] = {h, start}; h->zebraval = 0; } diff --git a/rogueviz/som/analyzer.cpp b/rogueviz/som/analyzer.cpp index 41dcf7f1..e2dacec4 100644 --- a/rogueviz/som/analyzer.cpp +++ b/rogueviz/som/analyzer.cpp @@ -36,13 +36,13 @@ void load_maniset(maniset& m, int scale) { m.names.push_back(buf); auto& md = m.mdata[buf]; int N, M; - fscanf(f, "%d%d", &N, &M); + hr::ignore(fscanf(f, "%d%d", &N, &M)); println(hlog, "reading ", buf, " of size ", N, " and ", M, " edges"); md.size = N; auto& ed = md.edges; for(int i=0; idexp_id = it++; - vector mesh = move(rug::points); - vector old_triangles = move(rug::triangles); + vector mesh = std::move(rug::points); + vector old_triangles = std::move(rug::triangles); rug::clear_model(); diff --git a/textures.cpp b/textures.cpp index 5a747348..c52aed0e 100644 --- a/textures.cpp +++ b/textures.cpp @@ -979,7 +979,7 @@ string tes; void init_textureconfig() { #if CAP_CONFIG - texturesavers = move(savers); + texturesavers = std::move(savers); for(int i=0; i<3; i++) for(int j=0; j<3; j++) addsaver(config.itt[i][j], "texturematrix_" + its(i) + its(j), i==j ? 1 : 0); @@ -1131,10 +1131,10 @@ bool texture_config::load() { models::configure(); drawthemap(); config.tstate = config.tstate_max = tsActive; - string s = move(texture_tuner); + string s = std::move(texture_tuner); perform_mapping(); - texture_tuner = move(s); + texture_tuner = std::move(s); if(texture_tuner != "") { texture_tuned = true; @@ -1665,7 +1665,7 @@ void texture_config::true_remap() { if(GOLDBERG || IRREGULAR) pshift += si.dir; mapTexture(c, mi2, si, ggmatrix(c), pshift); mapTexture2(mi2); - mi2.tvertices = move(new_tvertices); + mi2.tvertices = std::move(new_tvertices); // printf("%08x remapping %d vertices to %d vertices\n", si.id, isize(mi.tvertices), isize(mi2.tvertices)); } catch(out_of_range&) {