From d3662a935d3b042e62f59010564b7444e15f3153 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 7 Jun 2018 13:58:00 +0200 Subject: [PATCH] fix compiler warnings: catch(out_of_range&) --- blizzard.cpp | 2 +- graph.cpp | 2 +- rug.cpp | 2 +- shmup.cpp | 2 +- textures.cpp | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/blizzard.cpp b/blizzard.cpp index 9dc48863..cbdf85a1 100644 --- a/blizzard.cpp +++ b/blizzard.cpp @@ -245,7 +245,7 @@ void drawArrowTraps() { } } } - catch(out_of_range) {} + catch(out_of_range&) {} } } diff --git a/graph.cpp b/graph.cpp index 9f70cae3..efc4cd50 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5010,7 +5010,7 @@ void drawFlashes() { flashdata& f = flashes[k]; transmatrix V; - if(f.spd) try { V = gmatrix.at(f.where); } catch(out_of_range) { + if(f.spd) try { V = gmatrix.at(f.where); } catch(out_of_range&) { f = flashes[size(flashes)-1]; flashes.pop_back(); k--; continue; diff --git a/rug.cpp b/rug.cpp index 5f4e5aba..3586359f 100644 --- a/rug.cpp +++ b/rug.cpp @@ -584,7 +584,7 @@ void buildRug() { else if(v > w && v > w2) addTriangle(v, w, w2); } - catch(out_of_range) {} + catch(out_of_range&) {} } Xprintf("vertices = %d triangles= %d\n", size(points), size(triangles)); diff --git a/shmup.cpp b/shmup.cpp index 4f2c9e4d..2a893fbc 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -1410,7 +1410,7 @@ void doTraps() { bullet->parenttype = moArrowTrap; additional.push_back(bullet); } - catch(out_of_range) {} + catch(out_of_range&) {} } else if(d == 3) { auto tl = traplimits(t.second); diff --git a/textures.cpp b/textures.cpp index af61ba0a..b14d88dc 100644 --- a/textures.cpp +++ b/textures.cpp @@ -385,7 +385,7 @@ bool texture_config::apply(cell *c, const transmatrix &V, int col) { return true; } - catch(out_of_range) { + catch(out_of_range&) { // printf("Ignoring tile #%d / %08x: not mapped\n", si.id, goldbergcode(c, si)); return false; } @@ -1371,7 +1371,7 @@ void actDrawPixel(cell *c, hyperpoint h, int col) { fillcircle(M2 * spin(2 * M_PI * i / c->type) * Mirror * h, col); } } - catch(out_of_range) {} + catch(out_of_range&) {} } void drawPixel(cell *c, hyperpoint h, int col) { @@ -1396,10 +1396,10 @@ void drawPixel(hyperpoint h, int col) { goto again; } } - catch(out_of_range) {} + catch(out_of_range&) {} drawPixel(where, h, col); } - catch(out_of_range) {} + catch(out_of_range&) {} } void drawLine(hyperpoint h1, hyperpoint h2, int col, int steps) { @@ -1452,7 +1452,7 @@ void texture_config::remap(eTextureState old_tstate, eTextureState old_tstate_ma mi2.tvertices = move(new_tvertices); // printf("%08x remapping %d vertices to %d vertices\n", si.id, size(mi.tvertices), size(mi2.tvertices)); } - catch(out_of_range) { + catch(out_of_range&) { printf("Unexpected missing cell #%d/%d", si.id, oldid); addMessage(XLAT("Unexpected missing cell #%d/%d", its(si.id), its(oldid))); config.tstate_max = config.tstate = tsAdjusting;