From db762ff21a217f6d8a3be8c117ebbadb019fb3ed Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Sun, 11 Jul 2021 17:22:00 -0400 Subject: [PATCH] Fix or suppress a bunch of Clang warnings. NFCI. --- Makefile | 2 +- kite.cpp | 4 ++-- pattern2.cpp | 4 ++-- reg3.cpp | 22 +++++++++++----------- sphere.cpp | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index d74aade6..5f36d265 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ ifeq (${TOOLCHAIN},clang) CXXFLAGS_STD = -std=c++11 CXXFLAGS_EARLY += -march=native -fPIC CXXFLAGS_EARLY += -W -Wall -Wextra -Werror -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-unknown-warning-option -Wno-overloaded-virtual endif ifeq (${TOOLCHAIN},gcc) diff --git a/kite.cpp b/kite.cpp index 0f3dc6da..14d1531c 100644 --- a/kite.cpp +++ b/kite.cpp @@ -339,7 +339,7 @@ struct hrmap_kite : hrmap { return gm * where; } - virtual int wall_offset(cell *c) { + int wall_offset(cell *c) override { if(WDIM == 3) return kite::getshape(c->master) == kite::pKite ? 10 : 0; else @@ -426,4 +426,4 @@ auto hooksw = addHook(hooks_swapdim, 100, [] { if(kite::in() && currentmap) kite #endif }} - \ No newline at end of file + diff --git a/pattern2.cpp b/pattern2.cpp index efd83536..ae257c6d 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -664,10 +664,10 @@ EX namespace patterns { si.reflect = false; } else { - int ids = 0, tids = 0, td = 0; + int ids = 0, td = 0; for(int i=0; imove(2*i)->master->fieldval; - ids |= (1<move(2*i)->master->fieldval; diff --git a/reg3.cpp b/reg3.cpp index ddcc2559..37859474 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -649,7 +649,7 @@ EX namespace reg3 { int h_id; /** transition matrix to that heptagon */ transmatrix T; - /** the sequence of moves we need to make to get there */; + /** the sequence of moves we need to make to get there */ vector move_sequence; }; @@ -680,7 +680,7 @@ EX namespace reg3 { return cgi.subshapes[id].vertices_only_local; } - transmatrix master_relative(cell *c, bool get_inverse) { + transmatrix master_relative(cell *c, bool get_inverse) override { int id = local_id.at(c).second; auto& ss = cgi.subshapes[id]; return get_inverse ? ss.from_cellcenter : ss.to_cellcenter; @@ -689,11 +689,11 @@ EX namespace reg3 { void make_subconnections(); int wall_offset(cell *c) override; - int shvid(cell *c) { return local_id.at(c).second; } + int shvid(cell *c) override { return local_id.at(c).second; } - virtual transmatrix ray_iadj(cell *c, int i) override; + transmatrix ray_iadj(cell *c, int i) override; - const vector& adjacent_dirs(cell *c, int i) { + const vector& adjacent_dirs(cell *c, int i) override { int id = local_id.at(c).second; return cgi.subshapes[id].dirs_adjacent[i]; } @@ -1490,7 +1490,7 @@ EX namespace reg3 { return cgi.vertices_only; } - const vector& adjacent_dirs(cell *c, int i) { + const vector& adjacent_dirs(cell *c, int i) override { return cgi.dirs_adjacent[i]; } @@ -1582,7 +1582,7 @@ EX namespace reg3 { clearfrom(allh[0]); } - virtual struct transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { + struct transmatrix relative_matrix(heptagon *h2, heptagon *h1, const hyperpoint& hint) override { return iso_inverse(locations[h1->fieldval]) * locations[h2->fieldval]; } @@ -1901,13 +1901,13 @@ EX namespace reg3 { return relative_matrix_via_masters(c2, c1, hint); } - transmatrix master_relative(cell *c, bool get_inverse) { + transmatrix master_relative(cell *c, bool get_inverse) override { if(PURE) return Id; int aid = cell_id.at(c); return quotient_map->master_relative(quotient_map->acells[aid], get_inverse); } - int shvid(cell *c) { + int shvid(cell *c) override { if(PURE) return 0; if(!cell_id.count(c)) return quotient_map->shvid(c); int aid = cell_id.at(c); @@ -1963,14 +1963,14 @@ EX namespace reg3 { c->c.connect(d, c1, ac->c.spin(d), false); } - virtual transmatrix ray_iadj(cell *c, int i) { + transmatrix ray_iadj(cell *c, int i) override { if(PURE) return iadj(c, i); if(!cell_id.count(c)) return quotient_map->ray_iadj(c, i); /* necessary because ray samples are from quotient_map */ int aid = cell_id.at(c); return quotient_map->ray_iadj(quotient_map->acells[aid], i); } - const vector& adjacent_dirs(cell *c, int i) { + const vector& adjacent_dirs(cell *c, int i) override { if(PURE) return cgi.dirs_adjacent[i]; int aid = cell_id.at(c); return quotient_map->adjacent_dirs(quotient_map->acells[aid], i); diff --git a/sphere.cpp b/sphere.cpp index 8d254ec6..7ed5a9c1 100644 --- a/sphere.cpp +++ b/sphere.cpp @@ -139,14 +139,14 @@ struct hrmap_spherical : hrmap_standard { #endif } - heptagon *getOrigin() { return dodecahedron[0]; } + heptagon *getOrigin() override { return dodecahedron[0]; } ~hrmap_spherical() { for(int i=0; i