# HG changeset patch # User jwe # Date 953758306 0 # Node ID 8cea69ad95ae1517995b4ee27d43a4a21b5a4b23 # Parent b0d6c6e84d56e44eb435d0ac64e94a1ecc54a7c3 [project @ 2000-03-22 20:51:45 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2000-03-22 John W. Eaton + + * image/saveimage.m: Add comment to file saying who created it and + when it was created. Suggested by Stephen Eglen + . + 2000-03-21 Paul Kienzle * polynomial/polyreduce.m: Simplify by looking for the first diff --git a/scripts/image/saveimage.m b/scripts/image/saveimage.m --- a/scripts/image/saveimage.m +++ b/scripts/image/saveimage.m @@ -150,6 +150,16 @@ img (idx) = ones (size (idx)); if (strcmp (img_form, "ppm")) + + ## Would be nice to make this consistent with the line used by the + ## load/save functions, but we need a good way to get username and + ## hostname information. + + time_string = ctime (time ()); + time_string = time_string (1:length (time_string)-1); + tagline = sprintf ("# Created by Octave %s, %s", + __OCTAVE_VERSION__, time_string); + if (grey && map_nr == 2 && bw) if (map(1) != 0) @@ -181,7 +191,7 @@ endfor fid = fopen (filename, "w"); - fprintf (fid, "P4\n%d %d\n", img_nr, img_nc); + fprintf (fid, "P4\n%s\n%d %d\n", tagline, img_nr, img_nc); fwrite (fid, tmp, "char"); fprintf (fid, "\n"); fclose (fid); @@ -189,7 +199,7 @@ elseif (grey) fid = fopen (filename, "w"); - fprintf (fid, "P5\n%d %d\n255\n", img_nr, img_nc); + fprintf (fid, "P5\n%s\n%d %d\n255\n", tagline, img_nr, img_nc); fwrite (fid, map(img), "uchar"); fprintf (fid, "\n"); fclose (fid); @@ -211,7 +221,7 @@ tmp(img_idx--) = tmap(img); fid = fopen (filename, "w"); - fprintf (fid, "P6\n%d %d\n255\n", img_nr, img_nc); + fprintf (fid, "P6\n%s\n%d %d\n255\n", tagline, img_nr, img_nc); fwrite (fid, tmp, "uchar"); fprintf (fid, "\n"); fclose (fid); diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2000-03-22 John W. Eaton + + * oct-lvalue.h (dummy_val): New static variable. + (octave_lvalue::octave_lvalue): Use it to initialize val. + + * variables.cc (is_valid_function): Look in the global symbol + table for functions. + 2000-03-21 John W. Eaton * src/Makefile.in (LIBRARIES): Conditionally define. diff --git a/src/oct-lvalue.h b/src/oct-lvalue.h --- a/src/oct-lvalue.h +++ b/src/oct-lvalue.h @@ -31,12 +31,18 @@ #include "oct-obj.h" #include "symtab.h" +// XXX FIXME XXX -- eliminate the following kluge? + +// This variable is used when creating dummy octave_lvalue objects. +static octave_value dummy_val; + class octave_lvalue { public: - octave_lvalue (octave_value *v = 0, symbol_record::change_function f = 0) + octave_lvalue (octave_value *v = &dummy_val, + symbol_record::change_function f = 0) : val (v), idx (), chg_fcn (f), struct_elt_name (), index_set (false) { } octave_lvalue (octave_value *v, const std::string& nm, diff --git a/src/variables.cc b/src/variables.cc --- a/src/variables.cc +++ b/src/variables.cc @@ -140,7 +140,11 @@ symbol_record *sr = 0; if (! fcn_name.empty ()) - sr = lookup_by_name (fcn_name); + { + sr = global_sym_tab->lookup (fcn_name, true); + + lookup (sr, false); + } if (sr) {