diff --git a/game.cpp b/game.cpp index 7dcf91bc..e4e9e3d6 100644 --- a/game.cpp +++ b/game.cpp @@ -144,7 +144,7 @@ cellwalker cwt; // single player character position inline cell*& singlepos() { return cwt.c; } inline bool singleused() { return !(shmup::on || multi::players > 1); } -mt19937 r; +std::mt19937 r; void shrand(int i) { r.seed(i); @@ -161,7 +161,7 @@ ld hrandf() { } int hrandstate() { - mt19937 r2 = r; + std::mt19937 r2 = r; return r2() & HRANDMAX; } diff --git a/hyper.h b/hyper.h index e313e831..d45f8db3 100644 --- a/hyper.h +++ b/hyper.h @@ -10,7 +10,34 @@ namespace hr { -using namespace std; +// functions and types used from the standard library +using std::vector; +using std::map; +using std::array; +using std::unordered_map; +using std::sort; +using std::multimap; +using std::set; +using std::string; +using std::function; +using std::pair; +using std::tuple; +using std::shared_ptr; +using std::make_shared; +using std::min; +using std::max; +using std::make_pair; +using std::tie; +using std::queue; +using std::swap; +using std::complex; +using std::reverse; +using std::real; +using std::imag; +using std::stable_sort; +using std::out_of_range; +using std::get; +using std::random_shuffle; // genus (in grammar) #define GEN_M 0 @@ -369,9 +396,7 @@ string cts(char c); string its(int i); int hrand(int i); -#ifndef STDSIZE template int size(const T& x) {return x.size(); } -#endif // initialize the achievement system. void achievement_init(); diff --git a/inventory.cpp b/inventory.cpp index abfa0d0b..34be2d38 100644 --- a/inventory.cpp +++ b/inventory.cpp @@ -93,7 +93,7 @@ namespace hr { namespace inv { return int(mirrorqty0(orb) * sqrt(1.000001+items[itPower]/20.)); } - mt19937 invr; + std::mt19937 invr; void sirand(int i) { invr.seed(i); diff --git a/langen.cpp b/langen.cpp index 1600ae50..9230e542 100644 --- a/langen.cpp +++ b/langen.cpp @@ -9,14 +9,17 @@ #include #include -#include +#include #include -#include -using namespace std; +#include +#include + +using std::string; +using std::map; +using std::vector; +using std::set; -#ifndef STDSIZE template int size(const T& x) { return x.size(); } -#endif #define NUMLAN 7 @@ -44,8 +47,6 @@ struct noun { dictionary nouns[NUMLAN]; -#include - int utfsize(char c) { unsigned char cu = c; if(cu < 128) return 1; diff --git a/rogueviz.cpp b/rogueviz.cpp index 2c506e41..561ebe86 100644 --- a/rogueviz.cpp +++ b/rogueviz.cpp @@ -577,7 +577,7 @@ namespace sag { return cost; } - mt19937 los; + std::mt19937 los; bool infullsa;