# HG changeset patch # User jwe # Date 1068604195 0 # Node ID 3a284f89aa41f58cae2598a2bc12c39d15c4c2bc # Parent 77566be8b9e95c0c55045939bb9bcf0c6538ba50 [project @ 2003-11-12 02:27:28 by jwe] diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array-C.cc --- a/liboctave/Array-C.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array-C.cc Wed Nov 12 02:29:55 2003 +0000 @@ -31,19 +31,12 @@ #include "Array.h" #include "Array.cc" -template class Array; +INSTANTIATE_ARRAY_AND_ASSIGN (Complex); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); - -template int assign (Array&, const Array&, const Complex&); -template int assign (Array&, const Array&, const Complex&); -template int assign (Array&, const Array&, const Complex&); -template int assign (Array&, const Array&, const Complex&); -template int assign (Array&, const Array&, const Complex&); +INSTANTIATE_ARRAY_ASSIGN (Complex, double); +INSTANTIATE_ARRAY_ASSIGN (Complex, int); +INSTANTIATE_ARRAY_ASSIGN (Complex, short); +INSTANTIATE_ARRAY_ASSIGN (Complex, char); #include "Array2.h" diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array-b.cc --- a/liboctave/Array-b.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array-b.cc Wed Nov 12 02:29:55 2003 +0000 @@ -29,11 +29,7 @@ #include "Array.h" #include "Array.cc" -template class Array; - -template int assign (Array&, const Array&); - -template int assign (Array&, const Array&, const bool&); +INSTANTIATE_ARRAY_AND_ASSIGN (bool); #include "Array2.h" diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array-ch.cc --- a/liboctave/Array-ch.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array-ch.cc Wed Nov 12 02:29:55 2003 +0000 @@ -29,11 +29,7 @@ #include "Array.h" #include "Array.cc" -template class Array; - -template int assign (Array&, const Array&); - -template int assign (Array&, const Array&, const char&); +INSTANTIATE_ARRAY_AND_ASSIGN (char); #include "Array2.h" diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array-d.cc --- a/liboctave/Array-d.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array-d.cc Wed Nov 12 02:29:55 2003 +0000 @@ -29,17 +29,11 @@ #include "Array.h" #include "Array.cc" -template class Array; +INSTANTIATE_ARRAY_AND_ASSIGN (double); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); - -template int assign (Array&, const Array&, const double&); -template int assign (Array&, const Array&, const double&); -template int assign (Array&, const Array&, const double&); -template int assign (Array&, const Array&, const double&); +INSTANTIATE_ARRAY_ASSIGN (double, int); +INSTANTIATE_ARRAY_ASSIGN (double, short); +INSTANTIATE_ARRAY_ASSIGN (double, char); #include "Array2.h" diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array-i.cc --- a/liboctave/Array-i.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array-i.cc Wed Nov 12 02:29:55 2003 +0000 @@ -29,15 +29,10 @@ #include "Array.h" #include "Array.cc" -template class Array; +INSTANTIATE_ARRAY_AND_ASSIGN (int); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); - -template int assign (Array&, const Array&, const int&); -template int assign (Array&, const Array&, const int&); -template int assign (Array&, const Array&, const int&); +INSTANTIATE_ARRAY_ASSIGN (int, short); +INSTANTIATE_ARRAY_ASSIGN (int, char); #include "Array2.h" diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array-idx-vec.cc --- a/liboctave/Array-idx-vec.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array-idx-vec.cc Wed Nov 12 02:29:55 2003 +0000 @@ -31,7 +31,7 @@ #include "Array.h" #include "Array.cc" -template class Array; +INSTANTIATE_ARRAY (idx_vector); /* ;;; Local Variables: *** diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array-s.cc --- a/liboctave/Array-s.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array-s.cc Wed Nov 12 02:29:55 2003 +0000 @@ -29,13 +29,9 @@ #include "Array.h" #include "Array.cc" -template class Array; +INSTANTIATE_ARRAY_AND_ASSIGN (int); -template int assign (Array&, const Array&); -template int assign (Array&, const Array&); - -template int assign (Array&, const Array&, const short&); -template int assign (Array&, const Array&, const short&); +INSTANTIATE_ARRAY_ASSIGN (short, char); #include "Array2.h" diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array-str.cc --- a/liboctave/Array-str.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array-str.cc Wed Nov 12 02:29:55 2003 +0000 @@ -31,7 +31,7 @@ #include -template class Array; +INSTANTIATE_ARRAY (std::string); /* ;;; Local Variables: *** diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/Array.h --- a/liboctave/Array.h Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/Array.h Wed Nov 12 02:29:55 2003 +0000 @@ -543,6 +543,21 @@ return assign (lhs, rhs, resize_fill_value (LT ())); } +#define INSTANTIATE_ARRAY_ASSIGN(LT, RT) \ + template int assign (Array&, const Array&, const LT&); \ + template int assign1 (Array&, const Array&, const LT&); \ + template int assign2 (Array&, const Array&, const LT&); \ + template int assignN (Array&, const Array&, const LT&); \ + template int assign (Array&, const Array&) + +#define INSTANTIATE_ARRAY(T) \ + template class Array; \ + template T resize_fill_value (const T&) + +#define INSTANTIATE_ARRAY_AND_ASSIGN(T) \ + INSTANTIATE_ARRAY (T); \ + INSTANTIATE_ARRAY_ASSIGN (T, T) + #endif /* diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/ChangeLog --- a/liboctave/ChangeLog Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/ChangeLog Wed Nov 12 02:29:55 2003 +0000 @@ -1,5 +1,10 @@ 2003-11-11 John W. Eaton + * Array.h (INSTANTIATE_ARRAY_ASSIGN, INSTANTIATE_ARRAY_AND_ASSIGN, + INSTANTIATE_ARRAY): New macros. + * Array-C.cc, Array-b.cc, Array-ch.cc, Array-d.cc, Array-i.cc, + Array-idx-vec.cc, Array-s.cc, Array-str.cc, ODESSA.cc: Use them. + * Array.h (Array::ipermute): New function. 2003-11-11 Petter Risholm diff -r 77566be8b9e9 -r 3a284f89aa41 liboctave/ODESSA.cc --- a/liboctave/ODESSA.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/liboctave/ODESSA.cc Wed Nov 12 02:29:55 2003 +0000 @@ -62,7 +62,7 @@ odessa_jac_ptr, int&); } -template class Array; +INSTANTIATE_ARRAY (Matrix); static ODESFunc::ODES_fsub user_fsub; static ODESFunc::ODES_bsub user_bsub; diff -r 77566be8b9e9 -r 3a284f89aa41 src/ChangeLog --- a/src/ChangeLog Tue Nov 11 17:25:42 2003 +0000 +++ b/src/ChangeLog Wed Nov 12 02:29:55 2003 +0000 @@ -1,5 +1,9 @@ 2003-11-11 John W. Eaton + * TEMPLATE-INST/Array-tc.cc, TEMPLATE-INST/Array-c.cc, + TEMPLATE-INST/Array-os.cc, TEMPLATE-INST/Array-sym.cc, + ov-typeinfo.cc: Use new INSTANTIATE_ARRAY macro. + * data.cc (do_permute): New function. (Fpermute, Fipermute): Use it. diff -r 77566be8b9e9 -r 3a284f89aa41 src/TEMPLATE-INST/Array-oc.cc --- a/src/TEMPLATE-INST/Array-oc.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/src/TEMPLATE-INST/Array-oc.cc Wed Nov 12 02:29:55 2003 +0000 @@ -31,7 +31,7 @@ #include "sighandlers.h" -template class Array; +INSTANTIATE_ARRAY (octave_child); /* ;;; Local Variables: *** diff -r 77566be8b9e9 -r 3a284f89aa41 src/TEMPLATE-INST/Array-os.cc --- a/src/TEMPLATE-INST/Array-os.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/src/TEMPLATE-INST/Array-os.cc Wed Nov 12 02:29:55 2003 +0000 @@ -31,11 +31,11 @@ #include "oct-stream.h" -template class Array; +INSTANTIATE_ARRAY (scanf_format_elt *); -template class Array; +INSTANTIATE_ARRAY (printf_format_elt *); -template class Array; +INSTANTIATE_ARRAY (octave_stream); /* ;;; Local Variables: *** diff -r 77566be8b9e9 -r 3a284f89aa41 src/TEMPLATE-INST/Array-sym.cc --- a/src/TEMPLATE-INST/Array-sym.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/src/TEMPLATE-INST/Array-sym.cc Wed Nov 12 02:29:55 2003 +0000 @@ -32,7 +32,7 @@ #include "oct-obj.h" #include "symtab.h" -template class Array; +INSTANTIATE_ARRAY (symbol_record *); /* ;;; Local Variables: *** diff -r 77566be8b9e9 -r 3a284f89aa41 src/TEMPLATE-INST/Array-tc.cc --- a/src/TEMPLATE-INST/Array-tc.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/src/TEMPLATE-INST/Array-tc.cc Wed Nov 12 02:29:55 2003 +0000 @@ -47,14 +47,7 @@ return retval; } -template class Array; - - -template int assign (Array&, const Array&); - -template int assign (Array&, - const Array&, const octave_value&); - +INSTANTIATE_ARRAY (octave_value); template class Array2; diff -r 77566be8b9e9 -r 3a284f89aa41 src/file-io.cc --- a/src/file-io.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/src/file-io.cc Wed Nov 12 02:29:55 2003 +0000 @@ -170,9 +170,8 @@ DEFUN (fclose, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fclose (@var{fid})\n\ -Closes the specified file. If an error is encountered while trying to\n\ -close the file, an error message is printed and @code{fclose} returns\n\ -0. Otherwise, it returns 1.\n\ +Closes the specified file. If successful, @code{fclose} returns 0,\n\ +otherwise, it returns -1.\n\ @end deftypefn") { octave_value retval = -1; diff -r 77566be8b9e9 -r 3a284f89aa41 src/ov-typeinfo.cc --- a/src/ov-typeinfo.cc Tue Nov 11 17:25:42 2003 +0000 +++ b/src/ov-typeinfo.cc Wed Nov 12 02:29:55 2003 +0000 @@ -46,21 +46,21 @@ #include -template class Array; +INSTANTIATE_ARRAY (unary_op_fcn); template class Array2; -template class Array; +INSTANTIATE_ARRAY (non_const_unary_op_fcn); template class Array2; -template class Array; +INSTANTIATE_ARRAY (binary_op_fcn); template class Array2; template class Array3; -template class Array; +INSTANTIATE_ARRAY (assign_op_fcn); template class Array2; template class Array3; -template class Array; +INSTANTIATE_ARRAY (type_conv_fcn); template class Array2; bool