# HG changeset patch # User jwe # Date 949547131 0 # Node ID 41daa489833a1bde52579c9d12408dd0d1857169 # Parent 4833e231e05b2b9aec064cd9422782a5681f8c61 [project @ 2000-02-03 03:05:28 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,27 @@ 2000-02-02 John W. Eaton + * TEMPLATE-INST/SLStack-sym.cc: Delete meaningless `extern + template' declarations. + * TEMPLATE-INST/Array-tc.cc: Ditto. + + * TEMPLATE-INST/Map-fnc.cc: Don't try to instantiate goodCHptr or + CHptr_to_index here. + * TEMPLATE-INST/Map-tc.cc: Likewise. + + * load-save.cc (read_binary_file_header): Declare magic_len `const'. + + * token.h (token::token (const token&), token::operator=): + Delete unnecessary definitions. + + * oct-stream.cc (octave_stream::mode_as_string): Use + std::ios::binary, not std::ios::bin. + * load-save.cc (Fsave, Fload, save_user_variables): Likewise. + * DLD-FUNCTIONS/qz.cc (Fqz): Use Array class instead of trying to create automatic int array with variable size. * variables.cc (F__dump_symbol_info__): Fix continuation char. + * mappers.cc (Ftoupper): Likewise. * DLD-FUNCTIONS/besselj.cc (Fairy, Fbesselj): Likewise. * DLD-FUNCTIONS/chol.cc (Fchol): Likewise. * DLD-FUNCTIONS/det.cc (Fdet): Likewise. @@ -23,9 +41,12 @@ * token.h (token::token_type, token::end_tok_type, token::plot_tok_type): Delete extraneous comma from enum decls. + * load-save.cc (load_save_format): Likewise. * pt-idx.cc (tree_index_expression::tree_index_expression): Delete default arg values. + * oct-fstrm.cc (octave_fstream::octave_fstream): Likewise. + * oct-stream.cc (octave_stream::octave_stream): Likewise. * siglist.h, siglist.c: New files. * Makefile.in: Add them to the appropriate lists. diff --git a/src/TEMPLATE-INST/Array-tc.cc b/src/TEMPLATE-INST/Array-tc.cc --- a/src/TEMPLATE-INST/Array-tc.cc +++ b/src/TEMPLATE-INST/Array-tc.cc @@ -37,18 +37,6 @@ #include "ov.h" -extern template class Array; -extern template class Array2; -extern template class DiagArray2; - -extern template class Array; -extern template class Array2; -extern template class DiagArray2; - -extern template class Array; -extern template class Array2; -extern template class DiagArray2; - template class Array; template class Array2; diff --git a/src/TEMPLATE-INST/Map-fnc.cc b/src/TEMPLATE-INST/Map-fnc.cc --- a/src/TEMPLATE-INST/Map-fnc.cc +++ b/src/TEMPLATE-INST/Map-fnc.cc @@ -39,9 +39,6 @@ template class CHNode; template class CHMap; -template static int goodCHptr (CHNode *t); -template static unsigned int CHptr_to_index (CHNode *t); - /* ;;; Local Variables: *** ;;; mode: C++ *** diff --git a/src/TEMPLATE-INST/Map-tc.cc b/src/TEMPLATE-INST/Map-tc.cc --- a/src/TEMPLATE-INST/Map-tc.cc +++ b/src/TEMPLATE-INST/Map-tc.cc @@ -35,9 +35,6 @@ template class CHNode; template class CHMap; -template static int goodCHptr (CHNode *t); -template static unsigned int CHptr_to_index (CHNode *t); - /* ;;; Local Variables: *** ;;; mode: C++ *** diff --git a/src/TEMPLATE-INST/SLStack-sym.cc b/src/TEMPLATE-INST/SLStack-sym.cc --- a/src/TEMPLATE-INST/SLStack-sym.cc +++ b/src/TEMPLATE-INST/SLStack-sym.cc @@ -37,13 +37,6 @@ #include "symtab.h" -extern template class SLNode; -extern template class SLList; - -extern template class Stack; - -extern template class SLStack; - template class SLNode; template class SLList; diff --git a/src/load-save.cc b/src/load-save.cc --- a/src/load-save.cc +++ b/src/load-save.cc @@ -80,7 +80,7 @@ LS_BINARY, LS_MAT_ASCII, LS_MAT_BINARY, - LS_UNKNOWN, + LS_UNKNOWN }; // Return TRUE if S is a valid identifier. @@ -988,7 +988,7 @@ static void get_lines_and_columns (std::istream& is, const std::string& filename, int& nr, int& nc) { - streampos pos = is.tellg (); + std::streampos pos = is.tellg (); int file_line_number = 0; @@ -1464,8 +1464,8 @@ oct_mach_info::float_format& flt_fmt, bool quiet = false) { - int magic_len = 10; - char magic [magic_len+1]; + const int magic_len = 10; + char magic[magic_len+1]; is.read (magic, magic_len); magic[magic_len] = '\0'; if (strncmp (magic, "Octave-1-L", magic_len) == 0) @@ -1827,7 +1827,7 @@ unsigned mode = std::ios::in; if (format == LS_BINARY || format == LS_MAT_BINARY) - mode |= std::ios::bin; + mode |= std::ios::binary; std::ifstream file (fname.c_str (), mode); @@ -2541,7 +2541,7 @@ unsigned mode = std::ios::out|std::ios::trunc; if (format == LS_BINARY || format == LS_MAT_BINARY) - mode |= std::ios::bin; + mode |= std::ios::binary; std::ofstream file (fname, mode); @@ -2708,7 +2708,7 @@ unsigned mode = std::ios::out; if (format == LS_BINARY || format == LS_MAT_BINARY) - mode |= std::ios::bin; + mode |= std::ios::binary; mode |= append ? std::ios::ate : std::ios::trunc; diff --git a/src/mappers.cc b/src/mappers.cc --- a/src/mappers.cc +++ b/src/mappers.cc @@ -597,7 +597,7 @@ \n\ @example\n\ @group\n\ -toupper (\"MiXeD cAsE 123\") +toupper (\"MiXeD cAsE 123\")\n\ @result{} \"MIXED CASE 123\"\n\ @end group\n\ @end example\n\ diff --git a/src/oct-fstrm.cc b/src/oct-fstrm.cc --- a/src/oct-fstrm.cc +++ b/src/oct-fstrm.cc @@ -37,10 +37,9 @@ return octave_stream (new octave_fstream (nm_arg, md, flt_fmt)); } -octave_fstream::octave_fstream - (const std::string& nm_arg, - std::ios::openmode md = std::ios::in|std::ios::out, - oct_mach_info::float_format flt_fmt) +octave_fstream::octave_fstream (const std::string& nm_arg, + std::ios::openmode md, + oct_mach_info::float_format flt_fmt) : octave_base_stream (md, flt_fmt), nm (nm_arg) { // Override default protection of 0664 so that umask will appear to diff --git a/src/oct-stream.cc b/src/oct-stream.cc --- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -2394,7 +2394,7 @@ error (msg); } -octave_stream::octave_stream (octave_base_stream *bs = 0) +octave_stream::octave_stream (octave_base_stream *bs) : rep (bs) { if (rep) @@ -2789,28 +2789,28 @@ retval = "a+"; break; - case std::ios::in | std::ios::bin: + case std::ios::in | std::ios::binary: retval = "rb"; break; - case std::ios::out | std::ios::bin: - case std::ios::out | std::ios::trunc | std::ios::bin: + case std::ios::out | std::ios::binary: + case std::ios::out | std::ios::trunc | std::ios::binary: retval = "wb"; break; - case std::ios::out | std::ios::app | std::ios::bin: + case std::ios::out | std::ios::app | std::ios::binary: retval = "ab"; break; - case std::ios::in | std::ios::out | std::ios::bin: + case std::ios::in | std::ios::out | std::ios::binary: retval = "r+b"; break; - case std::ios::in | std::ios::out | std::ios::trunc | std::ios::bin: + case std::ios::in | std::ios::out | std::ios::trunc | std::ios::binary: retval = "w+b"; break; - case std::ios::in | std::ios::out | std::ios::app | std::ios::bin: + case std::ios::in | std::ios::out | std::ios::app | std::ios::binary: retval = "a+b"; break; diff --git a/src/token.cc b/src/token.cc --- a/src/token.cc +++ b/src/token.cc @@ -131,17 +131,6 @@ return orig_text; } -token::token (const token& /* tok */) -{ - panic_impossible (); -} - -token& -token::operator = (const token& /* tok */) -{ - panic_impossible (); -} - /* ;;; Local Variables: *** ;;; mode: C++ *** diff --git a/src/token.h b/src/token.h --- a/src/token.h +++ b/src/token.h @@ -67,7 +67,8 @@ token (int l = -1, int c = -1); token (const std::string& s, int l = -1, int c = -1); - token (double d, const std::string& s = std::string (), int l = -1, int c = -1); + token (double d, const std::string& s = std::string (), + int l = -1, int c = -1); token (end_tok_type t, int l = -1, int c = -1); token (plot_tok_type t, int l = -1, int c = -1); token (symbol_record *s, int l = -1, int c = -1); @@ -86,7 +87,11 @@ std::string text_rep (void); private: + + // No copying! + token (const token& tok); + token& operator = (const token& tok); int line_num;