diff --git a/Makefile.mac b/Makefile.mac index e603ebd9..ee6e8c70 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -8,7 +8,7 @@ CXXFLAGS += -std=c++11 -march=native -DMAC CXXFLAGS += -W -Wall -Wextra -pedantic -CXXFLAGS += -Wno-format-pedantic -Wno-unused-parameter -Wno-missing-field-initializers -Wno-vla-extension +CXXFLAGS += -Wno-format-pedantic -Wno-unused-parameter -Wno-missing-field-initializers CXXFLAGS += -I/usr/local/include CXXFLAGS += ${EXTRA_CXXFLAGS} diff --git a/basegraph.cpp b/basegraph.cpp index 22bbcbe7..fe1ba25a 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -360,9 +360,9 @@ void sdltogl(SDL_Surface *txt, glfont_t& f, int ch) { int theight = next_p2( otheight ); #if CAP_TABFONT - int expanded_data[twidth * theight]; + std::vector expanded_data(twidth * theight); #else - Uint16 expanded_data[twidth * theight]; + std::vector expanded_data(twidth * theight); #endif for(int j=0; j cx(rad+1); for(int i=0; i -#endif #include "commandline.cpp" #include "bigstuff.cpp" diff --git a/complex.cpp b/complex.cpp index 655d6d00..5de9475f 100644 --- a/complex.cpp +++ b/complex.cpp @@ -2046,7 +2046,7 @@ void livecaves() { vector bringlife; int gr = gamerange(); - int heatvals[dcs]; + std::vector heatvals(dcs); for(int i=0; iland != laCA) return; vector& allcells = currentmap->allcells(); int dcs = isize(allcells); - bool willlive[dcs]; + std::vector willlive(dcs); for(int i=0; iland != laCA) return; @@ -3126,9 +3126,9 @@ namespace windmap { for(int i=0; i inqueue(N, true); vector tocheck; - for(int i=0; i sqrts(Prime, 0); for(int k=1-Prime; k sqrts(Field); for(int k=0; ktype; t++) if(c->mov[t] && inpair(c->mov[t], colorpair)) dirtable[qdirtable++] = t; - random_shuffle(dirtable, dirtable+qdirtable); + hrandom_shuffle(dirtable, qdirtable); while(qdirtable--) { int t = dirtable[qdirtable]; hexvisit(c->mov[t], c, t, mounted, colorpair); diff --git a/hyper.h b/hyper.h index 78f35ccc..71063b99 100644 --- a/hyper.h +++ b/hyper.h @@ -37,7 +37,6 @@ using std::imag; using std::stable_sort; using std::out_of_range; using std::get; -using std::random_shuffle; using std::move; using std::make_tuple; diff --git a/polygons.cpp b/polygons.cpp index eebd90e9..f463f36a 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -201,9 +201,9 @@ void polylineColor(SDL_Surface *s, int *x, int *y, int polyi, int col) { } void filledPolygonColorI(SDL_Surface *s, int* px, int *py, int polyi, int col) { - Sint16 spx[polyi], spy[polyi]; - for(int i=0; i spx(px, px + polyi); + std::vector spy(py, py + polyi); + filledPolygonColor(s, spx.data(), spy.data(), polyi, col); } #endif diff --git a/rogueviz-kohonen.cpp b/rogueviz-kohonen.cpp index 0a2eefb1..dd90f369 100644 --- a/rogueviz-kohonen.cpp +++ b/rogueviz-kohonen.cpp @@ -691,7 +691,7 @@ void describe(cell *c) { help += "\n"; vector> v; for(int s=0; snet, data[s].val), s); - random_shuffle(v.begin(), v.end()); + hrandom_shuffle(&v[0], isize(v)); sort(v.begin(), v.end(), [] (pair a, pair b) { return a.first < b.first; }); for(int i=0; i 0) { - char log[logLength]; - glGetShaderInfoLog(shader, logLength, &logLength, log); + std::vector log(logLength); + glGetShaderInfoLog(shader, logLength, &logLength, log.data()); if(logLength > 0) - printf("compiler log (%d): '%s'\n", logLength, log); + printf("compiler log (%d): '%s'\n", logLength, log.data()); } glGetShaderiv(shader, GL_COMPILE_STATUS, &status); @@ -232,10 +232,10 @@ struct GLprogram { GLint logLength; glGetProgramiv(_program, GL_INFO_LOG_LENGTH, &logLength); if (logLength > 0) { - char log[logLength]; - glGetProgramInfoLog(_program, logLength, &logLength, log); + std::vector log(logLength); + glGetProgramInfoLog(_program, logLength, &logLength, log.data()); if(logLength > 0) - printf("linking log (%d): %s\n", logLength, log); + printf("linking log (%d): %s\n", logLength, log.data()); } glGetProgramiv(_program, GL_LINK_STATUS, &status);