# HG changeset patch # User jwe # Date 1041548123 0 # Node ID bdaa0d3dfc0bf781e3e4498f559adc83fd0423dc # Parent 17826ec287bc784dc91717481e4ec09ddb45f6b5 [project @ 2003-01-02 22:55:23 by jwe] diff -r 17826ec287bc -r bdaa0d3dfc0b src/ChangeLog --- 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 + + * 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 * pt-arg-list.cc (tree_argument_list::append): New function. diff -r 17826ec287bc -r bdaa0d3dfc0b src/pt-misc.cc --- 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++) { diff -r 17826ec287bc -r bdaa0d3dfc0b src/pt-misc.h --- 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); diff -r 17826ec287bc -r bdaa0d3dfc0b src/pt-plot.cc --- 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-"); diff -r 17826ec287bc -r bdaa0d3dfc0b src/pt-plot.h --- 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&); diff -r 17826ec287bc -r bdaa0d3dfc0b src/symtab.cc --- 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 diff -r 17826ec287bc -r bdaa0d3dfc0b src/variables.cc --- 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 (); diff -r 17826ec287bc -r bdaa0d3dfc0b src/version.h --- 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 ")"