"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stats/EST_Discrete.cc" between
speech_tools-2.4-release.tar.gz and speech_tools-2.5.0-release.tar.gz

About: The speech_tools - Edinburgh Speech Tools Library (used by the Festival Speech Synthesis System).

EST_Discrete.cc  (speech_tools-2.4-release):EST_Discrete.cc  (speech_tools-2.5.0-release)
skipping to change at line 153 skipping to change at line 153
s << d.name(i) << " "; s << d.name(i) << " ";
return s; return s;
} }
Discretes::~Discretes() Discretes::~Discretes()
{ {
int i; int i;
for (i=0; i<next_free; i++) for (i=0; i<next_free; i++)
delete discretes[i]; delete discretes[i];
delete discretes; delete [] discretes;
} }
const int Discretes::def(const EST_StrList &vocab) const int Discretes::def(const EST_StrList &vocab)
{ {
// Define discrete, increasing the size of the table if need be // Define discrete, increasing the size of the table if need be
int i,pos; int i,pos;
if (next_free == max) if ((next_free == max) && (max > 0))
{ {
EST_Discrete **new_discretes = new EST_Discrete *[max*2]; EST_Discrete **new_discretes = new EST_Discrete *[max*2];
for (i=0; i<next_free; i++) for (i=0; i<next_free; i++)
new_discretes[i] = discretes[i]; new_discretes[i] = discretes[i];
max *= 2; max *= 2;
delete discretes; delete [] discretes;
discretes = new_discretes; discretes = new_discretes;
} }
discretes[next_free] = new EST_Discrete(vocab); discretes[next_free] = new EST_Discrete(vocab);
pos = next_free + 10; pos = next_free + 10;
next_free++; next_free++;
return pos; return pos;
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)