diff options
author | Dan Eble <nine.fierce.ballads@gmail.com> | 2015-08-08 13:11:02 -0400 |
---|---|---|
committer | Dan Eble <nine.fierce.ballads@gmail.com> | 2015-08-20 19:16:09 -0400 |
commit | f127e14af04f474d20406ca0e0f76f05061ee103 (patch) | |
tree | f672505b3e37c00dc591ee98a8ad7f751bbf9685 /flower | |
parent | cca994dde70bef1b6c4e5cab871bcef845fec37c (diff) |
Issue 4550 (1/2) Avoid "using namespace std;" in included files
These are manual changes in preparation for an automated removal of
"using namespace std;".
Mostly these are additions of using-declarations for commonly used
types and containers (e.g. std::string, std::vector) to *.cc files so
that they will continue to build after the big removal.
Diffstat (limited to 'flower')
-rw-r--r-- | flower/file-name.cc | 3 | ||||
-rw-r--r-- | flower/file-path.cc | 3 | ||||
-rw-r--r-- | flower/getopt-long.cc | 2 | ||||
-rw-r--r-- | flower/include/std-string.hh | 2 | ||||
-rw-r--r-- | flower/international.cc | 2 | ||||
-rw-r--r-- | flower/interval-set.cc | 2 | ||||
-rw-r--r-- | flower/interval.cc | 2 | ||||
-rw-r--r-- | flower/offset.cc | 2 | ||||
-rw-r--r-- | flower/polynomial.cc | 1 | ||||
-rw-r--r-- | flower/rational.cc | 2 | ||||
-rw-r--r-- | flower/std-string.cc | 3 | ||||
-rw-r--r-- | flower/string-convert.cc | 2 | ||||
-rw-r--r-- | flower/test-file-name.cc | 1 | ||||
-rw-r--r-- | flower/test-file-path.cc | 2 | ||||
-rw-r--r-- | flower/test-interval-set.cc | 1 | ||||
-rw-r--r-- | flower/test-std.cc | 1 | ||||
-rw-r--r-- | flower/test-string.cc | 2 | ||||
-rw-r--r-- | flower/warn.cc | 2 |
18 files changed, 34 insertions, 1 deletions
diff --git a/flower/file-name.cc b/flower/file-name.cc index c65d8fc7ed..71b3bf27b5 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -33,6 +33,9 @@ using namespace std; #include <sys/stat.h> #endif +using std::string; +using std::vector; + #ifndef ROOTSEP #define ROOTSEP ':' #endif diff --git a/flower/file-path.cc b/flower/file-path.cc index 65cd517e5a..b2bbb286f3 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -41,6 +41,9 @@ #include <algorithm> +using std::string; +using std::vector; + vector<string> File_path::directories () const { diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index 9adc0c3592..49f7c8831d 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -36,6 +36,8 @@ gettext (char const *s) #include <libintl.h> #endif +using std::string; + long Getopt_long::get_argument_index () { diff --git a/flower/include/std-string.hh b/flower/include/std-string.hh index 0a34d05049..bdb85795ab 100644 --- a/flower/include/std-string.hh +++ b/flower/include/std-string.hh @@ -36,7 +36,7 @@ using namespace std; typedef size_t ssize; -#define NPOS string::npos +#define NPOS std::string::npos string to_string (const string&); string to_string (char c, int n = 1); diff --git a/flower/international.cc b/flower/international.cc index 1518182a2c..21f3ef97a1 100644 --- a/flower/international.cc +++ b/flower/international.cc @@ -32,6 +32,8 @@ gettext (char const *s) #include <libintl.h> #endif +using std::string; + string _ (char const *ch) { diff --git a/flower/interval-set.cc b/flower/interval-set.cc index da857f277c..acc282bbdb 100644 --- a/flower/interval-set.cc +++ b/flower/interval-set.cc @@ -19,6 +19,8 @@ #include "interval-set.hh" +using std::vector; + /* A union of intervals in the real line. diff --git a/flower/interval.cc b/flower/interval.cc index a73da9e788..31cb3914b3 100644 --- a/flower/interval.cc +++ b/flower/interval.cc @@ -21,6 +21,8 @@ #include "interval.tcc" +using std::string; + template<> Real Interval_t<Real>::infinity () diff --git a/flower/offset.cc b/flower/offset.cc index 7cb2677481..2fc9bf9aa6 100644 --- a/flower/offset.cc +++ b/flower/offset.cc @@ -19,6 +19,8 @@ #include "offset.hh" +using std::string; + #ifndef STANDALONE string Offset::to_string () const diff --git a/flower/polynomial.cc b/flower/polynomial.cc index ec8605058c..a3f679cd60 100644 --- a/flower/polynomial.cc +++ b/flower/polynomial.cc @@ -24,6 +24,7 @@ #include <cmath> using namespace std; +using std::vector; /* Een beter milieu begint bij uzelf. Hergebruik! diff --git a/flower/rational.cc b/flower/rational.cc index 559e1646a0..e93f65112e 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -27,6 +27,8 @@ using namespace std; #include "string-convert.hh" #include "libc-extension.hh" +using std::string; + double Rational::to_double () const { diff --git a/flower/std-string.cc b/flower/std-string.cc index 593a286d84..b03d3cca59 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -21,6 +21,9 @@ #include "string-convert.hh" #include "std-vector.hh" +using std::string; +using std::vector; + string to_string (const string &s) { diff --git a/flower/string-convert.cc b/flower/string-convert.cc index e3e8bc824d..13788a4a84 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -14,6 +14,8 @@ using namespace std; #include "rational.hh" #include "std-vector.hh" +using std::string; + /** A safe length for stringconversion buffers. diff --git a/flower/test-file-name.cc b/flower/test-file-name.cc index adbaa52913..04ee34b51f 100644 --- a/flower/test-file-name.cc +++ b/flower/test-file-name.cc @@ -3,6 +3,7 @@ #include "yaffut-parameters.hh" using namespace std; +using std::string; string slashify (string file_name); diff --git a/flower/test-file-path.cc b/flower/test-file-path.cc index a20364b98c..e55309a3f7 100644 --- a/flower/test-file-path.cc +++ b/flower/test-file-path.cc @@ -6,6 +6,8 @@ #include "yaffut.hh" #include "config.hh" +using std::string; + TEST (File_path, Find) { char const *extensions[] = {"ly", "", 0}; diff --git a/flower/test-interval-set.cc b/flower/test-interval-set.cc index 5b4d1f637e..6d8d3823d3 100644 --- a/flower/test-interval-set.cc +++ b/flower/test-interval-set.cc @@ -22,6 +22,7 @@ #include "yaffut.hh" using namespace std; +using std::vector; FUNC (interval_set_union) { diff --git a/flower/test-std.cc b/flower/test-std.cc index 4add05a625..711e9237b6 100644 --- a/flower/test-std.cc +++ b/flower/test-std.cc @@ -7,6 +7,7 @@ #include "yaffut.hh" using namespace std; +using std::vector; template<typename T> void diff --git a/flower/test-string.cc b/flower/test-string.cc index 1967d43751..f5524bba74 100644 --- a/flower/test-string.cc +++ b/flower/test-string.cc @@ -6,6 +6,8 @@ #include "yaffut.hh" using namespace std; +using std::string; +using std::vector; FUNC (string_split_join) { diff --git a/flower/warn.cc b/flower/warn.cc index f17a36483f..422dea8027 100644 --- a/flower/warn.cc +++ b/flower/warn.cc @@ -26,6 +26,8 @@ #include "international.hh" using namespace std; +using std::string; +using std::vector; /** We have several different loglevels, each with its own message function(s): ERROR: error, non_fatal_error, programming_error |