Skip to content

Commit

Permalink
Merge pull request #41 from zeehio/fix-minor-fixes2
Browse files Browse the repository at this point in the history
Fix: Minor fixes 2 (Add "using namespace" to compilation units)
  • Loading branch information
lenzo-ka authored Jan 26, 2021
2 parents 823252b + 3d1d447 commit e2dcb2a
Show file tree
Hide file tree
Showing 191 changed files with 374 additions and 70 deletions.
2 changes: 2 additions & 0 deletions audio/gen_audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#include "EST_audio.h"
#include "EST_wave_aux.h"

using namespace std;

static int play_sunau_wave(EST_Wave &inwave, EST_Option &al);
static int play_socket_wave(EST_Wave &inwave, EST_Option &al);
static int play_aucomm_wave(EST_Wave &inwave, EST_Option &al);
Expand Down
2 changes: 2 additions & 0 deletions audio/irixaudio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "audioP.h"
#include "EST_io_aux.h"

using namespace std;

#if defined (SUPPORT_IRIX) || defined (SUPPORT_IRIX53)
#include <audio.h>
#include <unistd.h>
Expand Down
2 changes: 2 additions & 0 deletions audio/linux_sound.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
#include "EST_io_aux.h"
#include "EST_error.h"

using namespace std;

#ifdef SUPPORT_FREEBSD16
#include <sys/soundcard.h>
#include <fcntl.h>
Expand Down
2 changes: 2 additions & 0 deletions audio/macosxaudio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#include "EST_Option.h"
#include "audioP.h"

using namespace std;

#if defined (SUPPORT_MACOSX_AUDIO)

#include <CoreServices/CoreServices.h>
Expand Down
2 changes: 2 additions & 0 deletions audio/mplayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include "EST_io_aux.h"
#include "EST_Pathname.h"

using namespace std;

#ifdef SUPPORT_MPLAYER

int mplayer_supported = TRUE;
Expand Down
3 changes: 3 additions & 0 deletions audio/nas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#include "audioP.h"
#include "EST_io_aux.h"

using namespace std;


#ifdef SUPPORT_NAS
#include <audio/audiolib.h>
#include <audio/soundlib.h>
Expand Down
2 changes: 1 addition & 1 deletion audio/os2audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ int play_os2audio_wave(EST_Wave &inwave, EST_Option &al)
{
(void)inwave;
(void)al;
cerr << "OS/2 16bit realtime DART playback not supported." << endl;
std::cerr << "OS/2 16bit realtime DART playback not supported." << std::endl;
return -1;
}

Expand Down
2 changes: 2 additions & 0 deletions audio/sun16audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#include "EST_io_aux.h"
#include "EST_unix.h"

using namespace std;

#ifdef SUPPORT_SUN16
#include <sys/filio.h>
#if defined(__svr4__) || defined(SYSV) || defined(SVR4)
Expand Down
2 changes: 2 additions & 0 deletions audio/win32audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include "EST_io_aux.h"
#include "EST_Pathname.h"

using namespace std;

#ifdef SUPPORT_WIN32AUDIO

#include <EST_system.h>
Expand Down
2 changes: 2 additions & 0 deletions base_class/EST_DMatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include "EST_Token.h"
#include "rateconv.h"

using namespace std;

EST_String EST_DMatrix::default_file_type = "est_ascii";

EST_DMatrix::EST_DMatrix(const EST_DMatrix &a, int b)
Expand Down
1 change: 1 addition & 0 deletions base_class/EST_FeatureData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

#include "EST_THash.h"

using namespace std;

EST_FeatureData::EST_FeatureData()
{
Expand Down
6 changes: 6 additions & 0 deletions base_class/EST_Option.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
#include "EST_io_aux.h"
#include "EST_Token.h"

#include <iostream>
using std::cin;
using std::cout;
using std::cerr;
using std::endl;

static const EST_String Empty_String("");

// Fills in keyval pair. If Key already exists, overwrites value.
Expand Down
2 changes: 1 addition & 1 deletion base_class/EST_THash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ int EST_THash<K,V>::remove_item(const K &rkey, int quiet)
}

if (!quiet)
cerr << "THash: no item labelled \"" << rkey << "\"" << endl;
std::cerr << "THash: no item labelled \"" << rkey << "\"" << std::endl;
return -1;
}

