Commit 66e162b2 authored by Jan Trmal's avatar Jan Trmal
Browse files

(trunk) Changes to improve the MSVC compatibility

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@5039 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent fbc38d69
......@@ -883,7 +883,7 @@ bool EqualAlign(const Fst<Arc> &ifst,
typename Arc::StateId length,
int rand_seed,
MutableFst<Arc> *ofst,
int num_retries=10) {
int num_retries) {
srand(rand_seed);
KALDI_ASSERT(ofst->NumStates() == 0); // make sure ofst empty.
// make sure all states can reach final-state (or this algorithm may enter
......
......@@ -310,6 +310,12 @@ template<class Weight, class Int> void TestScalePair(bool invert) {
int main() {
using namespace fst;
typedef ::int64 int64;
typedef ::uint64 uint64;
typedef ::int32 int32;
typedef ::uint32 uint32;
{
typedef LatticeWeightTpl<float> LatticeWeight;
for(int i = 0; i < 2; i++) {
......
......@@ -363,7 +363,16 @@ class OnlineIvectorEstimationStats {
void Write(std::ostream &os, bool binary) const;
void Read(std::istream &is, bool binary);
// Use the default assignment operator
// Override the default assignment operator
inline OnlineIvectorEstimationStats &operator=(const OnlineIvectorEstimationStats &other) {
this->prior_offset_ = other.prior_offset_;
this->max_count_ = other.max_count_;
this->num_frames_ = other.num_frames_;
this->quadratic_term_=other.quadratic_term_;
this->linear_term_=other.linear_term_;
return *this;
}
protected:
/// Returns objective function per frame, at this iVector value.
double Objf(const VectorBase<double> &ivector) const;
......
......@@ -226,7 +226,7 @@ int main(int argc, char *argv[]) {
// is intended to prevent this from happening.
while (do_endpointing &&
decoder.NumWaveformPiecesPending() * chunk_length_secs > 2.0)
Sleep(0.5);
Sleep(0.5f);
decoder.AcceptWaveform(samp_freq, wave_part);
......
......@@ -25,7 +25,6 @@
using kaldi::AmSgmm;
using kaldi::MleAmSgmmAccs;
using kaldi::int32;
using kaldi::BaseFloat;
namespace ut = kaldi::unittest;
......@@ -34,6 +33,8 @@ void TestMultiSgmmEst(const std::vector<AmSgmm*> &models,
const std::vector< kaldi::Matrix<BaseFloat> > &feats,
kaldi::SgmmUpdateFlagsType flags) {
using namespace kaldi;
typedef kaldi::int32 int32;
int32 num_gauss = models[0]->NumGauss(),
feat_dim = models[0]->FeatureDim(),
phn_dim = models[0]->PhoneSpaceDim(),
......
......@@ -25,7 +25,6 @@
using kaldi::AmSgmm;
using kaldi::MleAmSgmmAccs;
using kaldi::int32;
using kaldi::BaseFloat;
namespace ut = kaldi::unittest;
......@@ -34,6 +33,8 @@ namespace ut = kaldi::unittest;
void TestUpdateAndAccsIO(const AmSgmm &sgmm,
const kaldi::Matrix<BaseFloat> &feats) {
using namespace kaldi;
typedef kaldi::int32 int32;
kaldi::SgmmUpdateFlagsType flags = kaldi::kSgmmAll;
kaldi::SgmmPerFrameDerivedVars frame_vars;
kaldi::SgmmPerSpkDerivedVars empty;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment