Skip to content

Commit e2dcb2a

Browse files
authored
Merge pull request #41 from zeehio/fix-minor-fixes2
Fix: Minor fixes 2 (Add "using namespace" to compilation units)
2 parents 823252b + 3d1d447 commit e2dcb2a

File tree

191 files changed

+374
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+374
-70
lines changed

audio/gen_audio.cc

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
#include "EST_audio.h"
5252
#include "EST_wave_aux.h"
5353

54+
using namespace std;
55+
5456
static int play_sunau_wave(EST_Wave &inwave, EST_Option &al);
5557
static int play_socket_wave(EST_Wave &inwave, EST_Option &al);
5658
static int play_aucomm_wave(EST_Wave &inwave, EST_Option &al);

audio/irixaudio.cc

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "audioP.h"
1818
#include "EST_io_aux.h"
1919

20+
using namespace std;
21+
2022
#if defined (SUPPORT_IRIX) || defined (SUPPORT_IRIX53)
2123
#include <audio.h>
2224
#include <unistd.h>

audio/linux_sound.cc

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
#include "EST_io_aux.h"
6161
#include "EST_error.h"
6262

63+
using namespace std;
64+
6365
#ifdef SUPPORT_FREEBSD16
6466
#include <sys/soundcard.h>
6567
#include <fcntl.h>

audio/macosxaudio.cc

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#include "EST_Option.h"
4646
#include "audioP.h"
4747

48+
using namespace std;
49+
4850
#if defined (SUPPORT_MACOSX_AUDIO)
4951

5052
#include <CoreServices/CoreServices.h>

audio/mplayer.cc

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include "EST_io_aux.h"
4545
#include "EST_Pathname.h"
4646

47+
using namespace std;
48+
4749
#ifdef SUPPORT_MPLAYER
4850

4951
int mplayer_supported = TRUE;

audio/nas.cc

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
#include "audioP.h"
4848
#include "EST_io_aux.h"
4949

50+
using namespace std;
51+
52+
5053
#ifdef SUPPORT_NAS
5154
#include <audio/audiolib.h>
5255
#include <audio/soundlib.h>

audio/os2audio.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ int play_os2audio_wave(EST_Wave &inwave, EST_Option &al)
260260
{
261261
(void)inwave;
262262
(void)al;
263-
cerr << "OS/2 16bit realtime DART playback not supported." << endl;
263+
std::cerr << "OS/2 16bit realtime DART playback not supported." << std::endl;
264264
return -1;
265265
}
266266

audio/sun16audio.cc

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
#include "EST_io_aux.h"
5757
#include "EST_unix.h"
5858

59+
using namespace std;
60+
5961
#ifdef SUPPORT_SUN16
6062
#include <sys/filio.h>
6163
#if defined(__svr4__) || defined(SYSV) || defined(SVR4)

audio/win32audio.cc

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include "EST_io_aux.h"
4545
#include "EST_Pathname.h"
4646

47+
using namespace std;
48+
4749
#ifdef SUPPORT_WIN32AUDIO
4850

4951
#include <EST_system.h>

base_class/EST_DMatrix.cc

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
#include "EST_Token.h"
5353
#include "rateconv.h"
5454

55+
using namespace std;
56+
5557
EST_String EST_DMatrix::default_file_type = "est_ascii";
5658

5759
EST_DMatrix::EST_DMatrix(const EST_DMatrix &a, int b)

base_class/EST_FeatureData.cc

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
#include "EST_THash.h"
5252

53+
using namespace std;
5354

5455
EST_FeatureData::EST_FeatureData()
5556
{

base_class/EST_Option.cc

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
#include "EST_io_aux.h"
4343
#include "EST_Token.h"
4444

45+
#include <iostream>
46+
using std::cin;
47+
using std::cout;
48+
using std::cerr;
49+
using std::endl;
50+
4551
static const EST_String Empty_String("");
4652

4753
// Fills in keyval pair. If Key already exists, overwrites value.

base_class/EST_THash.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ int EST_THash<K,V>::remove_item(const K &rkey, int quiet)
213213
}
214214

215215
if (!quiet)
216-
cerr << "THash: no item labelled \"" << rkey << "\"" << endl;
216+
std::cerr << "THash: no item labelled \"" << rkey << "\"" << std::endl;
217217
return -1;
218218
}
219219

