1 diff -uNr speech_tools.orig/base_class/EST_TMatrix.cc speech_tools/base_class/EST_TMatrix.cc
2 --- speech_tools.orig/base_class/EST_TMatrix.cc 2001-07-25 13:02:35.000000000 +0200
3 +++ speech_tools/base_class/EST_TMatrix.cc 2004-04-20 01:06:36.242622616 +0200
7 if (!EST_matrix_bounds_check(row, col, num_rows(), num_columns(), FALSE))
8 - return *error_return;
9 + return *this->error_return;
11 return a_no_check(row,col);
17 - if (num_rows() != new_rows || num_columns() != new_cols || p_memory == NULL )
18 + if (num_rows() != new_rows || num_columns() != new_cols || this->p_memory == NULL )
21 + if (this->p_sub_matrix)
22 EST_error("Attempt to resize Sub-Matrix");
24 if (new_cols < 0 || new_rows < 0)
27 new_m = new T[new_rows*new_cols];
29 - if (p_memory != NULL)
30 + if (this->p_memory != NULL)
32 - *old_vals = p_memory;
33 - else if (!p_sub_matrix)
34 - delete [] (p_memory-p_offset);
35 + *old_vals = this->p_memory;
36 + else if (!this->p_sub_matrix)
37 + delete [] (this->p_memory-this->p_offset);
39 p_num_rows = new_rows;
40 - p_num_columns = new_cols;
42 - p_row_step=p_num_columns;
44 + this->p_num_columns = new_cols;
46 + p_row_step=this->p_num_columns;
47 + this->p_column_step=1;
50 + this->p_memory = new_m;
53 - *old_vals = p_memory;
54 + *old_vals = this->p_memory;
59 void EST_TMatrix<T>::resize(int new_rows, int new_cols, int set)
62 - T * old_vals = p_memory;
63 + T * old_vals = this->p_memory;
64 int old_rows = num_rows();
65 int old_cols = num_columns();
66 int old_row_step = p_row_step;
67 - int old_offset = p_offset;
68 - int old_column_step = p_column_step;
69 + int old_offset = this->p_offset;
70 + int old_column_step = this->p_column_step;
76 for(i=0; i<copy_r; i++)
77 for(j=copy_c; j<new_cols; j++)
78 - a_no_check(i,j) = *def_val;
79 + a_no_check(i,j) = *this->def_val;
81 for(i=copy_r; i<new_rows; i++)
82 for(j=0; j<new_cols; j++)
83 - a_no_check(i,j) = *def_val;
84 + a_no_check(i,j) = *this->def_val;
87 - if (old_vals && old_vals != p_memory && !p_sub_matrix)
88 + if (old_vals && old_vals != this->p_memory && !this->p_sub_matrix)
89 delete [] (old_vals-old_offset);
93 bool EST_TMatrix<T>::have_rows_before(int n) const
95 - return p_offset >= n*p_row_step;
96 + return this->p_offset >= n*p_row_step;
100 bool EST_TMatrix<T>::have_columns_before(int n) const
102 - return p_offset >= n*p_column_step;
103 + return this->p_offset >= n*this->p_column_step;
107 @@ -335,10 +335,10 @@
111 - <<",m="<<((int)p_memory)<<","
112 - <<"r'="<<((int)((T *) mx_move_pointer_f(p_memory, sizeof(T)*p_row_step, i)))<<","
113 - <<"r="<<((int)mx_move_pointer(p_memory, T, p_row_step, i))<<","
114 - <<"c="<<((int)mx_move_pointer(p_memory, T, p_column_step, j))<<","
115 + <<",m="<<((int)this->p_memory)<<","
116 + <<"r'="<<((int)((T *) mx_move_pointer_f(this->p_memory, sizeof(T)*p_row_step, i)))<<","
117 + <<"r="<<((int)mx_move_pointer(this->p_memory, T, p_row_step, i))<<","
118 + <<"c="<<((int)mx_move_pointer(this->p_memory, T, this->p_column_step, j))<<","
119 <<((int)(&fast_a_m_gcc(i,j)))
122 @@ -506,12 +506,12 @@
124 rv.p_sub_matrix = TRUE;
125 rv.p_num_columns = len;
126 - rv.p_offset = p_offset + start_c*p_column_step + r*p_row_step;
127 - rv.p_memory = p_memory - p_offset + rv.p_offset;
128 + rv.p_offset = this->p_offset + start_c*this->p_column_step + r*p_row_step;
129 + rv.p_memory = this->p_memory - this->p_offset + rv.p_offset;
130 // cout << "mrow: mem: " << rv.p_memory << " (" << (int)rv.p_memory << ")\n";
131 // cout << "mrow: ofset: " << rv.p_offset << " (" << (int)rv.p_offset << ")\n";
133 - rv.p_column_step=p_column_step;
134 + rv.p_column_step=this->p_column_step;
140 cv.p_sub_matrix = TRUE;
141 cv.p_num_columns = len;
142 - cv.p_offset = p_offset + c*p_column_step + start_r*p_row_step;
143 - cv.p_memory = p_memory -p_offset + cv.p_offset;
144 + cv.p_offset = this->p_offset + c*this->p_column_step + start_r*p_row_step;
145 + cv.p_memory = this->p_memory - this->p_offset + cv.p_offset;
146 // cout << "mcol: mem: " << cv.p_memory << " (" << (int)cv.p_memory << ")\n";
147 // cout << "mcol: offset: " << cv.p_offset << " (" << (int)cv.p_offset << ")\n";
149 @@ -552,10 +552,10 @@
150 delete [] (sm.p_memory - sm.p_offset);
152 sm.p_sub_matrix = TRUE;
153 - sm.p_offset = p_offset + c*p_column_step + r*p_row_step;
154 - sm.p_memory = p_memory - p_offset + sm.p_offset;
155 + sm.p_offset = this->p_offset + c*this->p_column_step + r*p_row_step;
156 + sm.p_memory = this->p_memory - this->p_offset + sm.p_offset;
157 sm.p_row_step=p_row_step;
158 - sm.p_column_step=p_column_step;
159 + sm.p_column_step=this->p_column_step;
160 sm.p_num_rows = len_r;
161 sm.p_num_columns = len_c;
163 diff -uNr speech_tools.orig/base_class/EST_TNamedEnum.cc speech_tools/base_class/EST_TNamedEnum.cc
164 --- speech_tools.orig/base_class/EST_TNamedEnum.cc 2001-04-04 15:11:27.000000000 +0200
165 +++ speech_tools/base_class/EST_TNamedEnum.cc 2004-04-20 01:06:36.244622312 +0200
167 for(n=1; defs[n].token != defs[0].token; n++)
171 - definitions = new defn[n];
172 + this->ndefinitions = n;
173 + this->definitions = new defn[n];
175 - definitions[0] = defs[0];
176 + this->definitions[0] = defs[0];
177 for(n=1; defs[n].token != defs[0].token; n++)
178 - definitions[n] = defs[n];
179 + this->definitions[n] = defs[n];
181 - p_unknown_enum = defs[n].token;
182 - p_unknown_value = defs[n].values[0];
183 + this->p_unknown_enum = defs[n].token;
184 + this->p_unknown_value = defs[n].values[0];
187 template<class ENUM, class VAL, class INFO>
189 // fprintf(stderr, ": %d '%s' '%s'\n", n, defs[n].token, defs[0].token);
193 + this->ndefinitions = n;
194 typedef EST_TValuedEnumDefinition<ENUM,VAL,INFO> defn;
195 - definitions = new defn[n];
196 + this->definitions = new defn[n];
198 - definitions[0].token = conv(defs[0].token);
199 + this->definitions[0].token = conv(defs[0].token);
200 for(int i=0; i<NAMED_ENUM_MAX_SYNONYMS; i++)
201 - definitions[0].values[i] = defs[0].values[i];
202 - definitions[0].info = defs[0].info;
203 + this->definitions[0].values[i] = defs[0].values[i];
204 + this->definitions[0].info = defs[0].info;
205 for(n=1; strcmp(defs[n].token, defs[0].token) != 0; n++)
207 - definitions[n].token = conv(defs[n].token);
208 + this->definitions[n].token = conv(defs[n].token);
209 for(int i2=0; i2<NAMED_ENUM_MAX_SYNONYMS; i2++)
210 - definitions[n].values[i2] = defs[n].values[i2];
211 - definitions[n].info = defs[n].info;
212 + this->definitions[n].values[i2] = defs[n].values[i2];
213 + this->definitions[n].info = defs[n].info;
216 - p_unknown_enum = conv(defs[n].token);
217 - p_unknown_value = defs[n].values[0];
218 + this->p_unknown_enum = conv(defs[n].token);
219 + this->p_unknown_value = defs[n].values[0];
222 template<class ENUM, class VAL, class INFO>
223 EST_TValuedEnumI<ENUM,VAL,INFO>::~EST_TValuedEnumI(void)
226 - delete[] definitions;
227 + if (this->definitions)
228 + delete[] this->definitions;
231 template<class ENUM, class VAL, class INFO>
232 int EST_TValuedEnumI<ENUM,VAL,INFO>::n(void) const
234 -return ndefinitions;
235 +return this->ndefinitions;
238 template<class ENUM, class VAL, class INFO>
239 @@ -125,11 +125,11 @@
243 - for(i=0; i<ndefinitions; i++)
244 - if (definitions[i].token == token)
245 - return definitions[i].values[n];
246 + for(i=0; i<this->ndefinitions; i++)
247 + if (this->definitions[i].token == token)
248 + return this->definitions[i].values[n];
250 - return p_unknown_value;
251 + return this->p_unknown_value;
254 template<class ENUM, class VAL, class INFO>
259 - for(i=0; i<ndefinitions; i++)
260 - if (definitions[i].token == token)
261 - return definitions[i].info;
262 + for(i=0; i<this->ndefinitions; i++)
263 + if (this->definitions[i].token == token)
264 + return this->definitions[i].info;
266 cerr << "Fetching info for invalid entry\n";
268 @@ -151,10 +151,10 @@
269 template<class ENUM, class VAL, class INFO>
270 ENUM EST_TValuedEnumI<ENUM,VAL,INFO>::nth_token (int n) const
272 - if (n>=0 && n < ndefinitions)
273 - return definitions[n].token;
274 + if (n>=0 && n < this->ndefinitions)
275 + return this->definitions[n].token;
277 - return p_unknown_enum;
278 + return this->p_unknown_enum;
281 template<class ENUM, class VAL, class INFO>
282 @@ -162,12 +162,12 @@
286 - for(i=0; i<ndefinitions; i++)
287 - for(j=0; j<NAMED_ENUM_MAX_SYNONYMS && definitions[i].values[j] ; j++)
288 - if (eq_vals(definitions[i].values[j], value))
289 - return definitions[i].token;
290 + for(i=0; i<this->ndefinitions; i++)
291 + for(j=0; j<NAMED_ENUM_MAX_SYNONYMS && this->definitions[i].values[j] ; j++)
292 + if (eq_vals(this->definitions[i].values[j], value))
293 + return this->definitions[i].token;
295 - return p_unknown_enum;
296 + return this->p_unknown_enum;
300 @@ -186,11 +186,11 @@
301 if ((file=fopen(name, "rb"))==NULL)
302 return misc_read_error;
305 - delete[] definitions;
306 + if (this->definitions)
307 + delete[] this->definitions;
311 + this->ndefinitions= -1;
312 + this->definitions=NULL;
314 buffer[LINE_LENGTH-1] = 'x';
316 @@ -202,27 +202,27 @@
320 - if (ndefinitions>=0 && quote != '\0' && buffer[0] == '=')
321 + if (this->ndefinitions>=0 && quote != '\0' && buffer[0] == '=')
323 // definition by number
325 - if ( n>= ndefinitions)
326 + if ( n>= this->ndefinitions)
328 cerr << "too many definitions\n";
332 int ntokens = split(line, tokens, NAMED_ENUM_MAX_SYNONYMS+2, RXwhite, '"');
333 - definitions[n].token = (ENUM)atoi(tokens[0].after(0,1));
334 + this->definitions[n].token = (ENUM)atoi(tokens[0].after(0,1));
336 for(int i=1; i<ntokens; i++)
337 - definitions[n].values[i-1] = wstrdup(tokens[i].unquote_if_needed(quote));
338 + this->definitions[n].values[i-1] = wstrdup(tokens[i].unquote_if_needed(quote));
339 for(int j=ntokens-1 ; j< NAMED_ENUM_MAX_SYNONYMS; j++)
340 - definitions[n].values[j]=NULL;
341 + this->definitions[n].values[j]=NULL;
345 - else if (have_unknown && ndefinitions>=0 && quote != '\0' && buffer[0] == quote)
346 + else if (have_unknown && this->ndefinitions>=0 && quote != '\0' && buffer[0] == quote)
348 // definition by standard name
351 cerr << "can't use names in this definition\n";
354 - if ( n>= ndefinitions)
355 + if ( n>= this->ndefinitions)
357 cerr << "too many definitions\n";
359 @@ -238,12 +238,12 @@
361 int ntokens = split(line, tokens, NAMED_ENUM_MAX_SYNONYMS+2, RXwhite, quote);
363 - definitions[n].token = definitive->token(tokens[0].unquote(quote));
364 + this->definitions[n].token = definitive->token(tokens[0].unquote(quote));
366 for(int i=1; i<ntokens; i++)
367 - definitions[n].values[i-1] = wstrdup(tokens[i].unquote_if_needed(quote));
368 + this->definitions[n].values[i-1] = wstrdup(tokens[i].unquote_if_needed(quote));
369 for(int j=ntokens-1 ; j< NAMED_ENUM_MAX_SYNONYMS; j++)
370 - definitions[n].values[j]=NULL;
371 + this->definitions[n].values[j]=NULL;
375 @@ -269,16 +269,16 @@
377 else if (key == "number")
379 - ndefinitions=atoi(line.after(eq,1));
380 + this->ndefinitions=atoi(line.after(eq,1));
381 // cout << "n = '" << ndefinitions << "'\n";
382 - definitions = new Defn[ndefinitions];
383 - for(int i=0; i<ndefinitions; i++)
384 - definitions[i].values[0] =NULL;
385 + this->definitions = new Defn[this->ndefinitions];
386 + for(int i=0; i<this->ndefinitions; i++)
387 + this->definitions[i].values[0] =NULL;
390 else if (key == "unknown")
392 - p_unknown_enum=(ENUM)atoi(line.after(eq,1));
393 + this->p_unknown_enum=(ENUM)atoi(line.after(eq,1));
394 // cout << "unknown = '" << p_unknown_enum << "'\n";
397 @@ -305,20 +305,20 @@
398 if ((file=fopen(name, "wb"))==NULL)
401 - fprintf(file, "unknown=%d\n", p_unknown_enum);
402 + fprintf(file, "unknown=%d\n", this->p_unknown_enum);
403 fprintf(file, "quote=%c\n", quote);
404 - fprintf(file, "number=%d\n", ndefinitions);
405 + fprintf(file, "number=%d\n", this->ndefinitions);
407 - for(int i=0; i<ndefinitions; i++)
408 - if (definitions[i].values[0])
409 + for(int i=0; i<this->ndefinitions; i++)
410 + if (this->definitions[i].values[0])
413 - fprintf(file, "%s ", (const char *)EST_String(definitive->name(definitions[i].token)).quote(quote));
414 + fprintf(file, "%s ", (const char *)EST_String(definitive->name(this->definitions[i].token)).quote(quote));
416 - fprintf(file, "=%d ", (int)definitions[i].token);
417 + fprintf(file, "=%d ", (int)this->definitions[i].token);
419 - for(int j=0; j<NAMED_ENUM_MAX_SYNONYMS && definitions[i].values[j] != NULL; j++)
420 - fprintf(file, "%s ", (const char *) EST_String(definitions[i].values[j]).quote_if_needed(quote));
421 + for(int j=0; j<NAMED_ENUM_MAX_SYNONYMS && this->definitions[i].values[j] != NULL; j++)
422 + fprintf(file, "%s ", (const char *) EST_String(this->definitions[i].values[j]).quote_if_needed(quote));
426 diff -uNr speech_tools.orig/base_class/EST_TSimpleMatrix.cc speech_tools/base_class/EST_TSimpleMatrix.cc
427 --- speech_tools.orig/base_class/EST_TSimpleMatrix.cc 2001-04-04 13:55:32.000000000 +0200
428 +++ speech_tools/base_class/EST_TSimpleMatrix.cc 2004-04-20 01:06:36.245622160 +0200
431 void EST_TSimpleMatrix<T>::copy_data(const EST_TSimpleMatrix<T> &a)
433 - if (!a.p_sub_matrix && !p_sub_matrix)
434 - memcpy((void *)&a_no_check(0,0),
435 + if (!a.p_sub_matrix && !this->p_sub_matrix)
436 + memcpy((void *)&this->a_no_check(0,0),
437 (const void *)&a.a_no_check(0,0),
438 - num_rows()*num_columns()*sizeof(T)
439 + this->num_rows()*this->num_columns()*sizeof(T)
443 - for (int i = 0; i < num_rows(); ++i)
444 - for (int j = 0; j < num_columns(); ++j)
445 - a_no_check(i,j) = a.a_no_check(i,j);
446 + for (int i = 0; i < this->num_rows(); ++i)
447 + for (int j = 0; j < this->num_columns(); ++j)
448 + this->a_no_check(i,j) = a.a_no_check(i,j);
453 void EST_TSimpleMatrix<T>::copy(const EST_TSimpleMatrix<T> &a)
455 - if (num_rows() != a.num_rows() || num_columns() != a.num_columns())
456 + if (this->num_rows() != a.num_rows() || this->num_columns() != a.num_columns())
457 resize(a.num_rows(), a.num_columns(), 0);
464 - int old_offset = p_offset;
465 + int old_offset = this->p_offset;
468 - new_rows = num_rows();
469 + new_rows = this->num_rows();
471 - new_cols = num_columns();
472 + new_cols = this->num_columns();
476 - if (!p_sub_matrix && new_cols == num_columns() && new_rows != num_rows())
477 + if (!this->p_sub_matrix && new_cols == this->num_columns() && new_rows != this->num_rows())
479 - int copy_r = Lof(num_rows(), new_rows);
480 + int copy_r = Lof(this->num_rows(), new_rows);
482 just_resize(new_rows, new_cols, &old_vals);
484 - memcpy((void *)p_memory,
485 + memcpy((void *)this->p_memory,
486 (const void *)old_vals,
487 copy_r*new_cols*sizeof(T));
491 if (new_rows > copy_r)
493 + if (*this->def_val == 0)
495 - memset((void *)(p_memory + copy_r*p_row_step),
496 + memset((void *)(this->p_memory + copy_r*this->p_row_step),
498 (new_rows-copy_r)*new_cols*sizeof(T));
500 @@ -115,15 +115,15 @@
502 for(j=0; j<new_cols; j++)
503 for(i=copy_r; i<new_rows; i++)
504 - a_no_check(i,j) = *def_val;
505 + this->a_no_check(i,j) = *this->def_val;
508 - else if (!p_sub_matrix)
509 + else if (!this->p_sub_matrix)
511 - int old_row_step = p_row_step;
512 - int old_column_step = p_column_step;
513 - int copy_r = Lof(num_rows(), new_rows);
514 - int copy_c = Lof(num_columns(), new_cols);
515 + int old_row_step = this->p_row_step;
516 + int old_column_step = this->p_column_step;
517 + int copy_r = Lof(this->num_rows(), new_rows);
518 + int copy_c = Lof(this->num_columns(), new_cols);
520 just_resize(new_rows, new_cols, &old_vals);
522 @@ -136,12 +136,12 @@
524 for(i=0; i<copy_r; i++)
525 for(j=copy_c; j<new_cols; j++)
526 - a_no_check(i,j) = *def_val;
527 + this->a_no_check(i,j) = *this->def_val;
529 if (new_rows > copy_r)
531 + if (*this->def_val == 0)
533 - memset((void *)(p_memory + copy_r*p_row_step),
534 + memset((void *)(this->p_memory + copy_r*this->p_row_step),
536 (new_rows-copy_r)*new_cols*sizeof(T));
540 for(j=0; j<new_cols; j++)
541 for(i=copy_r; i<new_rows; i++)
542 - a_no_check(i,j) = *def_val;
543 + this->a_no_check(i,j) = *this->def_val;
549 EST_TMatrix<T>::resize(new_rows, new_cols, 0);
551 - if (old_vals && old_vals != p_memory)
552 + if (old_vals && old_vals != this->p_memory)
553 delete [] (old_vals-old_offset);
556 diff -uNr speech_tools.orig/base_class/EST_TSimpleVector.cc speech_tools/base_class/EST_TSimpleVector.cc
557 --- speech_tools.orig/base_class/EST_TSimpleVector.cc 2001-04-04 13:55:32.000000000 +0200
558 +++ speech_tools/base_class/EST_TSimpleVector.cc 2004-04-20 01:06:36.246622008 +0200
561 template<class T> void EST_TSimpleVector<T>::copy(const EST_TSimpleVector<T> &a)
563 - if (p_column_step==1 && a.p_column_step==1)
564 + if (this->p_column_step==1 && a.p_column_step==1)
566 resize(a.n(), FALSE);
567 - memcpy((void *)(p_memory), (const void *)(a.p_memory), n() * sizeof(T));
568 + memcpy((void *)(this->p_memory), (const void *)(a.p_memory), this->n() * sizeof(T));
571 ((EST_TVector<T> *)this)->copy(a);
574 template<class T> EST_TSimpleVector<T>::EST_TSimpleVector(const EST_TSimpleVector<T> &in)
577 + this->default_vals();
581 // should copy from and delete old version first
582 template<class T> void EST_TSimpleVector<T>::resize(int newn, int set)
585 + int oldn = this->n();
587 - int old_offset = p_offset;
588 + int old_offset = this->p_offset;
590 just_resize(newn, &old_vals);
595 - if (p_memory != NULL)
596 + if (this->p_memory != NULL)
598 - copy_c = Lof(n(), oldn);
599 - memcpy((void *)p_memory, (const void *)old_vals, copy_c* sizeof(T));
600 + copy_c = Lof(this->n(), oldn);
601 + memcpy((void *)this->p_memory, (const void *)old_vals, copy_c* sizeof(T));
604 - for (int i=copy_c; i < n(); ++i)
605 - p_memory[i] = *def_val;
606 + for (int i=copy_c; i < this->n(); ++i)
607 + this->p_memory[i] = *this->def_val;
610 - if (old_vals != NULL && old_vals != p_memory && !p_sub_matrix)
611 + if (old_vals != NULL && old_vals != this->p_memory && !this->p_sub_matrix)
612 delete [] (old_vals - old_offset);
616 void EST_TSimpleVector<T>::copy_section(T* dest, int offset, int num) const
619 - num = num_columns()-offset;
620 + num = this->num_columns()-offset;
622 - if (!EST_vector_bounds_check(num+offset-1, num_columns(), FALSE))
623 + if (!EST_vector_bounds_check(num+offset-1, this->num_columns(), FALSE))
626 - if (!p_sub_matrix && p_column_step==1)
627 - memcpy((void *)dest, (const void *)(p_memory+offset), num*sizeof(T));
628 + if (!this->p_sub_matrix && this->p_column_step==1)
629 + memcpy((void *)dest, (const void *)(this->p_memory+offset), num*sizeof(T));
631 for(int i=0; i<num; i++)
632 - dest[i] = a_no_check(offset+i);
633 + dest[i] = this->a_no_check(offset+i);
637 void EST_TSimpleVector<T>::set_section(const T* src, int offset, int num)
640 - num = num_columns()-offset;
641 + num = this->num_columns()-offset;
643 - if (!EST_vector_bounds_check(num+offset-1, num_columns(), FALSE))
644 + if (!EST_vector_bounds_check(num+offset-1, this->num_columns(), FALSE))
647 - if (!p_sub_matrix && p_column_step==1)
648 - memcpy((void *)(p_memory+offset), (void *)src, num*sizeof(T));
649 + if (!this->p_sub_matrix && this->p_column_step==1)
650 + memcpy((void *)(this->p_memory+offset), (void *)src, num*sizeof(T));
652 for(int i=0; i<num; i++)
653 - a_no_check(offset+i) = src[i];
654 + this->a_no_check(offset+i) = src[i];
657 template<class T> EST_TSimpleVector<T> &EST_TSimpleVector<T>::operator=(const EST_TSimpleVector<T> &in)
660 template<class T> void EST_TSimpleVector<T>::zero()
662 - if (p_column_step==1)
663 - memset((void *)(p_memory), 0, n() * sizeof(T));
664 + if (this->p_column_step==1)
665 + memset((void *)(this->p_memory), 0, this->n() * sizeof(T));
667 - ((EST_TVector<T> *)this)->fill(*def_val);
668 + ((EST_TVector<T> *)this)->fill(*this->def_val);
671 diff -uNr speech_tools.orig/base_class/EST_Tvectlist.cc speech_tools/base_class/EST_Tvectlist.cc
672 --- speech_tools.orig/base_class/EST_Tvectlist.cc 2001-04-04 13:55:32.000000000 +0200
673 +++ speech_tools/base_class/EST_Tvectlist.cc 2004-04-20 01:06:48.954690088 +0200
676 /*=======================================================================*/
678 +#include "EST_TList.h"
679 #include "EST_TVector.h"
680 #include "EST_cutils.h"
684 v.resize(in.length(), FALSE);
687 - for (i = 0, p = in.head(); p!= 0; p = next(p), ++i)
689 + for (p = in.head(); p!= 0; p = next(p), ++i)
690 v.a_no_check(i) = in.item(p);
695 a.resize(in.length(), FALSE);
697 - for (i = 0, p = in.head(); p!= 0; p = next(p), ++i)
699 + for (p = in.head(); p!= 0; p = next(p), ++i)
703 diff -uNr speech_tools.orig/base_class/inst_tmpl/vector_dmatrix_t.cc speech_tools/base_class/inst_tmpl/vector_dmatrix_t.cc
704 --- speech_tools.orig/base_class/inst_tmpl/vector_dmatrix_t.cc 2001-04-04 13:55:32.000000000 +0200
705 +++ speech_tools/base_class/inst_tmpl/vector_dmatrix_t.cc 2004-04-20 01:06:36.254620792 +0200
708 static const EST_DMatrix def_val_DMatrix;
709 static EST_DMatrix error_return_DMatrix;
710 -const EST_DMatrix *EST_TVector<EST_DMatrix>::def_val = &def_val_DMatrix;
711 -EST_DMatrix *EST_TVector<EST_DMatrix>::error_return = &error_return_DMatrix;
712 +template <> const EST_DMatrix *EST_TVector<EST_DMatrix>::def_val = &def_val_DMatrix;
713 +template <> EST_DMatrix *EST_TVector<EST_DMatrix>::error_return = &error_return_DMatrix;
715 int operator !=(const EST_DMatrix &fm1,
716 const EST_DMatrix &fm2)
717 diff -uNr speech_tools.orig/base_class/inst_tmpl/vector_dvector_t.cc speech_tools/base_class/inst_tmpl/vector_dvector_t.cc
718 --- speech_tools.orig/base_class/inst_tmpl/vector_dvector_t.cc 2001-04-04 13:55:32.000000000 +0200
719 +++ speech_tools/base_class/inst_tmpl/vector_dvector_t.cc 2004-04-20 01:06:36.255620640 +0200
722 static const EST_DVector def_val_DVector;
723 static EST_DVector error_return_DVector;
724 -const EST_DVector *EST_TVector<EST_DVector>::def_val = &def_val_DVector;
725 -EST_DVector *EST_TVector<EST_DVector>::error_return = &error_return_DVector;
726 +template <> const EST_DVector *EST_TVector<EST_DVector>::def_val = &def_val_DVector;
727 +template <> EST_DVector *EST_TVector<EST_DVector>::error_return = &error_return_DVector;
729 int operator !=(const EST_DVector &fv1,
730 const EST_DVector &fv2)
731 diff -uNr speech_tools.orig/base_class/inst_tmpl/vector_fmatrix_t.cc speech_tools/base_class/inst_tmpl/vector_fmatrix_t.cc
732 --- speech_tools.orig/base_class/inst_tmpl/vector_fmatrix_t.cc 2001-04-04 13:55:32.000000000 +0200
733 +++ speech_tools/base_class/inst_tmpl/vector_fmatrix_t.cc 2004-04-20 01:06:36.256620488 +0200
736 static const EST_FMatrix def_val_FMatrix;
737 static EST_FMatrix error_return_FMatrix;
738 -const EST_FMatrix *EST_TVector<EST_FMatrix>::def_val = &def_val_FMatrix;
739 -EST_FMatrix *EST_TVector<EST_FMatrix>::error_return = &error_return_FMatrix;
740 +template <> const EST_FMatrix *EST_TVector<EST_FMatrix>::def_val = &def_val_FMatrix;
741 +template <> EST_FMatrix *EST_TVector<EST_FMatrix>::error_return = &error_return_FMatrix;
743 int operator !=(const EST_FMatrix &fm1,
744 const EST_FMatrix &fm2)
745 diff -uNr speech_tools.orig/grammar/scfg/EST_SCFG_inout.cc speech_tools/grammar/scfg/EST_SCFG_inout.cc
746 --- speech_tools.orig/grammar/scfg/EST_SCFG_inout.cc 2001-04-04 13:55:32.000000000 +0200
747 +++ speech_tools/grammar/scfg/EST_SCFG_inout.cc 2004-04-20 01:06:36.257620336 +0200
750 static const EST_bracketed_string def_val_s;
751 static EST_bracketed_string error_return_s;
752 -const EST_bracketed_string *EST_TVector<EST_bracketed_string>::def_val=&def_val_s;
753 -EST_bracketed_string *EST_TVector<EST_bracketed_string>::error_return=&error_return_s;
754 +template <> const EST_bracketed_string *EST_TVector<EST_bracketed_string>::def_val=&def_val_s;
755 +template <> EST_bracketed_string *EST_TVector<EST_bracketed_string>::error_return=&error_return_s;
758 #if defined(INSTANTIATE_TEMPLATES)
759 diff -uNr speech_tools.orig/grammar/wfst/wfst_ops.cc speech_tools/grammar/wfst/wfst_ops.cc
760 --- speech_tools.orig/grammar/wfst/wfst_ops.cc 2001-09-25 19:02:06.000000000 +0200
761 +++ speech_tools/grammar/wfst/wfst_ops.cc 2004-04-20 01:06:36.259620032 +0200
763 static EST_IList int_EST_IList_kv_def_EST_IList_s;
764 static int int_EST_IList_kv_def_int_s;
766 - EST_IList *EST_TKVL< int, EST_IList >::default_val=&int_EST_IList_kv_def_EST_IList_s;
767 - int *EST_TKVL< int, EST_IList >::default_key=&int_EST_IList_kv_def_int_s;
768 + template <> EST_IList *EST_TKVL< int, EST_IList >::default_val=&int_EST_IList_kv_def_EST_IList_s;
769 + template <> int *EST_TKVL< int, EST_IList >::default_key=&int_EST_IList_kv_def_int_s;
771 Declare_TList_N(KVI_int_EST_IList_t, 0)
773 diff -uNr speech_tools.orig/include/EST_THash.h speech_tools/include/EST_THash.h
774 --- speech_tools.orig/include/EST_THash.h 2002-12-26 16:48:53.000000000 +0100
775 +++ speech_tools/include/EST_THash.h 2004-04-20 01:06:36.261619728 +0200
779 /// Create a string hash table of <parameter>size</parameter> buckets.
780 - EST_TStringHash(int size) : EST_THash<EST_String, V>(size, StringHash) {};
781 + EST_TStringHash(int size) : EST_THash<EST_String, V>(size, EST_HashFunctions::StringHash) {};
783 /// An entry returned by the iterator is a key value pair.
784 typedef EST_Hash_Pair<EST_String, V> Entry;
788 /// Give the iterator a sensible name.
789 - typedef EST_TStructIterator< EST_THash<EST_String, V>, IPointer, EST_Hash_Pair<EST_String, V> > Entries;
790 + typedef EST_TStructIterator< EST_THash<EST_String, V>, typename EST_THash<EST_String, V>::IPointer,
791 + EST_Hash_Pair<EST_String, V> > Entries;
793 - typedef EST_TRwStructIterator< EST_THash<EST_String, V>, IPointer, EST_Hash_Pair<EST_String, V> > RwEntries;
794 + typedef EST_TRwStructIterator< EST_THash<EST_String, V>, typename EST_THash<EST_String, V>::IPointer,
795 + EST_Hash_Pair<EST_String, V> > RwEntries;
798 typedef EST_String KeyEntry;
800 typedef struct IPointer_k_s IPointer_k; */
802 /// Give the iterator a sensible name.
803 - typedef EST_TIterator< EST_THash<EST_String, V>, IPointer_k, EST_String > KeyEntries;
804 - typedef EST_TRwIterator< EST_THash<EST_String, V>, IPointer_k, EST_String > KeyRwEntries;
805 + typedef EST_TIterator< EST_THash<EST_String, V>, typename EST_THash<EST_String, V>::IPointer_k,
806 + EST_String > KeyEntries;
807 + typedef EST_TRwIterator< EST_THash<EST_String, V>, typename EST_THash<EST_String, V>::IPointer_k,
808 + EST_String > KeyRwEntries;
812 diff -uNr speech_tools.orig/include/EST_TIterator.h speech_tools/include/EST_TIterator.h
813 --- speech_tools.orig/include/EST_TIterator.h 2002-12-26 16:48:54.000000000 +0100
814 +++ speech_tools/include/EST_TIterator.h 2004-04-20 01:06:36.263619424 +0200
815 @@ -201,18 +201,18 @@
816 typedef EST_TIterator<Container, IPointer, Entry> Iter;
818 /// Create an iterator not associated with any specific container.
819 - EST_TStructIterator() {cont=NULL;}
820 + EST_TStructIterator() {this->cont=NULL;}
822 /// Copy an iterator by assignment
823 Iter &operator = (const Iter &orig)
824 - { cont=orig.cont; pos=orig.pos; pointer=orig.pointer; return *this;}
825 + { this->cont=orig.cont; this->pos=orig.pos; this->pointer=orig.pointer; return *this;}
827 /// Create an iterator ready to run over the given container.
828 EST_TStructIterator(const Container &over)
831 const Entry *operator ->() const
832 - {return ¤t();}
833 + {return &this->current();}
836 template <class Container, class IPointer, class Entry>
837 @@ -231,11 +231,11 @@
838 typedef EST_TIterator<Container, IPointer, Entry> Iter;
840 /// Create an iterator not associated with any specific container.
841 - EST_TRwIterator() {cont=NULL;}
842 + EST_TRwIterator() {this->cont=NULL;}
844 /// Copy an iterator by assignment
845 Iter &operator = (const Iter &orig)
846 - { cont=orig.cont; pos=orig.pos; pointer=orig.pointer; return *this;}
847 + { this->cont=orig.cont; this->pos=orig.pos; this->pointer=orig.pointer; return *this;}
849 /// Create an iterator ready to run over the given container.
850 EST_TRwIterator(Container &over)
851 @@ -243,14 +243,14 @@
853 /// Set the iterator ready to run over this container.
854 void begin(Container &over)
855 - {cont=&over; beginning();}
856 + {this->cont=&over; this->beginning();}
861 /// Return the element currentl pointed to.
862 Entry& current() const
863 - {return cont->points_at(pointer);}
864 + {return this->cont->points_at(this->pointer);}
866 /// The * operator returns the current element.
867 Entry &operator *() const
869 /// Return the current element and move the pointer forwards.
870 Entry& next_element()
872 - Entry &it = cont->points_at(pointer);
873 - cont->move_pointer_forwards(pointer);
874 + Entry &it = this->cont->points_at(this->pointer);
875 + this->cont->move_pointer_forwards(this->pointer);
879 @@ -281,18 +281,18 @@
880 typedef EST_TIterator<Container, IPointer, Entry> Iter;
882 /// Create an iterator not associated with any specific container.
883 - EST_TRwStructIterator() {cont=NULL;}
884 + EST_TRwStructIterator() {this->cont=NULL;}
886 /// Copy an iterator by assignment
887 Iter &operator = (const Iter &orig)
888 - { cont=orig.cont; pos=orig.pos; pointer=orig.pointer; return *this;}
889 + { this->cont=orig.cont; this->pos=orig.pos; this->pointer=orig.pointer; return *this;}
891 /// Create an iterator ready to run over the given container.
892 EST_TRwStructIterator(Container &over)
895 Entry *operator ->() const
896 - {return ¤t();}
897 + {return &this->current();}
901 diff -uNr speech_tools.orig/include/EST_TMatrix.h speech_tools/include/EST_TMatrix.h
902 --- speech_tools.orig/include/EST_TMatrix.h 2001-07-25 13:02:36.000000000 +0200
903 +++ speech_tools/include/EST_TMatrix.h 2004-04-20 01:06:36.264619272 +0200
907 return mcell_pos(r, c,
908 - p_row_step, p_column_step);
909 + this->p_row_step, this->p_column_step);
912 INLINE unsigned int mcell_pos_1(int r, int c) const
913 @@ -116,14 +116,14 @@
915 /// quick method for returning {\tt x[m][n]}
916 INLINE const T &fast_a_m(int r, int c) const
917 - { return p_memory[mcell_pos(r,c)]; }
918 + { return this->p_memory[mcell_pos(r,c)]; }
919 INLINE T &fast_a_m(int r, int c)
920 - { return p_memory[mcell_pos(r,c)]; }
921 + { return this->p_memory[mcell_pos(r,c)]; }
923 INLINE const T &fast_a_1(int r, int c) const
924 - { return p_memory[mcell_pos_1(r,c)]; }
925 + { return this->p_memory[mcell_pos_1(r,c)]; }
926 INLINE T &fast_a_1(int r, int c)
927 - { return p_memory[mcell_pos_1(r,c)]; }
928 + { return this->p_memory[mcell_pos_1(r,c)]; }
931 /// Get and set values from array
935 /// return number of rows
936 - int num_rows() const {return p_num_rows;}
937 + int num_rows() const {return this->p_num_rows;}
938 /// return number of columns
939 - int num_columns() const {return p_num_columns;}
940 + int num_columns() const {return this->p_num_columns;}
942 /// const access with no bounds check, care recommend
943 INLINE const T &a_no_check(int row, int col) const
946 /// fill matrix with value v
947 void fill(const T &v);
948 - void fill() { fill(*def_val); }
949 + void fill() { fill(*this->def_val); }
951 /// assignment operator
952 EST_TMatrix &operator=(const EST_TMatrix &s);
953 diff -uNr speech_tools.orig/include/EST_TNamedEnum.h speech_tools/include/EST_TNamedEnum.h
954 --- speech_tools.orig/include/EST_TNamedEnum.h 2001-04-04 13:55:32.000000000 +0200
955 +++ speech_tools/include/EST_TNamedEnum.h 2004-04-20 01:06:36.265619120 +0200
959 EST_TNamedEnumI(EST_TValuedEnumDefinition<ENUM,const char *,INFO> defs[])
960 - {initialise((const void *)defs); };
961 + {this->initialise((const void *)defs); };
962 EST_TNamedEnumI(EST_TValuedEnumDefinition<const char *,const char *,INFO> defs[], ENUM (*conv)(const char *))
963 - {initialise((const void *)defs, conv); };
964 + {this->initialise((const void *)defs, conv); };
965 const char *name(ENUM tok, int n=0) const {return value(tok,n); };
969 template<class ENUM, class VAL> class EST_TValuedEnum : public EST_TValuedEnumI<ENUM,VAL,NO_INFO> {
971 EST_TValuedEnum(EST_TValuedEnumDefinition<ENUM,VAL,NO_INFO> defs[])
972 - {initialise((const void *)defs);};
973 + {this->initialise((const void *)defs);};
974 EST_TValuedEnum(EST_TValuedEnumDefinition<const char *,VAL,NO_INFO> defs[], ENUM (*conv)(const char *))
975 - {initialise((const void *)defs, conv);};
976 + {this->initialise((const void *)defs, conv);};
980 @@ -148,11 +148,11 @@
981 EST_write_status priv_save(EST_String name, EST_TNamedEnum *definitive, char quote) const;
983 EST_TNamedEnum(ENUM undef_e, const char *undef_n = NULL)
984 - {initialise(undef_e, undef_n);};
985 + {this->initialise(undef_e, undef_n);};
986 EST_TNamedEnum(EST_TValuedEnumDefinition<ENUM,const char *,NO_INFO> defs[])
987 - {initialise((const void *)defs);};
988 + {this->initialise((const void *)defs);};
989 EST_TNamedEnum(EST_TValuedEnumDefinition<const char *,const char *,NO_INFO> defs[], ENUM (*conv)(const char *))
990 - {initialise((const void *)defs, conv);};
991 + {this->initialise((const void *)defs, conv);};
993 EST_read_status load(EST_String name) { return priv_load(name, NULL); };
994 EST_read_status load(EST_String name, EST_TNamedEnum &definitive) { return priv_load(name, &definitive); };
995 diff -uNr speech_tools.orig/include/EST_TSimpleVector.h speech_tools/include/EST_TSimpleVector.h
996 --- speech_tools.orig/include/EST_TSimpleVector.h 2001-04-04 13:55:32.000000000 +0200
997 +++ speech_tools/include/EST_TSimpleVector.h 2004-04-20 01:06:36.266618968 +0200
1001 /// Fill vector with default value
1002 - void empty(void) { if (*def_val == 0) zero(); else fill(*def_val); }
1003 + void empty(void) { if (*this->def_val == 0) zero(); else fill(*this->def_val); }
1007 diff -uNr speech_tools.orig/include/instantiate/EST_TDequeI.h speech_tools/include/instantiate/EST_TDequeI.h
1008 --- speech_tools.orig/include/instantiate/EST_TDequeI.h 2001-04-04 15:11:27.000000000 +0200
1009 +++ speech_tools/include/instantiate/EST_TDequeI.h 2004-04-20 01:06:36.266618968 +0200
1011 #define Instantiate_TDEQ(T) Instantiate_TDEQ_T(T, T)
1013 #define Declare_TDEQ_T(T, TAG) \
1014 - const T *EST_TDeque< T >::Filler=NULL;
1015 + template <> const T *EST_TDeque< T >::Filler=NULL;
1017 #define Declare_TDEQ_Base_T(T, FILLER ,TAG) \
1018 const T TAG ## _deq_filler=FILLER; \
1019 - const T *EST_TDeque< T >::Filler=& TAG ## _deq_filler;
1020 + template <> const T *EST_TDeque< T >::Filler=& TAG ## _deq_filler;
1023 #define Declare_TDEQ_Class_T(T, FILLER,TAG) \
1024 const T TAG ## _deq_filler(FILLER); \
1025 - const T *EST_TDeque< T >::Filler=& TAG ## _deq_filler;
1026 + template <> const T *EST_TDeque< T >::Filler=& TAG ## _deq_filler;
1028 #define Declare_TDEQ(T) Declare_TDEQ_T(T, T)
1030 diff -uNr speech_tools.orig/include/instantiate/EST_THashI.h speech_tools/include/instantiate/EST_THashI.h
1031 --- speech_tools.orig/include/instantiate/EST_THashI.h 2001-04-04 15:11:27.000000000 +0200
1032 +++ speech_tools/include/instantiate/EST_THashI.h 2004-04-20 01:06:36.267618816 +0200
1036 #define Declare_THash_T(KEY, VAL, TAG) \
1037 - VAL EST_THash< KEY, VAL >::Dummy_Value; \
1038 - KEY EST_THash< KEY, VAL >::Dummy_Key; \
1039 + template <> VAL EST_THash< KEY, VAL >::Dummy_Value; \
1040 + template <> KEY EST_THash< KEY, VAL >::Dummy_Key; \
1041 EST_THash< KEY, VAL > TAG ## _hash_dummy(0);
1043 #define Declare_THash_Base_T(KEY, VAL, DEFAULTK, DEFAULT, ERROR,TAG) \
1044 - KEY EST_THash< KEY, VAL >::Dummy_Key=DEFAULTK; \
1045 - VAL EST_THash<KEY, VAL>::Dummy_Value=DEFAULT;
1046 + template <> KEY EST_THash< KEY, VAL >::Dummy_Key=DEFAULTK; \
1047 + template <> VAL EST_THash<KEY, VAL>::Dummy_Value=DEFAULT;
1049 #define Declare_THash_Class_T(KEY, VAL, DEFAULTK, DEFAULT, ERROR,TAG) \
1050 - KEY EST_THash< KEY, VAL >::Dummy_Key(DEFAULTK); \
1051 - VAL EST_THash<KEY, VAL>::Dummy_Value(DEFAULT);
1052 + template <> KEY EST_THash< KEY, VAL >::Dummy_Key(DEFAULTK); \
1053 + template <> VAL EST_THash<KEY, VAL>::Dummy_Value(DEFAULT);
1055 #define Declare_THash(KEY, VAL) Declare_THash_T(KEY, VAL, KEY ## VAL)
1057 diff -uNr speech_tools.orig/include/instantiate/EST_TKVLI.h speech_tools/include/instantiate/EST_TKVLI.h
1058 --- speech_tools.orig/include/instantiate/EST_TKVLI.h 2001-04-04 15:11:27.000000000 +0200
1059 +++ speech_tools/include/instantiate/EST_TKVLI.h 2004-04-20 01:06:36.268618664 +0200
1061 static VAL TAG##_kv_def_val_s; \
1062 static KEY TAG##_kv_def_key_s; \
1064 - VAL *EST_TKVL< KEY, VAL >::default_val=&TAG##_kv_def_val_s; \
1065 - KEY *EST_TKVL< KEY, VAL >::default_key=&TAG##_kv_def_key_s; \
1066 + template <> VAL *EST_TKVL< KEY, VAL >::default_val=&TAG##_kv_def_val_s; \
1067 + template <> KEY *EST_TKVL< KEY, VAL >::default_key=&TAG##_kv_def_key_s; \
1069 Declare_TList_N(KVI_ ## TAG ## _t, MaxFree)
1070 #define Declare_KVL_T(KEY, VAL, TAG) \
1072 static VAL TAG##_kv_def_val_s=DEFV; \
1073 static KEY TAG##_kv_def_key_s=DEFK; \
1075 - VAL *EST_TKVL< KEY, VAL >::default_val=&TAG##_kv_def_val_s; \
1076 - KEY *EST_TKVL< KEY, VAL >::default_key=&TAG##_kv_def_key_s; \
1077 + template <> VAL *EST_TKVL< KEY, VAL >::default_val=&TAG##_kv_def_val_s; \
1078 + template <> KEY *EST_TKVL< KEY, VAL >::default_key=&TAG##_kv_def_key_s; \
1080 Declare_TList_N(KVI_ ## TAG ## _t, MaxFree)
1081 #define Declare_KVL_Base_T(KEY, VAL, DEFV, DEFK, TAG) \
1083 static VAL TAG##_kv_def_val_s(DEFV); \
1084 static KEY TAG##_kv_def_key_s(DEFK); \
1086 - VAL *EST_TKVL< KEY, VAL >::default_val=&TAG##_kv_def_val_s; \
1087 - KEY *EST_TKVL< KEY, VAL >::default_key=&TAG##_kv_def_key_s; \
1088 + template <> VAL *EST_TKVL< KEY, VAL >::default_val=&TAG##_kv_def_val_s; \
1089 + template <> KEY *EST_TKVL< KEY, VAL >::default_key=&TAG##_kv_def_key_s; \
1091 Declare_TList_N(KVI_ ## TAG ## _t, MaxFree)
1092 #define Declare_KVL_Class_T(KEY, VAL, DEFV, DEFK,TAG) \
1093 diff -uNr speech_tools.orig/include/instantiate/EST_TListI.h speech_tools/include/instantiate/EST_TListI.h
1094 --- speech_tools.orig/include/instantiate/EST_TListI.h 2001-04-04 15:11:27.000000000 +0200
1095 +++ speech_tools/include/instantiate/EST_TListI.h 2004-04-20 01:06:36.269618512 +0200
1098 #define Declare_TList_TN(TYPE,MaxFree,TAG) \
1099 typedef TYPE TLIST_ ## TAG ## _VAL; \
1100 - EST_TItem< TYPE > * EST_TItem< TYPE >::s_free=NULL; \
1101 - unsigned int EST_TItem< TYPE >::s_maxFree=MaxFree; \
1102 - unsigned int EST_TItem< TYPE >::s_nfree=0;
1103 + template <> EST_TItem< TYPE > * EST_TItem< TYPE >::s_free=NULL; \
1104 + template <> unsigned int EST_TItem< TYPE >::s_maxFree=MaxFree; \
1105 + template <> unsigned int EST_TItem< TYPE >::s_nfree=0;
1106 #define Declare_TList_T(TYPE,TAG) \
1107 Declare_TList_TN(TYPE,0,TAG)
1109 diff -uNr speech_tools.orig/include/instantiate/EST_TVectorI.h speech_tools/include/instantiate/EST_TVectorI.h
1110 --- speech_tools.orig/include/instantiate/EST_TVectorI.h 2001-04-04 15:11:27.000000000 +0200
1111 +++ speech_tools/include/instantiate/EST_TVectorI.h 2004-04-20 01:06:36.270618360 +0200
1113 static TYPE const TAG##_vec_def_val_s; \
1114 static TYPE TAG##_vec_error_return_s; \
1116 - TYPE const *EST_TVector< TYPE >::def_val=&TAG##_vec_def_val_s; \
1117 - TYPE *EST_TVector< TYPE >::error_return=&TAG##_vec_error_return_s;
1118 + template <> TYPE const *EST_TVector< TYPE >::def_val=&TAG##_vec_def_val_s; \
1119 + template <> TYPE *EST_TVector< TYPE >::error_return=&TAG##_vec_error_return_s;
1121 #define Declare_TVector_Base_T(TYPE,DEFAULT,ERROR,TAG) \
1122 static TYPE const TAG##_vec_def_val_s=DEFAULT; \
1123 static TYPE TAG##_vec_error_return_s=ERROR; \
1125 - TYPE const *EST_TVector<TYPE>::def_val=&TAG##_vec_def_val_s; \
1126 - TYPE *EST_TVector<TYPE>::error_return=&TAG##_vec_error_return_s;
1127 + template <> TYPE const *EST_TVector<TYPE>::def_val=&TAG##_vec_def_val_s; \
1128 + template <> TYPE *EST_TVector<TYPE>::error_return=&TAG##_vec_error_return_s;
1130 #define Declare_TVector_Class_T(TYPE,DEFAULT,ERROR,TAG) \
1131 static TYPE const TAG##_vec_def_val_s(DEFAULT); \
1132 static TYPE TAG##_vec_error_return_s(ERROR); \
1134 - TYPE const *EST_TVector<TYPE>::def_val=&TAG##_vec_def_val_s; \
1135 - TYPE *EST_TVector<TYPE>::error_return=&TAG##_vec_error_return_s;
1136 + template <> TYPE const *EST_TVector<TYPE>::def_val=&TAG##_vec_def_val_s; \
1137 + template <> TYPE *EST_TVector<TYPE>::error_return=&TAG##_vec_error_return_s;
1139 #define Declare_TVector(TYPE) Declare_TVector_T(TYPE,TYPE)
1140 #define Declare_TVector_Base(TYPE,DEFAULT,ERROR) Declare_TVector_Base_T(TYPE,DEFAULT,ERROR,TYPE)
1141 diff -uNr speech_tools.orig/stats/dynamic_program.cc speech_tools/stats/dynamic_program.cc
1142 --- speech_tools.orig/stats/dynamic_program.cc 2001-04-04 13:55:32.000000000 +0200
1143 +++ speech_tools/stats/dynamic_program.cc 2004-04-20 01:06:36.271618208 +0200
1147 static EST_Item *const def_val_item_ptr = NULL;
1148 -EST_Item* const *EST_Item_ptr_Vector::def_val = &def_val_item_ptr;
1149 +template <> EST_Item* const *EST_Item_ptr_Vector::def_val = &def_val_item_ptr;
1151 static EST_Item* error_return_item_ptr = NULL;
1152 -EST_Item* *EST_Item_ptr_Vector::error_return = &error_return_item_ptr;
1153 +template <> EST_Item* *EST_Item_ptr_Vector::error_return = &error_return_item_ptr;
1156 float (*local_cost_function)(const EST_Item *item1,