changeset 4261:bdaa0d3dfc0b

[project @ 2003-01-02 22:55:23 by jwe]
author jwe
date Thu, 02 Jan 2003 22:55:23 +0000
parents 17826ec287bc
children 1264aac9e73a
files src/ChangeLog src/pt-misc.cc src/pt-misc.h src/pt-plot.cc src/pt-plot.h src/symtab.cc src/variables.cc src/version.h
diffstat 8 files changed, 37 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jan 02 17:59:17 2003 +0000
+++ b/src/ChangeLog	Thu Jan 02 22:55:23 2003 +0000
@@ -1,3 +1,18 @@
+2003-01-02  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* symtab.cc (symbol_record::define): If definition already exists,
+	redefine it instead of replacing it.
+
+	* variables.cc (symbol_exist): Don't use reference when handling
+	sr->def ().
+
+	* pt-plot.cc (save_in_tmp_file): octave_value arg is now const.
+	* pt-misc.cc (tree_parameter_list::initialize_undefined_elements):
+	Likewise.
+
+	* symtab.cc (symbol_record::clear): Don't do anything if the
+	symbol record is already undefined.
+
 2003-01-01  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* pt-arg-list.cc (tree_argument_list::append): New function.
--- a/src/pt-misc.cc	Thu Jan 02 17:59:17 2003 +0000
+++ b/src/pt-misc.cc	Thu Jan 02 22:55:23 2003 +0000
@@ -59,7 +59,7 @@
 }
 
 void
-tree_parameter_list::initialize_undefined_elements (octave_value& val)
+tree_parameter_list::initialize_undefined_elements (const octave_value& val)
 {
   for (iterator p = begin (); p != end (); p++)
     {
--- a/src/pt-misc.h	Thu Jan 02 17:59:17 2003 +0000
+++ b/src/pt-misc.h	Thu Jan 02 22:55:23 2003 +0000
@@ -65,7 +65,7 @@
 
   bool varargs_only (void) { return (marked_for_varargs < 0); }
 
-  void initialize_undefined_elements (octave_value& val);
+  void initialize_undefined_elements (const octave_value& val);
 
   void define_from_arg_vector (const octave_value_list& args);
 
--- a/src/pt-plot.cc	Thu Jan 02 17:59:17 2003 +0000
+++ b/src/pt-plot.cc	Thu Jan 02 22:55:23 2003 +0000
@@ -845,7 +845,7 @@
 }
 
 std::string
-save_in_tmp_file (octave_value& t, int ndim, bool parametric)
+save_in_tmp_file (const octave_value& t, int ndim, bool parametric)
 {
   std::string name = file_ops::tempnam ("", "oct-");
 
--- a/src/pt-plot.h	Thu Jan 02 17:59:17 2003 +0000
+++ b/src/pt-plot.h	Thu Jan 02 22:55:23 2003 +0000
@@ -426,8 +426,8 @@
   subplot_list& operator = (const subplot_list&);
 };
 
-extern std::string save_in_tmp_file (octave_value& t, int ndim = 2,
-				bool parametric = false);
+extern std::string save_in_tmp_file (const octave_value& t, int ndim = 2,
+				     bool parametric = false);
 
 extern void mark_for_deletion (const std::string&);
 
--- a/src/symtab.cc	Thu Jan 02 17:59:17 2003 +0000
+++ b/src/symtab.cc	Thu Jan 02 22:55:23 2003 +0000
@@ -247,9 +247,10 @@
     {
       octave_value tmp (f);
 
-      delete definition;
-
-      definition = new symbol_def (tmp, sym_type);
+      if (! definition)
+	definition = new symbol_def (tmp, sym_type);
+      else
+	definition->define (tmp, sym_type);
 
       retval = true;
     }
@@ -260,16 +261,19 @@
 void
 symbol_record::clear (void)
 {
-  if (! tagged_static)
+  if (is_defined ())
     {
-      if (--definition->count <= 0)
-	delete definition;
+      if (! tagged_static)
+	{
+	  if (--definition->count <= 0)
+	    delete definition;
 
-      definition = new symbol_def ();
-    }
+	  definition = new symbol_def ();
+	}
 
-  if (linked_to_global)
-    linked_to_global = 0;
+      if (linked_to_global)
+	linked_to_global = 0;
+    }
 }
 
 void
--- a/src/variables.cc	Thu Jan 02 17:59:17 2003 +0000
+++ b/src/variables.cc	Thu Jan 02 22:55:23 2003 +0000
@@ -586,7 +586,7 @@
 	  && (type == "any" || type == "file")
 	  && (sr->is_user_function () || sr->is_dld_function ()))
 	{
-	  octave_value& t = sr->def ();
+	  octave_value t = sr->def ();
 	  octave_function *f = t.function_value (true);
 	  std::string s = f ? f->fcn_file_name () : std::string ();
 
--- a/src/version.h	Thu Jan 02 17:59:17 2003 +0000
+++ b/src/version.h	Thu Jan 02 22:55:23 2003 +0000
@@ -23,10 +23,10 @@
 #if !defined (octave_version_h)
 #define octave_version_h 1
 
-#define OCTAVE_VERSION "2.1.40"
+#define OCTAVE_VERSION "2.1.41"
 
 #define OCTAVE_COPYRIGHT \
-  "Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 John W. Eaton."
+  "Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 John W. Eaton."
 
 #define OCTAVE_NAME_AND_VERSION \
   "GNU Octave, version " OCTAVE_VERSION " (" OCTAVE_CANONICAL_HOST_TYPE ")"