Mercurial > hg > octave-lyh
changeset 3618:8cea69ad95ae
[project @ 2000-03-22 20:51:45 by jwe]
author | jwe |
---|---|
date | Wed, 22 Mar 2000 20:51:46 +0000 |
parents | b0d6c6e84d56 |
children | a7fe24b18fa4 |
files | scripts/ChangeLog scripts/image/saveimage.m src/ChangeLog src/oct-lvalue.h src/variables.cc |
diffstat | 5 files changed, 39 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2000-03-22 John W. Eaton <jwe@bevo.che.wisc.edu> + + * image/saveimage.m: Add comment to file saying who created it and + when it was created. Suggested by Stephen Eglen + <stephen@cogsci.ed.ac.uk>. + 2000-03-21 Paul Kienzle <pkienzle@kienzle.powernet.co.uk> * polynomial/polyreduce.m: Simplify by looking for the first
--- 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);
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2000-03-22 John W. Eaton <jwe@bevo.che.wisc.edu> + + * 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 <jwe@bevo.che.wisc.edu> * src/Makefile.in (LIBRARIES): Conditionally define.
--- 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,