Expand Down
2 changes: 1 addition & 1 deletion base_class/EST_TList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ template<class T> EST_TList<T> &EST_TList<T>::operator+=(const EST_TList<T> &a)
{
if (this == &a)
{
cerr << "EST_TList: error: tried to add list to itself\n";
std::cerr << "EST_TList: error: tried to add list to itself\n";
return *this;
}
copy_items(a);
Expand Down
14 changes: 7 additions & 7 deletions base_class/EST_TNamedEnum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ INFO &EST_TValuedEnumI<ENUM,VAL,INFO>::info (ENUM token) const
if (this->definitions[i].token == token)
return this->definitions[i].info;

cerr << "Fetching info for invalid entry\n";
std::cerr << "Fetching info for invalid entry" << std::endl;
abort();

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

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

if ( n>= this->ndefinitions)
{
cerr << "too many definitions\n";
std::cerr << "too many definitions\n";
return wrong_format;
}

Expand All @@ -227,12 +227,12 @@ EST_read_status EST_TNamedEnum<ENUM>::priv_load(EST_String name, EST_TNamedEnum<
// definition by standard name
if (!definitive)
{
cerr << "can't use names in this definition\n";
std::cerr << "can't use names in this definition\n";
return wrong_format;
}
if ( n>= this->ndefinitions)
{
cerr << "too many definitions\n";
std::cerr << "too many definitions\n";
return wrong_format;
}

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

if (eq <0)
{
cerr << "bad header line '" << line;
std::cerr << "bad header line '" << line;
return wrong_format;
}

Expand Down Expand Up @@ -284,7 +284,7 @@ EST_read_status EST_TNamedEnum<ENUM>::priv_load(EST_String name, EST_TNamedEnum<
}
else
{
cerr << "bad header line '" << line;
std::cerr << "bad header line '" << line;
return wrong_format;
}

Expand Down
4 changes: 3 additions & 1 deletion base_class/EST_Token.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#include "EST_cutils.h"
#include "EST_error.h"

using namespace std;

const EST_String EST_Token_Default_WhiteSpaceChars = " \t\n\r";
const EST_String EST_Token_Default_SingleCharSymbols = "(){}[]";
const EST_String EST_Token_Default_PrePunctuationSymbols = "\"'`({[";
Expand Down Expand Up @@ -246,7 +248,7 @@ int EST_TokenStream::open(FILE *ofp, int close_when_finished)
return 0;
}

int EST_TokenStream::open(istream &newis)
int EST_TokenStream::open(std::istream &newis)
{
// absorb already open istream
if (type != tst_none)
Expand Down
2 changes: 2 additions & 0 deletions base_class/EST_UList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
/*************************************************************************/
#include <EST_UList.h>

using namespace std;

void EST_UList::clear_and_free(void (*item_free)(EST_UItem *p))
{
EST_UItem *q, *np;
Expand Down
2 changes: 2 additions & 0 deletions base_class/EST_features_aux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@

#include "EST_get_function_template.h"

using namespace std;

defineGetFunction(EST_Features, val, EST_Val, getVal)
defineGetFunction(EST_Features, val, EST_String, getString)
defineGetFunction(EST_Features, val, float, getFloat)
Expand Down
2 changes: 2 additions & 0 deletions base_class/EST_features_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#include "EST_String.h"
#include "EST_Token.h"

using namespace std;

void EST_Features::set_function(const EST_String &name,
const EST_String &funcname)
{
Expand Down
2 changes: 2 additions & 0 deletions base_class/EST_matrix_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

const int EST_CURRENT=-1;
const int EST_ALL=-1;
using namespace std;


bool EST_matrix_bounds_check(int r,
int c,
Expand Down
2 changes: 2 additions & 0 deletions base_class/EST_slist_aux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#include "EST_cutils.h"
#include "EST_Token.h"

using namespace std;

int StrListtoFList(EST_StrList &s, EST_FList &f)
{
EST_Litem *p;
Expand Down
2 changes: 2 additions & 0 deletions base_class/EST_svec_aux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include "EST_cutils.h"
#include "EST_Token.h"

using namespace std;

EST_read_status load_TList_of_StrVector(EST_TList<EST_StrVector> &w,
const EST_String &filename,
const int vec_len)
Expand Down
4 changes: 2 additions & 2 deletions base_class/inst_tmpl/vector_f_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ EST_write_status save(const EST_String &filename, const EST_TVector<float> &a)
{
*outf << a(i) << "\t";
}
*outf << endl;
*outf << std::endl;

if (outf != &cout)
if (outf != &std::cout)
delete outf;
return write_ok;
}
Expand Down
2 changes: 2 additions & 0 deletions base_class/string/EST_Chunk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#include <cstring>
#include "EST_Chunk.h"

using namespace std;

EST_Chunk::EST_Chunk ()
{
count = 0;
Expand Down
2 changes: 2 additions & 0 deletions base_class/string/EST_Regex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
#include "EST_String.h"
#include "EST_Regex.h"

using namespace std;

#ifdef sun
#ifndef __svr4__
/* SunOS */
Expand Down
4 changes: 3 additions & 1 deletion base_class/vec_mat_aux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include "EST_math.h"
#include <ctime>

using namespace std;

bool polynomial_fit(EST_FVector &x, EST_FVector &y,
EST_FVector &co_effs, int order)
{
Expand All @@ -60,7 +62,7 @@ bool polynomial_fit(EST_FVector &x, EST_FVector &y, EST_FVector &co_effs,
{

if(order <= 0){
cerr << "polynomial_fit : order must be >= 1" << endl;
std::cerr << "polynomial_fit : order must be >= 1" << std::endl;
return false;
}

Expand Down
2 changes: 2 additions & 0 deletions base_class/vec_mat_aux_d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include "EST_math.h"
#include "EST_unix.h"

using namespace std;

bool polynomial_fit(EST_DVector &x, EST_DVector &y,
EST_DVector &co_effs, int order)
{
Expand Down
2 changes: 2 additions & 0 deletions base_class/vec_mat_aux_i.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include "EST_math.h"
#include <time.h>

using namespace std;

int matrix_max(const EST_IMatrix &a)
{
int i, j;
Expand Down
2 changes: 2 additions & 0 deletions grammar/ngram/EST_PST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#include "EST_PST.h"
#include "EST_multistats.h"

using namespace std;

VAL_REGISTER_CLASS(pstnode,EST_PredictionSuffixTree_tree_node)

// Out of vocabulary identifier
Expand Down
2 changes: 2 additions & 0 deletions grammar/ngram/EST_lattice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include <fstream>
#include <cstdlib>

using namespace std;

Lattice::Lattice()
{
tf=0;
Expand Down
2 changes: 2 additions & 0 deletions grammar/ngram/EST_lattice_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include "EST_Token.h"
#include "EST_StringTrie.h"

using namespace std;

bool save(Lattice &lattice, EST_String filename)
{
ostream *outf;
Expand Down
2 changes: 2 additions & 0 deletions grammar/ngram/freqsmooth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include <cfloat>
#include "EST_Ngrammar.h"

using namespace std;

static double fs_find_backoff_prob(EST_Ngrammar *backoff_ngrams,
int order,const EST_StrVector words,
int smooth_thresh);
Expand Down
2 changes: 2 additions & 0 deletions grammar/ngram/ngrammar_aux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include "EST_String.h"
#include "EST_Ngrammar.h"

using namespace std;

static bool
ExponentialFit(EST_DVector &N, double &a, double &b, int first, int last)
{
Expand Down
2 changes: 2 additions & 0 deletions grammar/ngram/ngrammar_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#include "EST_Token.h"
#include "EST_cutils.h"

using namespace std;

EST_read_status
load_ngram_htk_ascii(const EST_String filename, EST_Ngrammar &n)
{
Expand Down
2 changes: 2 additions & 0 deletions grammar/ngram/ngrammar_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include "EST_error.h"
#include "EST_Ngrammar.h"

using namespace std;

static int get_next_window(EST_TokenStream &ts,
EST_StrVector &window,
const EST_String &input_format,
Expand Down
2 changes: 2 additions & 0 deletions grammar/scfg/EST_SCFG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include "EST_Pathname.h"
#include "EST_SCFG.h"

using namespace std;

EST_SCFG_Rule::EST_SCFG_Rule(double prob,int p, int m)
{
set_rule(prob,p,m);
Expand Down
Loading

0 comments on commit e2dcb2a

Please sign in to comment.