base_class/EST_TList.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ template<class T> EST_TList<T> &EST_TList<T>::operator+=(const EST_TList<T> &a)
109109
{
110110
if (this == &a)
111111
{
112-
cerr << "EST_TList: error: tried to add list to itself\n";
112+
std::cerr << "EST_TList: error: tried to add list to itself\n";
113113
return *this;
114114
}
115115
copy_items(a);

base_class/EST_TNamedEnum.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ INFO &EST_TValuedEnumI<ENUM,VAL,INFO>::info (ENUM token) const
141141
if (this->definitions[i].token == token)
142142
return this->definitions[i].info;
143143

144-
cerr << "Fetching info for invalid entry\n";
144+
std::cerr << "Fetching info for invalid entry" << std::endl;
145145
abort();
146146

147147
static INFO dummyI;
@@ -198,7 +198,7 @@ EST_read_status EST_TNamedEnum<ENUM>::priv_load(EST_String name, EST_TNamedEnum<
198198
{
199199
if ( buffer[LINE_LENGTH-1] != 'x')
200200
{
201-
cerr << "line too long .. '" << buffer << "'\n";
201+
std::cerr << "line too long .. '" << buffer << "'\n";
202202
return wrong_format;
203203
}
204204

@@ -208,7 +208,7 @@ EST_read_status EST_TNamedEnum<ENUM>::priv_load(EST_String name, EST_TNamedEnum<
208208

209209
if ( n>= this->ndefinitions)
210210
{
211-
cerr << "too many definitions\n";
211+
std::cerr << "too many definitions\n";
212212
return wrong_format;
213213
}
214214

@@ -227,12 +227,12 @@ EST_read_status EST_TNamedEnum<ENUM>::priv_load(EST_String name, EST_TNamedEnum<
227227
// definition by standard name
228228
if (!definitive)
229229
{
230-
cerr << "can't use names in this definition\n";
230+
std::cerr << "can't use names in this definition\n";
231231
return wrong_format;
232232
}
233233
if ( n>= this->ndefinitions)
234234
{
235-
cerr << "too many definitions\n";
235+
std::cerr << "too many definitions\n";
236236
return wrong_format;
237237
}
238238

@@ -256,7 +256,7 @@ EST_read_status EST_TNamedEnum<ENUM>::priv_load(EST_String name, EST_TNamedEnum<
256256

257257
if (eq <0)
258258
{
259-
cerr << "bad header line '" << line;
259+
std::cerr << "bad header line '" << line;
260260
return wrong_format;
261261
}
262262

@@ -284,7 +284,7 @@ EST_read_status EST_TNamedEnum<ENUM>::priv_load(EST_String name, EST_TNamedEnum<
284284
}
285285
else
286286
{
287-
cerr << "bad header line '" << line;
287+
std::cerr << "bad header line '" << line;
288288
return wrong_format;
289289
}
290290

base_class/EST_Token.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#include "EST_cutils.h"
5151
#include "EST_error.h"
5252

53+
using namespace std;
54+
5355
const EST_String EST_Token_Default_WhiteSpaceChars = " \t\n\r";
5456
const EST_String EST_Token_Default_SingleCharSymbols = "(){}[]";
5557
const EST_String EST_Token_Default_PrePunctuationSymbols = "\"'`({[";
@@ -246,7 +248,7 @@ int EST_TokenStream::open(FILE *ofp, int close_when_finished)
246248
return 0;
247249
}
248250

249-
int EST_TokenStream::open(istream &newis)
251+
int EST_TokenStream::open(std::istream &newis)
250252
{
251253
// absorb already open istream
252254
if (type != tst_none)

base_class/EST_UList.cc

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
/*************************************************************************/
3838
#include <EST_UList.h>
3939

40+
using namespace std;
41+
4042
void EST_UList::clear_and_free(void (*item_free)(EST_UItem *p))
4143
{
4244
EST_UItem *q, *np;

base_class/EST_features_aux.cc

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
#include "EST_get_function_template.h"
4646

47+
using namespace std;
48+
4749
defineGetFunction(EST_Features, val, EST_Val, getVal)
4850
defineGetFunction(EST_Features, val, EST_String, getString)
4951
defineGetFunction(EST_Features, val, float, getFloat)

base_class/EST_features_io.cc

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
#include "EST_String.h"
4444
#include "EST_Token.h"
4545

46+
using namespace std;
47+
4648
void EST_Features::set_function(const EST_String &name,
4749
const EST_String &funcname)
4850
{

base_class/EST_matrix_support.cc

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545

4646
const int EST_CURRENT=-1;
4747
const int EST_ALL=-1;
48+
using namespace std;
49+
4850

4951
bool EST_matrix_bounds_check(int r,
5052
int c,

base_class/EST_slist_aux.cc

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#include "EST_cutils.h"
5151
#include "EST_Token.h"
5252

53+
using namespace std;
54+
5355
int StrListtoFList(EST_StrList &s, EST_FList &f)
5456
{
5557
EST_Litem *p;

base_class/EST_svec_aux.cc

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
#include "EST_cutils.h"
5050
#include "EST_Token.h"
5151

52+
using namespace std;
53+
5254
EST_read_status load_TList_of_StrVector(EST_TList<EST_StrVector> &w,
5355
const EST_String &filename,
5456
const int vec_len)

base_class/inst_tmpl/vector_f_t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ EST_write_status save(const EST_String &filename, const EST_TVector<float> &a)
6969
{
7070
*outf << a(i) << "\t";
7171
}
72-
*outf << endl;
72+
*outf << std::endl;
7373

74-
if (outf != &cout)
74+
if (outf != &std::cout)
7575
delete outf;
7676
return write_ok;
7777
}

base_class/string/EST_Chunk.cc

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#include <cstring>
4646
#include "EST_Chunk.h"
4747

48+
using namespace std;
49+
4850
EST_Chunk::EST_Chunk ()
4951
{
5052
count = 0;

base_class/string/EST_Regex.cc

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
#include "EST_String.h"
6060
#include "EST_Regex.h"
6161

62+
using namespace std;
63+
6264
#ifdef sun
6365
#ifndef __svr4__
6466
/* SunOS */

base_class/vec_mat_aux.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include "EST_math.h"
4545
#include <ctime>
4646

47+
using namespace std;
48+
4749
bool polynomial_fit(EST_FVector &x, EST_FVector &y,
4850
EST_FVector &co_effs, int order)
4951
{
@@ -60,7 +62,7 @@ bool polynomial_fit(EST_FVector &x, EST_FVector &y, EST_FVector &co_effs,
6062
{
6163

6264
if(order <= 0){
63-
cerr << "polynomial_fit : order must be >= 1" << endl;
65+
std::cerr << "polynomial_fit : order must be >= 1" << std::endl;
6466
return false;
6567
}
6668

base_class/vec_mat_aux_d.cc

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include "EST_math.h"
4343
#include "EST_unix.h"
4444

45+
using namespace std;
46+
4547
bool polynomial_fit(EST_DVector &x, EST_DVector &y,
4648
EST_DVector &co_effs, int order)
4749
{

base_class/vec_mat_aux_i.cc

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include "EST_math.h"
4545
#include <time.h>
4646

47+
using namespace std;
48+
4749
int matrix_max(const EST_IMatrix &a)
4850
{
4951
int i, j;

grammar/ngram/EST_PST.cc

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
#include "EST_PST.h"
4949
#include "EST_multistats.h"
5050

51+
using namespace std;
52+
5153
VAL_REGISTER_CLASS(pstnode,EST_PredictionSuffixTree_tree_node)
5254

5355
// Out of vocabulary identifier

grammar/ngram/EST_lattice.cc

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#include <fstream>
4242
#include <cstdlib>
4343

44+
using namespace std;
45+
4446
Lattice::Lattice()
4547
{
4648
tf=0;

grammar/ngram/EST_lattice_io.cc

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include "EST_Token.h"
4545
#include "EST_StringTrie.h"
4646

47+
using namespace std;
48+
4749
bool save(Lattice &lattice, EST_String filename)
4850
{
4951
ostream *outf;

grammar/ngram/freqsmooth.cc

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
#include <cfloat>
5050
#include "EST_Ngrammar.h"
5151

52+
using namespace std;
53+
5254
static double fs_find_backoff_prob(EST_Ngrammar *backoff_ngrams,
5355
int order,const EST_StrVector words,
5456
int smooth_thresh);

grammar/ngram/ngrammar_aux.cc

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include "EST_String.h"
4343
#include "EST_Ngrammar.h"
4444

45+
using namespace std;
46+
4547
static bool
4648
ExponentialFit(EST_DVector &N, double &a, double &b, int first, int last)
4749
{

grammar/ngram/ngrammar_io.cc

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#include "EST_Token.h"
5151
#include "EST_cutils.h"
5252

53+
using namespace std;
54+
5355
EST_read_status
5456
load_ngram_htk_ascii(const EST_String filename, EST_Ngrammar &n)
5557
{

grammar/ngram/ngrammar_utils.cc

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include "EST_error.h"
4545
#include "EST_Ngrammar.h"
4646

47+
using namespace std;
48+
4749
static int get_next_window(EST_TokenStream &ts,
4850
EST_StrVector &window,
4951
const EST_String &input_format,

grammar/scfg/EST_SCFG.cc

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#include "EST_Pathname.h"
4242
#include "EST_SCFG.h"
4343

44+
using namespace std;
45+
4446
EST_SCFG_Rule::EST_SCFG_Rule(double prob,int p, int m)
4547
{
4648
set_rule(prob,p,m);

0 commit comments

Comments
 (0)