changeset 3552:41daa489833a

[project @ 2000-02-03 03:05:28 by jwe]
author jwe
date Thu, 03 Feb 2000 03:05:31 +0000
parents 4833e231e05b
children c5600b44bef9
files src/ChangeLog src/TEMPLATE-INST/Array-tc.cc src/TEMPLATE-INST/Map-fnc.cc src/TEMPLATE-INST/Map-tc.cc src/TEMPLATE-INST/SLStack-sym.cc src/load-save.cc src/mappers.cc src/oct-fstrm.cc src/oct-stream.cc src/token.cc src/token.h
diffstat 11 files changed, 46 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/ChangeLog	Thu Feb 03 03:05:31 2000 +0000
@@ -1,9 +1,27 @@
 2000-02-02  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* 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<int> 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.
--- a/src/TEMPLATE-INST/Array-tc.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/TEMPLATE-INST/Array-tc.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -37,18 +37,6 @@
 
 #include "ov.h"
 
-extern template class Array<int>;
-extern template class Array2<int>;
-extern template class DiagArray2<int>;
-
-extern template class Array<double>;
-extern template class Array2<double>;
-extern template class DiagArray2<double>;
-
-extern template class Array<Complex>;
-extern template class Array2<Complex>;
-extern template class DiagArray2<Complex>;
-
 template class Array<octave_value>;
 template class Array2<octave_value>;
 
--- a/src/TEMPLATE-INST/Map-fnc.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/TEMPLATE-INST/Map-fnc.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -39,9 +39,6 @@
 template class CHNode<file_name_cache_elt>;
 template class CHMap<file_name_cache_elt>;
 
-template static int goodCHptr (CHNode<file_name_cache_elt> *t);
-template static unsigned int CHptr_to_index (CHNode<file_name_cache_elt> *t);
-
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***
--- a/src/TEMPLATE-INST/Map-tc.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/TEMPLATE-INST/Map-tc.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -35,9 +35,6 @@
 template class CHNode<octave_value>;
 template class CHMap<octave_value>;
 
-template static int goodCHptr (CHNode<octave_value> *t);
-template static unsigned int CHptr_to_index (CHNode<octave_value> *t);
-
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***
--- a/src/TEMPLATE-INST/SLStack-sym.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/TEMPLATE-INST/SLStack-sym.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -37,13 +37,6 @@
 
 #include "symtab.h"
 
-extern template class SLNode<unsigned>;
-extern template class SLList<unsigned>;
-
-extern template class Stack<unsigned>;
-
-extern template class SLStack<unsigned>;
-
 template class SLNode<symbol_record::symbol_def *>;
 template class SLList<symbol_record::symbol_def *>;
 
--- a/src/load-save.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/load-save.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -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;
 
--- a/src/mappers.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/mappers.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -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\
--- a/src/oct-fstrm.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/oct-fstrm.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -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
--- a/src/oct-stream.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/oct-stream.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -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;
 
--- a/src/token.cc	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/token.cc	Thu Feb 03 03:05:31 2000 +0000
@@ -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++ ***
--- a/src/token.h	Thu Feb 03 02:30:44 2000 +0000
+++ b/src/token.h	Thu Feb 03 03:05:31 2000 +0000
@@ -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;